0
votes

background

I get a exception when I order a VSI with specified the fronted and backend vlans.

The place order para of vlans are marked as

order_template = {...
'virtualGuests': [{'primaryBackendNetworkComponent': {'networkVlan': {'id': 2058375}}, 'domain': 'xxx', 'hostname': 'xxx', 'primaryNetworkComponent': {'networkVlan': {'id': 1698647}}
...}

The Exception as flow:

SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): When specifying frontend and backend VLANs, they must be on the appropriate router pair. The specified backend VLAN is on router `bcr02a.hkg02`, so the specified frontend VLAN should be on router `fcr02a.hkg02`. However, the specified frontend VLAN is on router `fcr01a.hkg02`. Please specify a matching VLAN router pair.

I known that fcr01a must match to bcr01a.

#get vlan info
object_mask = 'mask[id,name,primarySubnetId,vlanNumber,networkSpace,primaryRouter[id,datacenter[id,name]]]'
account.getNetworkVlans(mask=object_mask)

result:

vlans = [
                {'primaryRouter': {'datacenter': {'id': 352494, 'name': 'hkg02'}, 'id': 212460}, 'primarySubnetId': 987829, 'vlanNumber': 1461, 'id': 1698651},...]

question

How can I get the more information to check the frontend and bakcend are are matching VLAN router pair or not ?

Or, How can I set the mask to get fcr01a.hkg02 when I call account.getNetworkVlans?

Or, Is there any other item of vlan info to identity the pair relationship?

1

1 Answers

0
votes

In order To obtain more information about the vlan pair routing the Product_Order::getVlans will help you as it retrieves the available private and public vlans during ordering, you may use the locationId you provided as value (352494) to narrow the result, don´t forget that this value should match the datacenter you are using along the placeOrder method. For example use this on your python script:

locationId = 352494 #location id for Hong Kong 02 datacenter 
packageId = 46 #package for VSI.

result = client['Product_Order'].getVlans(locationId, packageId)

Or you may review the following url for a better script using Account::getNetworkVlans Ordering Softlayer Vlan pairs

You may improve your code by adding the property “hostname” to your mask and using Object Filters to search for required value, you may try the following improvement of your code:

objectMask=mask[id,name,primarySubnetId,vlanNumber,networkSpace,primaryRouter[id,hostname, datacenter[id,name]]]
objectFilter={"networkVlans":{"primaryRouter":{"hostname":{"operation":"fcr01a.hkg02"}}}}

account.getNetworkVlans(mask=object_mask, filter=objectFilter)

For more information please see below: https://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/getVlans