尝试使用Softlayer Python API订购虚拟机时遇到此异常。
SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_Public): 1 Gbps Public & Private Network Uplinks must be ordered with permission Add Compute with Public Network Port.
这是VSI:
client = SoftLayer.Client(username=softlayerusername, api_key=softlayerapikey)
manager = SoftLayer.VSManager(client)
new_vsi = {
'domain': domain,
'hostname': hostname + str(n),
'datacenter': datacenter,
'dedicated': False,
'private': False,
'cpus': number_of_cpus,
'os_code' : u'UBUNTU_LATEST_64',
'hourly': is_hourly_billed,
'disks': ['100','25'],
'local_disk': True,
'memory': 16384,
'private_vlan': privatevlan,
'public_vlan': publicvlan,
'nic_speed':1000
}
vsi = manager.create_instance(**new_vsi)
我可以看到错误与nic_speed设置为1000有关,但我不知道"经许可订购的含义..."以及如何实现这一目标。这是在私人Softlayer帐户上,VLAN上有其他机器,网络速度大于1 Gbps
答案 0 :(得分:0)
似乎错误是因为您的帐户不允许使用公共网络端口的新VM,因此我建议您将值'private': False
更改为'private': True
,然后重试