How to mount ephemeral storage on a windows ec2 instance using boto?

I have AMI with Windows Server 2008 as the root device of EBS. I can start its instance using boto and remote desktop, but I cannot get it to install its ephemeral storage. Is there something wrong with my BlockDeviceMapping?

Here is my code:

import boto
from boto.ec2.connection import EC2Connection
conn = EC2Connection(mykey, mysecretkey)
bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping({'/dev/xvdb':'ephemeral0'})
conn.run_instances(myami, key_name=mykeyname,security_groups=[mysecgroup],block_device_map=bdm)

When I run this code, an instance of the instance appears, and I can access it, but I only see that the root device is installed.

+3
source share
1 answer

. , , , BlockDeviceType. :

from boto.ec2.connection import EC2Connection
from boto.ec2.blockdevicemapping import BlockDeviceType, BlockDeviceMapping
conn = EC2Connection(mykey, mysecretkey)
xvdb = BlockDeviceType()
xvdb.ephemeral_name='ephemeral0'
bdm = BlockDeviceMapping()
bdm['/dev/xvdb'] = xvdb
conn.run_instances(myami, key_name=mykeyname,security_groups=[mysecgroup],block_device_map=bdm)

, . , AWS . .

- /, .

+5

All Articles