TencentCloud / tencentcloud-sdk-python

Tencent Cloud API 3.0 SDK for Python
Apache License 2.0
613 stars 251 forks source link

没有指定系统盘信息,但返回 he value `50` specified in the parameter `SystemDisk.DiskSize` is not valid #7

Closed maxiaoyancn closed 6 years ago

maxiaoyancn commented 6 years ago

`cred = credential.Credential(SecretId, SecretKey) client = cvm_client.CvmClient(cred, "na-toronto")
req = models.RunInstancesRequest() req.InstanceChargeType = "PREPAID" # 预付费,即包年包月 req.InstanceChargePrepaid = { "Period": 1, # 购买实例的时长,单位:月 "RenewFlag": "NOTIFY_AND_AUTO_RENEW" # 自动续费标识,NOTIFY_AND_AUTO_RENEW:通知过期且自动续费 } req.Placement = {"Zone": "na-toronto-1" } req.InstanceType = "S2.SMALL2"
req.ImageId = "xxxx" req.DataDisks = [{"DiskType": "LOCAL_BASIC", "DiskSize": 500}] req.VirtualPrivateCloud ={ "VpcId":"xxxx", "SubnetId":"xxxx", } req.InternetAccessible = { "InternetChargeType": "BANDWIDTH_PACKAGE", "InternetMaxBandwidthOut": 100,
"PublicIpAssigned": True, } req.InstanceCount = 1 req.LoginSettings = {"Password": "xxxx"} req.SecurityGroupIds = ["sg-xxxx"]

    resp = client.RunInstances(req)

返回: [TencentCloudSDKException] code:InvalidParameterValue message:The value 50 specified in the parameter SystemDisk.DiskSize is not valid. requestId:xxxx

`

zqfan commented 6 years ago

这个是后台业务的问题,SDK和API是正常工作的。 在没有设置系统盘类型的情况下,默认选用了普通本地盘,而多伦多区的S2.small2机型不支持普通本地盘。 不同地域,机型支持的情况不一样,例如广州区不会出现该错误。

目前我们也只能通过改善官网文档中对这些细节的阐述,辅助用户正确配置。