尝试创建一个公有子网失败的VSI,错误“指定的子网#1217371(169.44.xxx.0 / 27)当前没有可用的插槽”,但是子网ID应该是ips 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
1 回答
首先,您需要确保可以使用控制门户订购具有该子网的VSI,这是因为API显示的错误对于实际错误不是很准确,因此如果您可以在控制门户中使用子网所以它可能是Softlayer的Python客户端的一个问题 .
如果您不能使用任何子网订购VSI,请参阅此处的更多信息https://knowledgelayer.softlayer.com/learning/utilizing-subnets-and-ips几乎您只能使用主子网 .
插槽是子网中的免费IP地址,您可以使用此方法获取子网的IP地址
http://sldn.softlayer.com/reference/services/SoftLayer_Network_Subnet/getIpAddresses
然后你需要检查它是否被保留状态,以防所有IP都被保留,因此没有空闲插槽 .
在这里您可以看到有关免费插槽的相关论坛问题:
SoftLayer API to know and total and available IPs in a VLAN
我希望它对你有所帮助
问候