1
我使用博託中,這樣的代碼:如何在AWS上請求現貨實例時附加現有的EBS卷?
dev_xvdb = boto.ec2.blockdevicemapping.EBSBlockDeviceType(volume_id='vol-xxxxxx')
bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping()
bdm['/dev/xvdb'] = dev_xvdb
rs = ec2.request_spot_instances(price=MY_MAX_PRICE,
image_id='ami-xxxxx',
count=1,
type='one-time',
key_name='MY_KEY_NAME',
security_groups=['default'],
instance_type='t1.micro',
block_device_map=bdm)
該代碼可以正常運行,但不能附加EBS卷(ID =體積-XXXXXX)。爲什麼?