本文整理汇总了Python中zstackwoodpecker.test_lib.lib_get_disk_offering_by_name函数的典型用法代码示例。如果您正苦于以下问题:Python lib_get_disk_offering_by_name函数的具体用法?Python lib_get_disk_offering_by_name怎么用?Python lib_get_disk_offering_by_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lib_get_disk_offering_by_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test():
global test_obj_dict
test_util.test_dsc('Create a VM with 3 additional data volumes with 1 of them using virtio-scsi')
disk_offering1 = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
disk_offering_uuids = []
for i in range(0, 8):
disk_offering_uuids.append(disk_offering1.uuid)
disk_offering2 = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
for i in range(0, 14):
disk_offering_uuids.append(disk_offering2.uuid)
vm = test_stub.create_vlan_vm(system_tags=["virtio::diskOffering::%s::num::14" % (disk_offering2.uuid) ,"virtio::diskOffering::%s::num::14" % (disk_offering1.uuid)], l3_name=os.environ.get('l3VlanNetworkName1'), disk_offering_uuids=disk_offering_uuids)
test_obj_dict.add_vm(vm)
vm.check()
volumes_number = len(test_lib.lib_get_all_volumes(vm.vm))
if volumes_number != 23:
test_util.test_fail('Did not find 23 volumes for [vm:] %s. But we assigned 22 data volume when create the vm. We only catch %s volumes' % (vm.vm.uuid, volumes_number))
else:
test_util.test_logger('Find 23 volumes for [vm:] %s.' % vm.vm.uuid)
scsi_cmd = 'ls /dev/sd* | wc -l'
if test_lib.lib_execute_command_in_vm(vm.get_vm(), scsi_cmd).strip() != '22':
test_util.test_fail('Only expect 22 disk in virtio scsi mode')
vm.destroy()
test_util.test_pass('Create a VM with 22 additional data volumes with 22 of them using virtio-scsi PASS')
示例2: share_admin_resource
def share_admin_resource(account_uuid_list):
instance_offering_uuid = res_ops.get_resource(res_ops.INSTANCE_OFFERING)[0].uuid
cond = res_ops.gen_query_conditions('mediaType', '!=', 'ISO')
image_uuid = res_ops.query_resource(res_ops.IMAGE, cond)[0].uuid
l3net_uuid = res_ops.get_resource(res_ops.L3_NETWORK)[0].uuid
root_disk_uuid = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName')).uuid
data_disk_uuid = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName')).uuid
acc_ops.share_resources(account_uuid_list, [instance_offering_uuid, image_uuid, l3net_uuid, root_disk_uuid, data_disk_uuid])
示例3: test
def test():
vm = test_stub.create_vlan_vm()
test_obj_dict.add_vm(vm)
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
volume_creation_option = test_util.VolumeOption()
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
#volume_creation_option.set_system_tags(['ephemeral::shareable', 'capability::virtio-scsi'])
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
volume.attach(vm)
new_vms = vm.clone(vm_names)
for new_vm in new_vms:
test_obj_dict.add_vm(new_vm)
if len(new_vms) != len(vm_names):
test_util.test_fail('only %s VMs have been cloned, which is less than required: %s' % (len(new_vms), vm_names))
for new_vm in new_vms:
new_vm = new_vm.get_vm()
try:
vm_names.remove(new_vm.name)
test_util.test_logger('VM:%s name: %s is found' % (new_vm.uuid, new_vm.name))
except:
test_util.test_fail('%s vm name: %s is not in list: %s' % (new_vm.uuid, new_vm.name, vm_names))
if test_lib.lib_get_data_volumes(new_vms[0]) != []:
test_util.test_fail('The cloned vm is still have data volume, the expected behavior is only clone root volume.')
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('Clone VM Test Success')
示例4: test
def test():
test_util.test_dsc('Create test vm and check')
vm = test_stub.create_vlan_vm()
test_obj_dict.add_vm(vm)
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
volume_creation_option = test_util.VolumeOption()
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
test_util.test_dsc('Attach volume and check')
#mv vm checker later, to save some time.
vm.check()
volume.attach(vm)
volume.check()
test_util.test_dsc('Detach volume and check')
volume.detach()
volume.check()
test_util.test_dsc('Delete volume and check')
volume.delete()
volume.check()
test_obj_dict.rm_volume(volume)
vm.destroy()
vm.check()
test_util.test_pass('Create Data Volume for VM Test Success')
示例5: test
def test():
global test_obj_dict
volume_creation_option = test_util.VolumeOption()
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
volume_uuid = volume.volume.uuid
vol_size = volume.volume.size
image_name = os.environ.get('imageName_net')
l3_name = os.environ.get('l3VlanNetworkName1')
vm = test_stub.create_vm("test_resize_vm", image_name, l3_name)
vm.check()
volume.attach(vm)
test_obj_dict.add_vm(vm)
snapshots = test_obj_dict.get_volume_snapshot(volume_uuid)
snapshots.set_utility_vm(vm)
snapshots.create_snapshot('create_snapshot1')
snapshots.check()
vm.stop()
vm.check()
set_size = 1024*1024*1024*5
vol_ops.resize_data_volume(volume_uuid, set_size)
vm.update()
vol_size_after = test_lib.lib_get_data_volumes(vm.get_vm())[0].size
if set_size != vol_size_after:
test_util.test_fail('Resize Data Volume failed, size = %s' % vol_size_after)
test_obj_dict.rm_volume_snapshot(snapshots)
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass('Resize Data Volume and Snapshot Test Success')
示例6: test
def test():
global test_obj_dict
global ps_uuid
global host_uuid
global vr_uuid
allow_ps_list = [inventory.CEPH_PRIMARY_STORAGE_TYPE, "SharedBlock"]
test_lib.skip_test_when_ps_type_not_in_list(allow_ps_list)
test_util.test_dsc('Create test vm and check')
bs_cond = res_ops.gen_query_conditions("status", '=', "Connected")
bss = res_ops.query_resource_fields(res_ops.BACKUP_STORAGE, bs_cond, \
None)
if not bss:
test_util.test_skip("not find available backup storage. Skip test")
test_lib.lib_set_delete_policy('vm', 'Delay')
test_lib.lib_set_delete_policy('volume', 'Delay')
l3_1_name = os.environ.get('l3VlanNetworkName1')
vm = test_stub.create_vlan_vm(l3_name=l3_1_name)
l3_1 = test_lib.lib_get_l3_by_name(l3_1_name)
vr = test_lib.lib_find_vr_by_l3_uuid(l3_1.uuid)[0]
vr_uuid = vr.uuid
host = test_lib.lib_get_vm_host(vm.get_vm())
host_uuid = host.uuid
test_obj_dict.add_vm(vm)
vm.check()
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
volume_creation_option = test_util.VolumeOption()
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume_creation_option.set_system_tags(['ephemeral::shareable', 'capability::virtio-scsi'])
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
volume.attach(vm)
#ps = test_lib.lib_get_primary_storage_by_vm(vm.get_vm())
#ps_uuid = ps.uuid
#ps_ops.change_primary_storage_state(ps_uuid, 'disable')
test_stub.disable_all_pss()
if not test_lib.lib_wait_target_up(vm.get_vm().vmNics[0].ip, '22', 90):
test_util.test_fail('VM is expected to running when PS change to disable state')
vm.set_state(vm_header.RUNNING)
vm.check()
volume.delete()
volume.check()
volume.expunge()
volume.check()
#ps_ops.change_primary_storage_state(ps_uuid, 'enable')
test_stub.enable_all_pss()
host_ops.reconnect_host(host_uuid)
vm_ops.reconnect_vr(vr_uuid)
vm.destroy()
test_lib.lib_set_delete_policy('vm', 'Direct')
test_lib.lib_set_delete_policy('volume', 'Direct')
test_util.test_pass('Delete volume under PS disable mode Test Success')
示例7: test
def test():
imagestore_backup_storage = test_lib.lib_get_image_store_backup_storage()
if not imagestore_backup_storage:
test_util.test_skip('Not find image store type backup storage.')
img_option = test_util.ImageOption()
img_option.set_name('iso')
root_disk_uuid = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName')).uuid
bs_uuid = imagestore_backup_storage.uuid
img_option.set_backup_storage_uuid_list([bs_uuid])
command = "command -v genisoimage"
result = test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
if not result:
command = "yum -y install genisoimage --disablerepo=* --enablerepo=zstack-local"
test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
command = "genisoimage -o %s/apache-tomcat/webapps/zstack/static/zstack-repo/7/x86_64/os/test.iso /tmp/" % os.environ.get('zstackInstallPath')
test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
img_option.set_url('http://%s:8080/zstack/static/zstack-repo/7/x86_64/os/test.iso' % (os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP']))
image_inv = img_ops.add_iso_template(img_option)
image = test_image.ZstackTestImage()
image.set_image(image_inv)
image.set_creation_option(img_option)
test_obj_dict.add_image(image)
image_url = image.export()
image.delete_exported_image()
test_lib.lib_robot_cleanup(test_obj_dict)
if image_url.endswith('.iso'):
test_util.test_pass('Export ISO Image Test Success')
else:
test_util.test_fail('Export ISO Image Test Fail, exported ISO image ends with %s' % (image_url.split('.')[-1]))
示例8: test
def test():
global test_obj_dict
#volume_creation_option = test_util.VolumeOption()
#test_util.test_dsc('Create volume and check')
#disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
#volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
#volume = test_stub.create_volume(volume_creation_option)
bs_cond = res_ops.gen_query_conditions("status", '=', "Connected")
bss = res_ops.query_resource_fields(res_ops.BACKUP_STORAGE, bs_cond, \
None, fields=['uuid'])
if not bss:
test_util.test_skip("not find available backup storage. Skip test")
volume_creation_option = test_util.VolumeOption()
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume1 = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume1)
volume1.check()
volume_uuid = volume1.volume.uuid
test_util.test_dsc('Create vm and check')
vm = test_stub.create_vr_vm('migrate_volume_vm', 'imageName_net', 'l3VlanNetwork2')
test_obj_dict.add_vm(vm)
vm.check()
vm_uuid = vm.vm.uuid
volume1.attach(vm)
volume1.detach(vm_uuid)
vm.stop()
image_obj = volume1.create_template([bss[0].uuid])
vm.start()
host_uuid = vm.vm.hostUuid
ps = test_lib.lib_get_primary_storage_by_uuid(vm.get_vm().allVolumes[0].primaryStorageUuid)
volume2 = image_obj.create_data_volume(ps.uuid, 'volumeName', host_uuid)
test_obj_dict.add_volume(volume2)
volume2.check()
volume_uuid = volume2.volume.uuid
ps = test_lib.lib_get_primary_storage_by_uuid(vm.get_vm().allVolumes[0].primaryStorageUuid)
if ps.type != inventory.LOCAL_STORAGE_TYPE:
test_util.test_skip('Skip test on non-localstorage')
snapshots = test_obj_dict.get_volume_snapshot(volume_uuid)
snapshots.set_utility_vm(vm)
snapshots.create_snapshot('create_snapshot1')
snapshots.check()
snapshots.create_snapshot('create_snapshot2')
snapshots.check()
target_host = test_lib.lib_find_random_host_by_volume_uuid(volume_uuid)
target_host_uuid = target_host.uuid
vol_ops.migrate_volume(volume_uuid, target_host_uuid)
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass('Cold migrate Data Volume from Template with Snapshot Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_cold_migrate_data_volume_from_tmpt_with_sp.py
示例9: test
def test():
global test_obj_dict
volumes = []
ova_image_name = os.environ['vcenterDefaultmplate']
network_pattern = 'L3-%s'%os.environ['dportgroup']
if not vct_ops.lib_get_vcenter_l3_by_name(network_pattern):
network_pattern = 'L3-%s'%os.environ['portgroup0']
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('largeDiskOfferingName'))
#create vm with disk
vm = test_stub.create_vm_in_vcenter(vm_name = 'vm_2', image_name = ova_image_name, l3_name = network_pattern, disk_offering_uuids = [disk_offering.uuid, disk_offering.uuid] )
test_obj_dict.add_vm(vm)
vm.check()
vcenter = os.environ.get('vcenter')
SI = vct_ops.connect_vcenter(vcenter)
content = SI.RetrieveContent()
vm = vct_ops.get_vm(content, name = 'vm_2')[0]
vct_ops.delete_virtual_disk(vm, 2)
vct_ops.delete_virtual_disk(vm, 2)
vcenter_uuid = vct_ops.lib_get_vcenter_by_name(vcenter).uuid
vct_ops.sync_vcenter(vcenter_uuid)
time.sleep(5)
allvolumes = vct_ops.lib_get_vm_by_name('vm_2').allVolumes
assert len(allvolumes) == 1
for volume in allvolumes:
if volume.type == 'Data':
volumes.append(volume.installPath)
assert set(volumes) == set([])
#cleanup
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass("sync after detaching disk from vm in vmware test passed.")
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_sync_vcenter_after_detach_disk_in_vmware.py
示例10: test
def test():
imagestore_backup_storage = test_lib.lib_get_image_store_backup_storage()
if not imagestore_backup_storage:
test_util.test_skip('Not find image store type backup storage.')
img_option = test_util.ImageOption()
img_option.set_name('iso')
root_disk_uuid = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName')).uuid
bs_uuid = imagestore_backup_storage.uuid
img_option.set_backup_storage_uuid_list([bs_uuid])
os.system("genisoimage -o %s/apache-tomcat/webapps/zstack/static/test.iso /tmp/" % (os.environ.get('zstackInstallPath')))
img_option.set_url('http://%s:8080/zstack/static/test.iso' % (os.environ.get('node1Ip')))
image_inv = img_ops.add_iso_template(img_option)
image = test_image.ZstackTestImage()
image.set_image(image_inv)
image.set_creation_option(img_option)
test_obj_dict.add_image(image)
image_url = image.export()
image.delete_exported_image()
test_lib.lib_robot_cleanup(test_obj_dict)
if image_url.endswith('.iso'):
test_util.test_pass('Export ISO Image Test Success')
else:
test_util.test_fail('Export ISO Image Test Fail, exported ISO image ends with %s' % (image_url.split('.')[-1]))
示例11: test
def test():
global test_obj_dict
volume_creation_option = test_util.VolumeOption()
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
volume_uuid = volume.volume.uuid
test_util.test_dsc('Create vm and check')
vm = test_stub.create_vr_vm('migrate_volume_vm', 'imageName_s', 'l3VlanNetwork2')
test_obj_dict.add_vm(vm)
vm.check()
vm_uuid = vm.vm.uuid
ps = test_lib.lib_get_primary_storage_by_uuid(vm.get_vm().allVolumes[0].primaryStorageUuid)
if ps.type != inventory.LOCAL_STORAGE_TYPE:
test_util.test_skip('Skip test on non-localstorage')
test_util.test_dsc('Attach data volume to vm and check')
volume.attach(vm)
target_host = test_lib.lib_find_random_host_by_volume_uuid(volume_uuid)
target_host_uuid = target_host.uuid
test_util.test_dsc('Detach data volume from vm and check')
volume.detach(vm_uuid)
vol_ops.migrate_volume(volume_uuid, target_host_uuid)
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass('Cold migrate Data Volume Test Success')
示例12: test
def test():
global test_obj_dict
volume_creation_option = test_util.VolumeOption()
ps_uuid = res_ops.query_resource(res_ops.PRIMARY_STORAGE, [])[0].uuid
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume_creation_option.set_primary_storage_uuid(ps_uuid)
if res_ops.query_resource(res_ops.PRIMARY_STORAGE, [])[0].type == "LocalStorage":
host = test_lib.lib_find_random_host()
volume_creation_option.set_system_tags(["localStorage::hostUuid::%s" % host.uuid])
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
volume_uuid = volume.volume.uuid
vol_size = volume.volume.size
set_size = 1024*1024*1024*5
vol_ops.resize_data_volume(volume_uuid, set_size)
cond = res_ops.gen_query_conditions('type', '=', "Data")
cond = res_ops.gen_query_conditions('status', '=', "Ready", cond)
vol_size_after = res_ops.query_resource(res_ops.VOLUME, cond)[0].size
if set_size != vol_size_after:
test_util.test_fail('Resize Data Volume failed, size = %s' % vol_size_after)
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass('Resize Data Volume Test Success')
示例13: create_vm_with_volume
def create_vm_with_volume(vm_creation_option = None, data_volume_uuids = None, \
session_uuid = None):
if not data_volume_uuids:
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'), session_uuid)
data_volume_uuids = [disk_offering.uuid]
return create_vm(vm_creation_option, data_volume_uuids, \
session_uuid = session_uuid)
示例14: test
def test():
global test_obj_dict
#enable vmware vmotion
SI = vct_ops.connect_vcenter(os.environ['vcenter'])
content = SI.RetrieveContent()
hosts = vct_ops.get_host(content)
for host in hosts:
vct_ops.enable_vmotion(host)
network_pattern = 'L3-%s'%os.environ['dportgroup']
if not vct_ops.lib_get_vcenter_l3_by_name(network_pattern):
network_pattern = 'L3-%s'%os.environ['portgroup0']
ova_image_name = os.environ['vcenterDefaultmplate']
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('largeDiskOfferingName'))
#create vm
vm = test_stub.create_vm_in_vcenter(vm_name = 'migrate_vm', image_name = ova_image_name, l3_name = network_pattern)
vm.check()
test_obj_dict.add_vm(vm)
#check whether vm migration candidate hosts exist
candidate_hosts = vm_ops.get_vm_migration_candidate_hosts(vm.vm.uuid).inventories
if candidate_hosts == []:
test_util.test_logger('Not find vm migration candidate hosts, skip test migrate vm')
else:
test_util.test_dsc('Migrate vm to the specified host')
host_uuid = candidate_hosts[0].uuid
vm_ops.migrate_vm(vm.vm.uuid, host_uuid)
vm.update()
vm.check()
#check whether the specified host is effective
assert candidate_hosts[0].name == test_lib.lib_find_host_by_vm(vm.vm).name
#check the consistency of the migration in zstack and vmware
assert candidate_hosts[0].name == vct_ops.find_host_by_vm(content, vm.vm.name)
test_util.test_dsc('vm in suspended state does not allow migration')
vm.suspend()
candidate_host = vm_ops.get_vm_migration_candidate_hosts(vm.vm.uuid).inventories
assert candidate_host == []
#create vm with disk
vm1 = test_stub.create_vm_in_vcenter(vm_name = 'migrate_vm_with_disk', image_name = ova_image_name, l3_name = network_pattern, disk_offering_uuids = [disk_offering.uuid])
vm1.check()
test_obj_dict.add_vm(vm1)
#check whether vm migration candidate hosts exist
candidate_hosts = vm_ops.get_vm_migration_candidate_hosts(vm1.vm.uuid).inventories
if candidate_hosts == []:
test_util.test_logger('Not find vm migration candidate hosts, skip test migrate vm with disk')
else:
test_util.test_dsc('Migrate vm with disk to the specified host')
host_uuid = candidate_hosts[0].uuid
vm_ops.migrate_vm(vm1.vm.uuid, host_uuid)
vm1.update()
vm1.check()
assert candidate_hosts[0].name == test_lib.lib_find_host_by_vm(vm1.vm).name
assert candidate_hosts[0].name == vct_ops.find_host_by_vm(content, vm1.vm.name)
#cleanup
test_lib.lib_error_cleanup(test_obj_dict)
test_util.test_pass("Migrate vm test passed.")
示例15: test
def test():
test_util.test_dsc('Create test vm and check')
vm = test_stub.create_vlan_vm()
test_obj_dict.add_vm(vm)
test_util.test_dsc('Create volume and check')
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
volume_creation_option = test_util.VolumeOption()
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
volume.check()
test_util.test_dsc('Attach volume and check')
vm.check()
volume.attach(vm)
volume.check()
test_util.test_dsc('Stop VM')
vm.stop()
test_util.test_dsc('Detach volume and check')
volume.detach()
volume.check()
test_util.test_dsc('Attach volume to stopped VM and check')
volume.attach(vm)
volume.check()
test_util.test_dsc('Detach volume from stopped VM again and check')
volume.detach()
volume.check()
volume2 = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume2)
test_util.test_dsc('Attach new volume2 to stopped VM and check')
volume2.attach(vm)
volume2.check()
test_util.test_dsc('Detach volume2 from stopped VM again and check')
volume2.detach()
volume2.check()
test_util.test_dsc('Attach new volume2 to stopped VM again and start vm')
volume2.attach(vm)
vm.start()
test_util.test_dsc('Detach volume2 from running VM again and check')
volume2.detach()
volume2.check()
test_util.test_dsc('Delete volume and check')
volume.delete()
volume.check()
test_obj_dict.rm_volume(volume)
volume2.delete()
test_obj_dict.rm_volume(volume2)
vm.destroy()
test_util.test_pass('Do Volumes ops on stopped VM Success')