Utility class for VM related operations on Hyper-V.
-
exception HyperVException(message=None)
Bases: nova.exception.NovaException
-
class VMUtils(host='.')
Bases: object
-
attach_ide_drive(vm_name, path, ctrller_addr, drive_addr, drive_type='VHD')
Create an IDE drive and attach it to the vm.
-
attach_volume_to_controller(vm_name, controller_path, address, mounted_disk_path)
Attach a volume to a controller.
-
check_ret_val(ret_val, job_path, success_values=[0])
-
create_nic(vm_name, nic_name, mac_address)
Create a (synthetic) nic and attach it to the vm.
-
create_scsi_controller(vm_name)
Create an iscsi controller ready to mount volumes.
-
create_vm(vm_name, memory_mb, vcpus_num, limit_cpu_features)
Creates a VM.
-
destroy_vm(vm_name)
-
detach_vm_disk(vm_name, disk_path)
-
get_attached_disks_count(scsi_controller_path)
-
get_controller_volume_paths(controller_path)
-
get_mounted_disk_by_drive_number(device_number)
-
get_vm_ide_controller(vm_name, ctrller_addr)
-
get_vm_scsi_controller(vm_name)
-
get_vm_storage_paths(vm_name)
-
get_vm_summary_info(vm_name)
-
list_instances()
Return the names of all the instances known to Hyper-V.
-
remove_vm_snapshot(snapshot_path)
-
set_nic_connection(vm_name, nic_name, vswitch_port)
-
set_vm_state(vm_name, req_state)
Set the desired state of the VM.
-
take_vm_snapshot(vm_name)
-
update_vm(vm_name, memory_mb, vcpus_num, limit_cpu_features)
-
vm_exists(vm_name)