mcvirt package¶
Subpackages¶
- mcvirt.auth package
- mcvirt.client package
- mcvirt.cluster package
- mcvirt.iso package
- mcvirt.node package
- mcvirt.rpc package
- Submodules
- mcvirt.rpc.certificate_generator module
- mcvirt.rpc.certificate_generator_factory module
- mcvirt.rpc.constants module
- mcvirt.rpc.daemon_lock module
- mcvirt.rpc.lock module
- mcvirt.rpc.name_server module
- mcvirt.rpc.pyro_object module
- mcvirt.rpc.rpc_daemon module
- mcvirt.rpc.ssl_socket module
- Module contents
- mcvirt.test package
- Subpackages
- Submodules
- mcvirt.test.auth_tests module
- mcvirt.test.run_tests module
- mcvirt.test.test_base module
- mcvirt.test.unit_test_bootstrap module
- mcvirt.test.update_tests module
- mcvirt.test.validation_tests module
- Module contents
- mcvirt.virtual_machine package
- Subpackages
- Submodules
- mcvirt.virtual_machine.disk_drive module
- mcvirt.virtual_machine.factory module
- mcvirt.virtual_machine.virtual_machine module
- mcvirt.virtual_machine.virtual_machine_config module
- Module contents
Submodules¶
mcvirt.argument_validator module¶
Argument validators.
mcvirt.bash-complete module¶
mcvirt.config_file module¶
Provide base class for configuration files
mcvirt.constants module¶
Provide constants used throughout MCVirt.
-
class
mcvirt.constants.DirectoryLocation[source]¶ Bases:
objectProvides directory/file path constants.
-
BASE_STORAGE_DIR= '/var/lib/mcvirt'¶
-
BASE_VM_STORAGE_DIR= '/var/lib/mcvirt/build-4189623-project-52530-mcvirt/vm'¶
-
ISO_STORAGE_DIR= '/var/lib/mcvirt/build-4189623-project-52530-mcvirt/iso'¶
-
LOCK_FILE= '/var/run/lock/mcvirt/lock'¶
-
LOCK_FILE_DIR= '/var/run/lock/mcvirt'¶
-
LOG_FILE= '/var/log/mcvirt.log'¶
-
NODE_STORAGE_DIR= '/var/lib/mcvirt/build-4189623-project-52530-mcvirt'¶
-
TEMPLATE_DIR= '/usr/lib/mcvirt/templates'¶
-
mcvirt.exceptions module¶
Provide access to all MCVirt exceptions.
-
exception
mcvirt.exceptions.ArgumentParserException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn invalid argument was provided
-
exception
mcvirt.exceptions.AttributeAlreadyChanged[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAttribute, user is trying to change, has already changed
-
exception
mcvirt.exceptions.AuthenticationError[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionIncorrect credentials
-
exception
mcvirt.exceptions.BackupSnapshotAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe backup snapshot for the logical volume already exists
-
exception
mcvirt.exceptions.BackupSnapshotDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe backup snapshot for the logical volume does not exist
-
exception
mcvirt.exceptions.BlankPasswordException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe provided password is blank
-
exception
mcvirt.exceptions.CACertificateAlreadyExists[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCA file for server already exists
-
exception
mcvirt.exceptions.CACertificateNotFoundException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCA certificate for host could not be found
-
exception
mcvirt.exceptions.CAFileAlreadyExists[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe CA file already exists.
-
exception
mcvirt.exceptions.CannotCloneDrbdBasedVmsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCannot clone Drbd-based VMs
-
exception
mcvirt.exceptions.CannotDeleteClonedVmException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCannot delete a cloned VM
-
exception
mcvirt.exceptions.CannotMigrateLocalDiskException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionLocal disks cannot be migrated
-
exception
mcvirt.exceptions.CannotStartClonedVmException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCloned VMs cannot be started
-
exception
mcvirt.exceptions.ClusterNotInitialisedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe cluster has not been initialised, so cannot connect to the remote node
-
exception
mcvirt.exceptions.ConfigFileCouldNotBeFoundException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionConfig file could not be found
-
exception
mcvirt.exceptions.ConnectionFailureToRemoteLibvirtInstance[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionConnection failure whilst attempting to obtain a remote libvirt connection
-
exception
mcvirt.exceptions.CouldNotConnectToNodeException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionCould not connect to remove cluster node
-
exception
mcvirt.exceptions.CurrentUserError[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionError whilst obtaining current pyro user
-
exception
mcvirt.exceptions.DiskAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe disk already exists
-
exception
mcvirt.exceptions.DrbdAlreadyEnabled[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionDrbd has already been enabled on this node
-
exception
mcvirt.exceptions.DrbdBlockDeviceDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionDrbd block device does not exist
-
exception
mcvirt.exceptions.DrbdNotEnabledOnNode[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionDrbd volumes cannot be created on a node that has not been configured to use Drbd
-
exception
mcvirt.exceptions.DrbdNotInstalledException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionDrbd is not installed
-
exception
mcvirt.exceptions.DrbdStateException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe Drbd state is not OK
-
exception
mcvirt.exceptions.DrbdVolumeNotInSyncException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe last Drbd verification of the volume failed
-
exception
mcvirt.exceptions.DuplicatePermissionException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionUser already exists in group
-
exception
mcvirt.exceptions.ExternalStorageCommandErrorException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn error occurred whilst performing an external command
-
exception
mcvirt.exceptions.FailedToRemoveFileException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA failure occurred whilst trying to remove an ISO
-
exception
mcvirt.exceptions.HardDriveDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe given hard drive does not exist
-
exception
mcvirt.exceptions.InaccessibleNodeException[source]¶ Bases:
mcvirt.exceptions.MCVirtException,Pyro4.errors.SecurityErrorUnable to connect to node in the cluster
-
exception
mcvirt.exceptions.IncorrectCredentials[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe supplied credentials are incorrect
-
exception
mcvirt.exceptions.InsufficientPermissionsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionUser does not have the required permission
-
exception
mcvirt.exceptions.InterfaceDoesNotExist[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionPhysical interface does not exist
-
exception
mcvirt.exceptions.InvalidArgumentException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionArgument given is not valid
-
exception
mcvirt.exceptions.InvalidConnectionString[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionConnection string is invalid
-
exception
mcvirt.exceptions.InvalidIPAddressException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe specified IP address is invalid
-
exception
mcvirt.exceptions.InvalidISOPathException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionISO to add does not exist
-
exception
mcvirt.exceptions.InvalidNodesException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe nodes passed is invalid
-
exception
mcvirt.exceptions.InvalidPermissionGroupException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAttempted to perform actions on an invalid permission group
-
exception
mcvirt.exceptions.InvalidUserTypeException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn invalid user type was specified.
-
exception
mcvirt.exceptions.InvalidUsernameException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionUsername is within a reserved namespace
-
exception
mcvirt.exceptions.InvalidVirtualMachineNameException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is being created with an invalid name
-
exception
mcvirt.exceptions.InvalidVolumeGroupNameException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe specified name of the volume group is invalid
-
exception
mcvirt.exceptions.IsoAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn ISO with the same name already exists
-
exception
mcvirt.exceptions.IsoInUseException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe ISO is in use, so cannot be removed
-
exception
mcvirt.exceptions.IsoNotPresentOnDestinationNodeException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionISO attached to VM does not exist on destination node whilst performing a migration]
-
exception
mcvirt.exceptions.LibVirtConnectionException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn error ocurred whilst connecting to LibVirt
-
exception
mcvirt.exceptions.LibvirtException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionIssue with performing libvirt command
-
exception
mcvirt.exceptions.LibvirtNotInstalledException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionLibvirt does not appear to be installed
-
exception
mcvirt.exceptions.LogicalVolumeDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA required logical volume does not exist
-
exception
mcvirt.exceptions.MCVirtCommandException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionProvides an exception to be thrown after errors whilst calling external commands
-
exception
mcvirt.exceptions.MCVirtException[source]¶ Bases:
exceptions.ExceptionProvides an exception to be thrown for errors in MCVirt
-
exception
mcvirt.exceptions.MCVirtLockException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA lock has already been found
-
exception
mcvirt.exceptions.MigrationFailureExcpetion[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA Libvirt Exception occurred whilst performing a migration
-
exception
mcvirt.exceptions.MissingConfigurationException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionConfiguration is missing
-
exception
mcvirt.exceptions.MustGenerateCertificateException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe certificate cannot be manually added and must be generated
-
exception
mcvirt.exceptions.NameNotSpecifiedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA name has not been specified and cannot be determined by the path/URL
-
exception
mcvirt.exceptions.NetworkAdapterDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe network adapter does not exist
-
exception
mcvirt.exceptions.NetworkAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionNetwork already exists with the same name
-
exception
mcvirt.exceptions.NetworkDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionNetwork does not exist
-
exception
mcvirt.exceptions.NetworkUtilizedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionNetwork is utilized by virtual machines
-
exception
mcvirt.exceptions.NodeAlreadyPresent[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionNode being added is already connected to cluster
-
exception
mcvirt.exceptions.NodeAuthenticationException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionIncorrect password supplied for remote node
-
exception
mcvirt.exceptions.NodeDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe node does not exist
-
exception
mcvirt.exceptions.NodeVersionMismatch[source]¶ Bases:
Pyro4.errors.SecurityErrorA node is running a different version of MCVirt
-
exception
mcvirt.exceptions.OpenSSLNotFoundException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe OpenSSL executable could not be found
-
exception
mcvirt.exceptions.PasswordsDoNotMatchException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe new passwords do not match
-
exception
mcvirt.exceptions.ReachedMaximumStorageDevicesException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionReached the limit to number of hard disks attached to VM
-
exception
mcvirt.exceptions.RemoteCommandExecutionFailedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionA remote command execution fails
-
exception
mcvirt.exceptions.RemoteNodeLockedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionRemote node is locked
-
exception
mcvirt.exceptions.RemoteObjectConflict[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe remote node contains an object that will cause conflict when syncing
-
exception
mcvirt.exceptions.StorageTypeNotSpecified[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionStorage type has not been specified
-
exception
mcvirt.exceptions.StorageTypesCannotBeMixedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionStorage types cannot be mixed within a single VM
-
exception
mcvirt.exceptions.UnknownRemoteCommandException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn unknown command was passed to the remote machine
-
exception
mcvirt.exceptions.UnknownStorageTypeException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn hard drive object with an unknown disk type has been initialised
-
exception
mcvirt.exceptions.UnprivilegedUserException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionUnprivileged user running executable
-
exception
mcvirt.exceptions.UnsuitableNodeException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe node is unsuitable to run the VM
-
exception
mcvirt.exceptions.UserAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe given user already exists.
-
exception
mcvirt.exceptions.UserDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe specified user does not exist
-
exception
mcvirt.exceptions.UserNotPresentInGroup[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionUser to be removed from group is not in the group
-
exception
mcvirt.exceptions.VirtualMachineDoesNotExistException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVirtual machine does not exist
-
exception
mcvirt.exceptions.VirtualMachineLockException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionLock cannot be set to the current lock state
-
exception
mcvirt.exceptions.VmAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is being created with a duplicate name
-
exception
mcvirt.exceptions.VmAlreadyRegisteredException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is already registered on a node
-
exception
mcvirt.exceptions.VmAlreadyStartedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is already started when attempting to start it
-
exception
mcvirt.exceptions.VmAlreadyStoppedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is already stopped when attempting to stop it
-
exception
mcvirt.exceptions.VmDirectoryAlreadyExistsException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionDirectory for a VM already exists
-
exception
mcvirt.exceptions.VmIsCloneException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVM is a clone
-
exception
mcvirt.exceptions.VmNotRegistered[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionThe virtual machine is not currently registered on a node
-
exception
mcvirt.exceptions.VmRegisteredElsewhereException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAttempt to perform an action on a VM registered on another node
-
exception
mcvirt.exceptions.VmRunningException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn offline migration can only be performed on a powered off VM
-
exception
mcvirt.exceptions.VmStoppedException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionAn online migraiton can only be performed on a powered on VM
-
exception
mcvirt.exceptions.VncNotEnabledException[source]¶ Bases:
mcvirt.exceptions.MCVirtExceptionVNC is not enabled on the VM
-
mcvirt.exceptions.exception_class¶ alias of
InaccessibleNodeException
mcvirt.libvirt_connector module¶
-
class
mcvirt.libvirt_connector.LibvirtConnector[source]¶ Bases:
mcvirt.rpc.pyro_object.PyroObjectObtains/manages Libvirt connections
mcvirt.logger module¶
-
class
mcvirt.logger.LogItem(method, user, object_name, object_type)[source]¶ Bases:
object-
description¶
-
-
class
mcvirt.logger.LogState[source]¶ Bases:
object-
FAILED= {'status': 3, 'name': 'FAILED'}¶
-
QUEUED= {'status': 0, 'name': 'QUEUED'}¶
-
RUNNING= {'status': 1, 'name': 'RUNNING'}¶
-
SUCCESS= {'status': 2, 'name': 'SUCCESS'}¶
-
-
class
mcvirt.logger.Logger[source]¶ Bases:
mcvirt.rpc.pyro_object.PyroObject-
LOGS= []¶
-
mcvirt.mcvirt-drbd module¶
mcvirt.mcvirt_config module¶
-
class
mcvirt.mcvirt_config.MCVirtConfig[source]¶ Bases:
mcvirt.config_file.ConfigFileProvides operations to obtain and set the MCVirt configuration for a VM
mcvirt.parser module¶
Provides argument parser.
-
class
mcvirt.parser.Parser(verbose=True)[source]¶ Bases:
objectProvides an argument parser for MCVirt.
-
class
mcvirt.parser.ThrowingArgumentParser(prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True)[source]¶ Bases:
argparse.ArgumentParserOverride the ArgumentParser class, in order to change the handling of errors.