本文整理汇总了Python中zstackwoodpecker.operations.vm_operations.delete_instance_offering函数的典型用法代码示例。如果您正苦于以下问题:Python delete_instance_offering函数的具体用法?Python delete_instance_offering怎么用?Python delete_instance_offering使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_instance_offering函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk bandwidth QoS by 20MB')
#unit is KB
volume_bandwidth = 5*1024*1024
new_offering = test_lib.lib_create_instance_offering(volume_bandwidth = volume_bandwidth)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
test_stub.test_fio_bandwidth(vm_inv, volume_bandwidth)
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidth != volume_bandwidth:
test_util.test_fail('Retrieved disk qos not match')
vm_ops.set_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, volume_bandwidth/2)
test_stub.test_fio_bandwidth(vm_inv, volume_bandwidth/2)
vm_ops.del_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid)
if test_stub.test_fio_bandwidth(vm_inv, volume_bandwidth/2, raise_exception=False):
test_util.test_fail('disk qos is not expected to have limit after qos setting is deleted')
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network QoS Test Pass')
示例2: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk bandwidth QoS by 20MB')
#unit is KB
volume_bandwidth = 25*1024*1024
new_offering = test_lib.lib_create_instance_offering(volume_bandwidth = volume_bandwidth)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
volume_creation_option = test_util.VolumeOption()
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('largeDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume_creation_option.set_name('volume-1')
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
vm_inv = vm.get_vm()
test_lib.lib_mkfs_for_volume(volume.get_volume().uuid, vm_inv)
mount_point = '/tmp/zstack/test'
test_stub.attach_mount_volume(volume, vm, mount_point)
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
test_stub.test_fio_bandwidth(vm_inv, volume_bandwidth, mount_point)
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Disk QoS Test Pass')
示例3: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM network outbound bandwidth QoS by 1MB')
#unit is KB
net_bandwidth = 1*1024
new_offering = test_lib.lib_create_instance_offering(net_outbound_bandwidth = net_bandwidth*8*1024)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_net_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.create_test_file(vm_inv, net_bandwidth)
test_stub.test_scp_vm_outbound_speed(vm_inv, net_bandwidth)
if test_stub.test_scp_vm_inbound_speed(vm_inv, net_bandwidth, raise_exception=False):
test_util.test_fail('VM network inbound is not expected to be limited when only outbound qos is set')
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network Outbound QoS Test Pass')
示例4: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM network outbound & inbound bandwidth QoS by 1MB')
#unit is KB
net_bandwidth = 1*1024
new_offering = test_lib.lib_create_instance_offering(net_outbound_bandwidth = net_bandwidth*8*1024, \
net_inbound_bandwidth = net_bandwidth*8*1024)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_net_inbound_outbound_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.create_test_file(vm_inv, net_bandwidth)
test_stub.test_scp_vm_outbound_speed(vm_inv, net_bandwidth)
test_stub.test_scp_vm_inbound_speed(vm_inv, net_bandwidth)
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network Outbound QoS Test Pass')
示例5: error_cleanup
def error_cleanup():
global volume_offering_uuid,new_offering_uuid
test_lib.lib_error_cleanup(test_obj_dict)
try:
vm_ops.delete_instance_offering(new_offering_uuid)
vol_ops.delete_disk_offering(volume_offering_uuid)
except:
pass
示例6: error_cleanup
def error_cleanup():
global vm, all_volume_offering_uuid, rw_volume_offering_uuid, all_volume_uuid, rw_volume_uuid, test_account_session, instance_offering_uuid
if vm:
vm.destroy(test_account_session)
vol_ops.delete_disk_offering(all_volume_offering_uuid)
vol_ops.delete_disk_offering(rw_volume_offering_uuid)
vol_ops.delete_volume(all_volume_uuid, test_account_session)
vol_ops.delete_volume(rw_volume_uuid, test_account_session)
acc_ops.delete_account(test_account_uuid)
vm_ops.delete_instance_offering(instance_offering_uuid)
示例7: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk bandwidth QoS by 20MB')
#unit is KB
write_bandwidth = 5*1024*1024
read_bandwidth = 10*1024*1024
new_offering = test_lib.lib_create_instance_offering(read_bandwidth=read_bandwidth, write_bandwidth=write_bandwidth)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
# test_stub.test_fio_bandwidth(vm_inv, read_bandwidth)
vm_ops.set_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, read_bandwidth*2)
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidth != read_bandwidth*2:
test_util.test_fail('Retrieved disk qos not match')
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthRead == read_bandwidth:
test_util.test_fail('read qos must be cleared after set total qos')
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthWrite == write_bandwidth:
test_util.test_fail('write qos must be cleared after set total qos')
vm_ops.set_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, read_bandwidth*2, 'read')
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthRead != read_bandwidth*2:
test_util.test_fail('Retrieved disk qos not match')
test_stub.test_fio_bandwidth(vm_inv, read_bandwidth*2, '/dev/vda')
vm_ops.del_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, mode='all')
if test_stub.test_fio_bandwidth(vm_inv, read_bandwidth, '/dev/vda', raise_exception=False):
test_util.test_fail('disk qos is not expected to have limit after qos setting is deleted')
vm_ops.set_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, write_bandwidth*2, 'write')
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthWrite != write_bandwidth*2:
test_util.test_fail('Retrieved disk qos not match')
test_stub.test_fio_bandwidth(vm_inv, write_bandwidth*2)
vm_ops.del_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid, mode='all')
if test_stub.test_fio_bandwidth(vm_inv, write_bandwidth, raise_exception=False):
test_util.test_fail('disk qos is not expected to have limit after qos setting is deleted')
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network QoS Test Pass')
示例8: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM network outbound & inbound bandwidth QoS by 1MB')
#unit is KB
net_bandwidth = 1024
new_offering = test_lib.lib_create_instance_offering(net_outbound_bandwidth = net_bandwidth, \
net_inbound_bandwidth = net_bandwidth)
new_offering_uuid = new_offering.uuid
vm1 = test_stub.create_vm(vm_name = 'vm_net_inbound_outbound_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm1)
vm1.check()
vm1_inv = vm1.get_vm()
test_stub.make_ssh_no_password(vm1_inv)
vm1_ip = vm1_inv.vmNics[0].ip
vm2 = test_stub.create_vm(vm_name = 'vm_net_inbound_outbound_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm2)
vm2.check()
vm2_inv = vm2.get_vm()
vm2_ip = vm2_inv.vmNics[0].ip
test_stub.make_ssh_no_password(vm2_inv)
test_stub.copy_key_file(vm1_inv)
test_stub.copy_key_file(vm2_inv)
test_stub.create_test_file(vm1_inv, net_bandwidth)
test_stub.create_test_file(vm2_inv, net_bandwidth)
l3_name = os.environ.get('l3VlanNetworkName1')
l3_net_uuid = test_lib.lib_get_l3_by_name(l3_name).uuid
vm1.add_nic(l3_net_uuid)
vm2.add_nic(l3_net_uuid)
ssh_cmd = 'ssh -oStrictHostKeyChecking=no -oCheckHostIP=no -oUserKnownHostsFile=/dev/null'
cmd = "pkill dhclient"
os.system("%s %s %s" % (ssh_cmd, vm1_ip, cmd))
os.system("%s %s %s" % (ssh_cmd, vm2_ip, cmd))
cmd = "dhclient eth0 eth1"
os.system("%s %s %s" % (ssh_cmd, vm1_ip, cmd))
os.system("%s %s %s" % (ssh_cmd, vm2_ip, cmd))
test_stub.test_scp_outbound_speed(vm1_ip, test_lib.lib_get_vm_nic_by_l3(vm2.get_vm(), l3_net_uuid).ip, net_bandwidth)
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network Outbound QoS Test Pass')
示例9: error_cleanup
def error_cleanup():
global vm, all_volume_offering_uuid, rw_volume_offering_uuid, all_volume_uuid, rw_volume_uuid, volume_offering_3, volume_offering_4, volume_offering_5, volume_offering_6
global instance_offering_uuid, volume_uuid_3, volume_uuid_4, volume_uuid_5, volume_uuid_6
if vm:
vm.destroy()
vol_ops.delete_disk_offering(all_volume_offering_uuid)
vol_ops.delete_disk_offering(rw_volume_offering_uuid)
vol_ops.delete_disk_offering(volume_offering_3.uuid)
vol_ops.delete_disk_offering(volume_offering_4.uuid)
vol_ops.delete_disk_offering(volume_offering_5.uuid)
vol_ops.delete_disk_offering(volume_offering_6.uuid)
vol_ops.delete_volume(all_volume_uuid)
vol_ops.delete_volume(rw_volume_uuid)
vol_ops.delete_volume(volume_uuid_3)
vol_ops.delete_volume(volume_uuid_4)
vol_ops.delete_volume(volume_uuid_5)
vol_ops.delete_volume(volume_uuid_6)
vm_ops.delete_instance_offering(instance_offering_uuid)
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:18,代码来源:test_crt_vm_with_volumes_and_detach_attach_reboot_detach_attach_volume.py
示例10: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk bandwidth QoS by 20MB')
#unit is KB
write_bandwidth = 15*1024*1024
new_offering = test_lib.lib_create_instance_offering(write_bandwidth=write_bandwidth)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
volume_creation_option = test_util.VolumeOption()
disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('largeDiskOfferingName'))
volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
volume_creation_option.set_name('volume-1')
volume = test_stub.create_volume(volume_creation_option)
test_obj_dict.add_volume(volume)
vm_inv = vm.get_vm()
# test_lib.lib_mkfs_for_volume(volume.get_volume().uuid, vm_inv)
# mount_point = '/tmp/zstack/test'
# test_stub.attach_mount_volume(volume, vm, mount_point)
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
if vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthRead != -1 and \
vm_ops.get_vm_disk_qos(test_lib.lib_get_root_volume(vm_inv).uuid).volumeBandwidthWrite != write_bandwidth:
test_util.test_fail('Retrieved disk qos not match')
test_stub.test_fio_bandwidth(vm_inv, write_bandwidth)
if test_stub.test_fio_bandwidth(vm_inv, write_bandwidth/2, '/dev/vda', raise_exception=False):
test_util.test_fail('disk write read is not expected to have limit as only write qos was set')
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Disk wirte QoS Test Pass')
示例11: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk IOPS by 200')
volume_iops = 200
new_offering = test_lib.lib_create_instance_offering(volume_iops = volume_iops)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_iops', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
test_stub.test_fio_iops(vm_inv, volume_iops)
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network IOPS Test Pass')
示例12: test
def test():
global new_offering_uuid
test_util.test_dsc('Test VM disk bandwidth QoS by 20MB')
#unit is KB
volume_bandwidth = 25*1024*1024
new_offering = test_lib.lib_create_instance_offering(volume_bandwidth = volume_bandwidth)
new_offering_uuid = new_offering.uuid
vm = test_stub.create_vm(vm_name = 'vm_volume_qos', \
instance_offering_uuid = new_offering.uuid)
test_obj_dict.add_vm(vm)
vm.check()
vm_inv = vm.get_vm()
test_stub.make_ssh_no_password(vm_inv)
test_stub.install_fio(vm_inv)
test_stub.test_fio_bandwidth(vm_inv, volume_bandwidth)
vm_ops.delete_instance_offering(new_offering_uuid)
test_lib.lib_robot_cleanup(test_obj_dict)
test_util.test_pass('VM Network QoS Test Pass')
示例13: test
def test():
global deploy_conf
global vm_inv
global vm
test_util.test_dsc('Test Delete VR Offering and Teboot Normal VM')
vm = test_stub.create_basic_vm()
test_obj_dict.add_vm(vm)
vm_inv = vm.get_vm()
vm_ip = vm_inv.vmNics[0].ip
vm.check()
test_util.test_dsc('Record current virtual router offering information')
deploy_conf = exp_ops.export_zstack_deployment_config(test_lib.deploy_config)
cond = res_ops.gen_query_conditions('zone.vmInstance.uuid', '=', vm_inv.uuid)
vr_offering_uuid = res_ops.query_resource(res_ops.VR_OFFERING, cond)[0].uuid
test_util.test_dsc('Delete VR-RM and VR-Offering')
cond = res_ops.gen_query_conditions('zone.vmInstance.uuid', '=', vm_inv.uuid)
vr_vm_uuid = res_ops.query_resource(res_ops.VIRTUALROUTER_VM, cond)[0].uuid
vm_ops.destroy_vm(vr_vm_uuid)
vm_ops.delete_instance_offering(vr_offering_uuid)
test_util.test_dsc('Create new VR-Offering, same as the former one, stop and start VM')
session_uuid = acc_ops.login_as_admin()
dep_ops.add_virtual_router(None, None, deploy_conf, session_uuid)
vm.reboot()
vm.destroy()
test_obj_dict.rm_vm(vm)
test_util.test_pass('Delete VR Offering and reboot normal VM: SUCCESS')
示例14: error_cleanup
def error_cleanup():
test_lib.lib_error_cleanup(test_obj_dict)
if original_rate:
test_lib.lib_set_provision_memory_rate(original_rate)
if new_offering_uuid:
vm_ops.delete_instance_offering(new_offering_uuid)
示例15: error_cleanup
def error_cleanup():
test_lib.lib_error_cleanup(test_obj_dict)
try:
vm_ops.delete_instance_offering(new_offering_uuid)
except:
pass