API:使用公共子网创建VSI失败,错误为“指定的子网#1217371(169.44.xxx.0/27)当前没有可用的插槽“ [英] API :create a VSI with a public subnet fail with error " The subnet specified #1217371 (169.44.xxx.0/27) does not currently have available slots"
问题描述
尝试创建具有公共子网的VSI失败,并显示错误指定的子网#1217371(169.44.xxx.0/27)当前没有可用的插槽",但是子网ID应该具有足够的ips
Try to create a VSI with a public subnet fail with error " The subnet specified #1217371 (169.44.xxx.0/27) does not currently have available slots", but the subnet id should have enought ips
这是问题
1 what's concept for slot ?
2 how to check slot infor for public subnet by API
3 how to apply slot
这是日志
>>> templateObject = {'domain': 'rccmlk.com', 'localDiskFlag': True, 'maxMemory': 1024, 'networkComponents': [{'maxSpeed': 1000}],'primaryBackendNetworkComponent': {'networkVlan': {'primarySubnetId': 821332}}, 'primaryNetworkComponent': {'networkVlan': {'primarySubnetId': 1217371}}, 'datacenter': {'name': 'dal09'}, 'hourlyBillingFlag': True, 'hostname': 'WDSPARKtest', 'startCpus': 1, 'operatingSystemReferenceCode': 'CENTOS_LATEST_64', 'sshKeys': [{'id': '756355'}]}
>>> vsi = client['SoftLayer_Virtual_Guest'].createObject(templateObject)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 392, in call_handler
return self(name, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 360, in call
return self.client.call(self.name, name, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/SoftLayer/API.py", line 263, in call
return self.transport(request)
File "/usr/local/lib/python2.7/dist-packages/SoftLayer/transports.py", line 195, in __call__
raise _ex(ex.faultCode, ex.faultString)
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): The subnet specified #1217371 (169.44.xxx.xxx/27) does not currently have available slots. Free up space or remove the subnet specification.
here is subnet infor
{'addressSpace': 'PUBLIC',
'broadcastAddress': '169.44.xxx.xxx',
'cidr': 27,
'datacenter': {'id': xxxxxx,
'longName': 'Dallas 9',
'name': 'xxxxxx',
'statusId': 2},
'gateway': '169.44.xxx.xxx',
'hardware': [],
'id': 1217371,<<<<<<<<<<<<<<<<<
'ipAddressCount': 32,
'isCustomerOwned': False,
'isCustomerRoutable': False,
'modifyDate': '2016-05-16T20:43:19-07:00',
'netmask': '255.255.255.224',
'networkIdentifier': '169.44.109.0',
'networkVlan': {'id': 835113, 'networkSpace': 'PUBLIC'},
'networkVlanId': 835113,
'sortOrder': '2',
'subnetType': 'SECONDARY_ON_VLAN',
'totalIpAddresses': '32',<<<<<<<<<<<<<<<<<<
'usableIpAddressCount': '29',
'version': 4,
'virtualGuests': []},<<<<<<<<<<<<<<<<<<<<<<
Update 1
推荐答案
首先,您需要确保可以使用控制门户网站通过该子网订购VSI,这是因为API显示的错误不是关于实际错误的信息非常准确,因此,如果您可以在控制门户网站中使用子网,则可能与Softlayer的Python客户端有关.
Well first of all you need to make sure that you can order a VSI with that subnet using the control portal this is because the error displayed by the API is not quite accurate about the real error, so if you can use the subnet in control portal so it may be an issue with the Softlayer's Python client.
如果您不能使用任何子网订购VSI,请在此处查看有关此信息的更多信息
Jus in case you cannot use any subnet to order a VSI see more information about that here https://knowledgelayer.softlayer.com/learning/utilizing-subnets-and-ips practically you only can use the primary subnet.
插槽是子网中的免费IP地址,您可以使用此方法获取子网的IP地址
The slots are free IP address in the subnet you can get the ip address of the subnet using this method
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Subnet/getIpAddresses
然后,如果保留了所有IP,因此没有可用的插槽,则需要检查是否保留了IP的状态.
Then you need to check the status of the if it is reservaded or not in case all the IP are reservaded so there is not free slots.
在这里您可以看到有关免费插槽的相关论坛问题:
here you can see a related forum question about the free slots:
SoftLayer知道VLAN中的IP总数以及可用IP的API
希望对您有帮助
致谢
这篇关于API:使用公共子网创建VSI失败,错误为“指定的子网#1217371(169.44.xxx.0/27)当前没有可用的插槽“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!