Я хочу создать ВМ по образу через API Python. Однако я получаю сообщение об ошибке:
"SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_InvalidValue):
Invalid value provided for 'blockDeviceTemplateGroup.globalIdentifier'.
A valid global identifier is required for a template."
мой код выглядит следующим образом:
import SoftLayer
from SoftLayer import VSManager
from pprint import pprint as pp
USERNAME = 'SLXXXXX'
API_KEY = 'bdf4f3124810a9e685a57xxxxxxxxxxxxxxxxxxxxxxx'
client = SoftLayer.create_client_from_env(username=USERNAME, api_key=API_KEY)
mgr = SoftLayer.VSManager(client)
vsi = mgr.create_instance( hourly=True, image_id=2221859, hostname='p01', domain='esm.com', cpus=1 , memory=1, datacenter='hkg02')
print vsi
Если я использую клиент Python и запускаю следующую команду
slcli vs create --billing=hourly --image=2221859 --hostname=p01 --domain=esm.com --cpu=1 --memory=1 --datacenter=hkg02
Я могу создать виртуальную машину.
Но с помощью программы на Python я не могу ее создать.
Деталь изображения:
:....................:......................................:
: name : value :
:....................:......................................:
: id : 2221859 :
: global_identifier : 59570b71-0a3e-4327-a89a-3dfc479ba997 :
: name : tinyproxy :
: status : Active :
: active_transaction : - :
: account : 792321 :
: visibility : Private :
: type : System :
: flex : False :
: note : None :
: created : 2019-04-18T03:04:59-05:00 :
: disk_space : 1.50G :
: datacenters : hkg02 :
:....................:......................................: