Merge pull request #205 from DreadPirateShawn/DescribeInstancesBlockDeviceMapping
DescribeInstances: Added block_device_mapping to XML
This commit is contained in:
commit
21c8594612
@ -263,7 +263,7 @@ class Instance(BotoInstance, TaggedEC2Instance):
|
|||||||
self.key_name = kwargs.get("key_name")
|
self.key_name = kwargs.get("key_name")
|
||||||
|
|
||||||
self.block_device_mapping = BlockDeviceMapping()
|
self.block_device_mapping = BlockDeviceMapping()
|
||||||
self.block_device_mapping['/dev/sda1'] = BlockDeviceType()
|
self.block_device_mapping['/dev/sda1'] = BlockDeviceType(volume_id=random_volume_id())
|
||||||
|
|
||||||
amis = ec2_backend.describe_images(filters={'image-id': image_id})
|
amis = ec2_backend.describe_images(filters={'image-id': image_id})
|
||||||
ami = amis[0] if amis else None
|
ami = amis[0] if amis else None
|
||||||
|
@ -340,7 +340,17 @@ EC2_DESCRIBE_INSTANCES = """<DescribeInstancesResponse xmlns='http://ec2.amazona
|
|||||||
<kernelId>{{ instance.kernel }}</kernelId>
|
<kernelId>{{ instance.kernel }}</kernelId>
|
||||||
<rootDeviceType>ebs</rootDeviceType>
|
<rootDeviceType>ebs</rootDeviceType>
|
||||||
<rootDeviceName>/dev/sda1</rootDeviceName>
|
<rootDeviceName>/dev/sda1</rootDeviceName>
|
||||||
<blockDeviceMapping />
|
<blockDeviceMapping>
|
||||||
|
<item>
|
||||||
|
<deviceName>/dev/sda1</deviceName>
|
||||||
|
<ebs>
|
||||||
|
<volumeId>{{ instance.block_device_mapping['/dev/sda1'].volume_id }}</volumeId>
|
||||||
|
<status>attached</status>
|
||||||
|
<attachTime>YYYY-MM-DDTHH:MM:SS.SSSZ</attachTime>
|
||||||
|
<deleteOnTermination>true</deleteOnTermination>
|
||||||
|
</ebs>
|
||||||
|
</item>
|
||||||
|
</blockDeviceMapping>
|
||||||
<virtualizationType>{{ instance.virtualization_type }}</virtualizationType>
|
<virtualizationType>{{ instance.virtualization_type }}</virtualizationType>
|
||||||
<clientToken>ABCDE1234567890123</clientToken>
|
<clientToken>ABCDE1234567890123</clientToken>
|
||||||
<tagSet>
|
<tagSet>
|
||||||
|
@ -50,6 +50,10 @@ def test_instance_launch_and_terminate():
|
|||||||
instances[0].id.should.equal(instance.id)
|
instances[0].id.should.equal(instance.id)
|
||||||
instances[0].state.should.equal('running')
|
instances[0].state.should.equal('running')
|
||||||
|
|
||||||
|
root_device_name = instances[0].root_device_name
|
||||||
|
instances[0].block_device_mapping[root_device_name].status.should.equal('attached')
|
||||||
|
instances[0].block_device_mapping[root_device_name].volume_id.should.match(r'vol-\w+')
|
||||||
|
|
||||||
conn.terminate_instances([instances[0].id])
|
conn.terminate_instances([instances[0].id])
|
||||||
|
|
||||||
reservations = conn.get_all_instances()
|
reservations = conn.get_all_instances()
|
||||||
|
Loading…
Reference in New Issue
Block a user