mcvirt.virtual_machine package

Submodules

mcvirt.virtual_machine.disk_drive module

class mcvirt.virtual_machine.disk_drive.DiskDrive(vm_object)[source]

Bases: mcvirt.rpc.pyro_object.PyroObject

Provides operations to manage the disk drive attached to a VM

attachISO(iso_object, live=False)[source]

Attaches an ISO image to the disk drive of the VM

getCurrentDisk()[source]

Returns the path of the disk currently attached to the VM

preOnlineMigrationChecks(destination_node_name)[source]

Performs pre-online-migration checks

removeISO()[source]

Removes ISO attached to the disk drive of a VM

mcvirt.virtual_machine.factory module

class mcvirt.virtual_machine.factory.Factory[source]

Bases: mcvirt.rpc.pyro_object.PyroObject

Class for obtaining virtual machine objects

OBJECT_TYPE = 'virtual machine'
VIRTUAL_MACHINE_CLASS

alias of VirtualMachine

checkName(name, ignore_exists=False)[source]
check_exists(vm_name)[source]

Determines if a VM exists, given a name

create(*args, **kwargs)
getAllVirtualMachines()[source]

Return objects for all virtual machines

getAllVmNames(node=None)[source]

Returns a list of all VMs within the cluster or those registered on a specific node

getVirtualMachineByName(vm_name)[source]

Obtain a VM object, based on VM name

listVms(*args, **kwargs)

mcvirt.virtual_machine.virtual_machine module

Provides virtual machine class.

class mcvirt.virtual_machine.virtual_machine.VirtualMachine(virtual_machine_factory, name)[source]

Bases: mcvirt.rpc.pyro_object.PyroObject

Provides operations to manage a LibVirt virtual machine.

OBJECT_TYPE = 'virtual machine'
clone(*args, **kwargs)
delete(*args, **kwargs)
duplicate(*args, **kwargs)
editConfig(*args, **kwargs)
ensureRegistered()[source]

Ensures that the VM is registered

ensureRegisteredLocally()[source]

Ensures that the VM is registered locally, otherwise an exception is thrown

ensureUnlocked()[source]

Ensures that the VM is in an unlocked state

getAvailableNodes()[source]

Returns the nodes that the VM can be run on

getCPU()[source]

Returns the number of CPU cores attached to the VM

getCloneChildren()[source]

Returns the VMs that have been cloned from the VM

getCloneParent()[source]

Determines if a VM is a clone of another VM

getHardDriveObjects()[source]

Returns an array of disk objects for the disks attached to the VM

getInfo()[source]

Gets information about the current VM

getLibvirtConfig()[source]

Returns an XML object of the libvirt configuration for the domain

getLockState()[source]
getNode()[source]

Returns the node that the VM is registered on

getPowerState()[source]
getRAM()[source]

Returns the amount of memory attached the VM

getStorageType()[source]

Returns the storage type of the VM

getVncPort()[source]

Returns the port used by the VNC display for the VM

get_config_object()[source]

Return the configuration object for the VM

get_disk_drive()[source]

Returns a disk drive object for the VM

get_libvirt_xml()[source]

Obtain domain XML from libvirt

get_name()[source]

Return the name of the VM

get_remote_object()[source]

Return a instance of the virtual machine object on the machine that the VM is registered

isRegistered()[source]

Returns true if the VM is registered on a node

isRegisteredLocally()[source]

Returns true if the VM is registered on the local node

isRegisteredRemotely()[source]

Returns true if the VM is registered on a remote node

move(*args, **kwargs)
offlineMigrate(*args, **kwargs)
onlineMigrate(*args, **kwargs)
register(*args, **kwargs)
reset(*args, **kwargs)
setBootOrder(boot_devices)[source]

Sets the boot devices and the order in which devices are booted from

setLockState(lock_status)[source]
setNode(node)[source]
setNodeRemote(*args, **kwargs)
start(*args, **kwargs)
stop(*args, **kwargs)
unregister(*args, **kwargs)
updateCPU(*args, **kwargs)
updateRAM(*args, **kwargs)
update_config(attribute_path, value, reason)[source]

Updates a VM configuration attribute and replicates change across all nodes

mcvirt.virtual_machine.virtual_machine_config module

class mcvirt.virtual_machine.virtual_machine_config.VirtualMachineConfig(vm_object)[source]

Bases: mcvirt.config_file.ConfigFile

Provides operations to obtain and set the MCVirt configuration for a VM

static create(vm_name, available_nodes, cpu_cores, memory_allocation)[source]

Creates a basic VM configuration for new VMs

static get_config_path(vm_name)[source]

Provides the path of the VM-spefic configuration file

Module contents