Fix test_shelve_volume_backed_instance
test_shelve_volume_backed_instance actually created an instance with the
volume attached as a data disk rather than the root disk. This fix makes
it create an instance with the volume as the root disk.
Change-Id: I719aa7ec2507b7936c08d17108511260830ad099
Closes-Bug: 1613946
diff --git a/tempest/scenario/test_shelve_instance.py b/tempest/scenario/test_shelve_instance.py
index 4b9c61c..7f04b0d 100644
--- a/tempest/scenario/test_shelve_instance.py
+++ b/tempest/scenario/test_shelve_instance.py
@@ -53,25 +53,12 @@
security_group = self._create_security_group()
security_groups = [{'name': security_group['name']}]
- if boot_from_volume:
- volume = self.create_volume(size=CONF.volume.volume_size,
- imageRef=CONF.compute.image_ref)
- bd_map = [{
- 'device_name': 'vda',
- 'volume_id': volume['id'],
- 'delete_on_termination': '0'}]
-
- server = self.create_server(
- key_name=keypair['name'],
- security_groups=security_groups,
- block_device_mapping=bd_map,
- wait_until='ACTIVE')
- else:
- server = self.create_server(
- image_id=CONF.compute.image_ref,
- key_name=keypair['name'],
- security_groups=security_groups,
- wait_until='ACTIVE')
+ server = self.create_server(
+ image_id=CONF.compute.image_ref,
+ key_name=keypair['name'],
+ security_groups=security_groups,
+ wait_until='ACTIVE',
+ volume_backed=boot_from_volume)
instance_ip = self.get_server_ip(server)
timestamp = self.create_timestamp(instance_ip,