mcvirt.virtual_machine.hard_drive package¶
Submodules¶
mcvirt.virtual_machine.hard_drive.base module¶
Provide base operations to manage all hard drives, used by VMs
-
class
mcvirt.virtual_machine.hard_drive.base.Base(vm_object, disk_id=None, driver=None)[source]¶ Bases:
mcvirt.rpc.pyro_object.PyroObjectProvides base operations to manage all hard drives, used by VMs
-
DEFAULT_DRIVER¶
-
MAXIMUM_DEVICES= 1¶
-
SNAPSHOT_SIZE= '500M'¶
-
SNAPSHOT_SUFFIX= '_snapshot'¶
-
activateLogicalVolume(*args, **kwargs)¶
-
addToVirtualMachine(*args, **kwargs)¶
-
clone(destination_vm_object)[source]¶ Clone a VM, using snapshotting, attaching it to the new VM object
-
config_properties¶ Return the disk object config items
-
create()[source]¶ Creates a new disk image, attaches the disk to the VM and records the disk in the VM configuration
-
createBackupSnapshot()[source]¶ Creates a snapshot of the logical volume for backing up and locks the VM
-
createLogicalVolume(*args, **kwargs)¶
-
disk_id¶ Return the disk ID of the current disk, generating a new one if there is not already one present
-
driver¶ Return the disk drive driver name
-
get_remote_object(node_name=None, remote_node=None, registered=True)[source]¶ Obtain an instance of the current hard drive object on a remote node
-
increaseSize(*args, **kwargs)¶
-
preMigrationChecks(destination_node)[source]¶ Determines if the disk is in a state to allow the attached VM to be migrated to another node
-
preOnlineMigration()[source]¶ Performs required tasks in order for the underlying VM to perform an online migration
-
removeFromVirtualMachine(*args, **kwargs)¶
-
removeLogicalVolume(*args, **kwargs)¶
-
zeroLogicalVolume(*args, **kwargs)¶
-
mcvirt.virtual_machine.hard_drive.drbd module¶
-
class
mcvirt.virtual_machine.hard_drive.drbd.Drbd(drbd_minor=None, drbd_port=None, *args, **kwargs)[source]¶ Bases:
mcvirt.virtual_machine.hard_drive.base.BaseProvides operations to manage Drbd-backed hard drives, used by VMs
-
CACHE_MODE= 'none'¶
-
CREATE_PROGRESS¶
-
Drbd_CONFIG_TEMPLATE= '/usr/lib/mcvirt/templates/drbd_resource.conf'¶
-
Drbd_META_SUFFIX= 'meta'¶
-
Drbd_RAW_SUFFIX= 'raw'¶
-
Drbd_STATES= {'CONNECTION': {'CONNECTED': [<Mock id='140218819339792'>, <Mock id='140218831801808'>, <Mock id='140218822557008'>, <Mock id='140218822705040'>, <Mock id='140218821472720'>, <Mock id='140218816840976'>, <Mock id='140218816939152'>, <Mock id='140218814241424'>, <Mock id='140218817195088'>, <Mock id='140218823155536'>], 'WARNING': [<Mock id='140218823318096'>, <Mock id='140218823075088'>, <Mock id='140218823079888'>, <Mock id='140218823109264'>, <Mock id='140218823085392'>, <Mock id='140218819866704'>, <Mock id='140218819859216'>], 'OK': [<Mock id='140218828977104'>, <Mock id='140218819906320'>, <Mock id='140218828842256'>, <Mock id='140218825534864'>, <Mock id='140218825923408'>, <Mock id='140218820569744'>, <Mock id='140218829137360'>, <Mock id='140218820744976'>, <Mock id='140218819806800'>]}, 'DISK': {'WARNING': [<Mock id='140218819873616'>, <Mock id='140218819866128'>], 'OK': [<Mock id='140218819881104'>]}, 'ROLE': {'WARNING': [], 'OK': [<Mock id='140218819888592'>]}}¶
-
INITIAL_MINOR= 1¶
-
INITIAL_PORT= 7789¶
-
config_properties¶ Return the disk object config items
-
create(size)[source]¶ Creates a new hard drive, attaches the disk to the VM and records the disk in the VM configuration
-
drbdConnect(*args, **kwargs)¶
-
drbdDisconnect(*args, **kwargs)¶
-
drbdDown(*args, **kwargs)¶
-
drbdSetPrimary(*args, **kwargs)¶
-
drbdSetSecondary(*args, **kwargs)¶
-
drbdUp(*args, **kwargs)¶
-
drbd_minor¶ Returns the Drbd port assigned to the hard drive
-
drbd_port¶ Returns the Drbd port assigned to the hard drive
-
generateDrbdConfig(*args, **kwargs)¶
-
initialiseMetaData(*args, **kwargs)¶
-
move(destination_node, source_node)[source]¶ Replaces a remote node for the Drbd volume with a new node and syncs the data
-
preMigrationChecks()[source]¶ Ensures that the Drbd state of the disk is in a state suitable for migration
-
preOnlineMigration(destination_node)[source]¶ Performs required tasks in order for the underlying VM to perform an online migration
-
removeDrbdConfig(*args, **kwargs)¶
-
resource_name¶ Returns the Drbd resource name for the hard drive object
-
setSyncState(*args, **kwargs)¶
-
setTwoPrimariesConfig(*args, **kwargs)¶
-
mcvirt.virtual_machine.hard_drive.factory module¶
-
class
mcvirt.virtual_machine.hard_drive.factory.Factory[source]¶ Bases:
mcvirt.rpc.pyro_object.PyroObjectProvides a factory for creating hard drive/hard drive config objects
-
DEFAULT_STORAGE_TYPE= 'Local'¶
-
HARD_DRIVE_CLASS¶ alias of
Base
-
OBJECT_TYPE= 'hard disk'¶
-
STORAGE_TYPES= [<class 'mcvirt.virtual_machine.hard_drive.local.Local'>, <class 'mcvirt.virtual_machine.hard_drive.drbd.Drbd'>]¶
-
create(*args, **kwargs)¶
-
mcvirt.virtual_machine.hard_drive.local module¶
-
class
mcvirt.virtual_machine.hard_drive.local.Local(*args, **kwargs)[source]¶ Bases:
mcvirt.virtual_machine.hard_drive.base.BaseProvides operations to manage local hard drives, used by VMs
-
CACHE_MODE= 'directsync'¶
-
MAXIMUM_DEVICES= 4¶
-
clone(destination_vm_object)[source]¶ Clone a VM, using snapshotting, attaching it to the new VM object
-
create(size)[source]¶ Creates a new disk image, attaches the disk to the VM and records the disk in the VM configuration
-
increaseSize(*args, **kwargs)¶
-