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:
object
Provides 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.MCVirtException
An invalid argument was provided
-
exception
mcvirt.exceptions.
AttributeAlreadyChanged
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Attribute, user is trying to change, has already changed
-
exception
mcvirt.exceptions.
AuthenticationError
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Incorrect credentials
-
exception
mcvirt.exceptions.
BackupSnapshotAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The backup snapshot for the logical volume already exists
-
exception
mcvirt.exceptions.
BackupSnapshotDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The backup snapshot for the logical volume does not exist
-
exception
mcvirt.exceptions.
BlankPasswordException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The provided password is blank
-
exception
mcvirt.exceptions.
CACertificateAlreadyExists
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
CA file for server already exists
-
exception
mcvirt.exceptions.
CACertificateNotFoundException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
CA certificate for host could not be found
-
exception
mcvirt.exceptions.
CAFileAlreadyExists
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The CA file already exists.
-
exception
mcvirt.exceptions.
CannotCloneDrbdBasedVmsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Cannot clone Drbd-based VMs
-
exception
mcvirt.exceptions.
CannotDeleteClonedVmException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Cannot delete a cloned VM
-
exception
mcvirt.exceptions.
CannotMigrateLocalDiskException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Local disks cannot be migrated
-
exception
mcvirt.exceptions.
CannotStartClonedVmException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Cloned VMs cannot be started
-
exception
mcvirt.exceptions.
ClusterNotInitialisedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The cluster has not been initialised, so cannot connect to the remote node
-
exception
mcvirt.exceptions.
ConfigFileCouldNotBeFoundException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Config file could not be found
-
exception
mcvirt.exceptions.
ConnectionFailureToRemoteLibvirtInstance
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Connection failure whilst attempting to obtain a remote libvirt connection
-
exception
mcvirt.exceptions.
CouldNotConnectToNodeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Could not connect to remove cluster node
-
exception
mcvirt.exceptions.
CurrentUserError
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Error whilst obtaining current pyro user
-
exception
mcvirt.exceptions.
DiskAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The disk already exists
-
exception
mcvirt.exceptions.
DrbdAlreadyEnabled
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Drbd has already been enabled on this node
-
exception
mcvirt.exceptions.
DrbdBlockDeviceDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Drbd block device does not exist
-
exception
mcvirt.exceptions.
DrbdNotEnabledOnNode
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Drbd volumes cannot be created on a node that has not been configured to use Drbd
-
exception
mcvirt.exceptions.
DrbdNotInstalledException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Drbd is not installed
-
exception
mcvirt.exceptions.
DrbdStateException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The Drbd state is not OK
-
exception
mcvirt.exceptions.
DrbdVolumeNotInSyncException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The last Drbd verification of the volume failed
-
exception
mcvirt.exceptions.
DuplicatePermissionException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
User already exists in group
-
exception
mcvirt.exceptions.
ExternalStorageCommandErrorException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An error occurred whilst performing an external command
-
exception
mcvirt.exceptions.
FailedToRemoveFileException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A failure occurred whilst trying to remove an ISO
-
exception
mcvirt.exceptions.
HardDriveDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The given hard drive does not exist
-
exception
mcvirt.exceptions.
InaccessibleNodeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
,Pyro4.errors.SecurityError
Unable to connect to node in the cluster
-
exception
mcvirt.exceptions.
IncorrectCredentials
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The supplied credentials are incorrect
-
exception
mcvirt.exceptions.
InsufficientPermissionsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
User does not have the required permission
-
exception
mcvirt.exceptions.
InterfaceDoesNotExist
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Physical interface does not exist
-
exception
mcvirt.exceptions.
InvalidArgumentException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Argument given is not valid
-
exception
mcvirt.exceptions.
InvalidConnectionString
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Connection string is invalid
-
exception
mcvirt.exceptions.
InvalidIPAddressException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The specified IP address is invalid
-
exception
mcvirt.exceptions.
InvalidISOPathException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
ISO to add does not exist
-
exception
mcvirt.exceptions.
InvalidNodesException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The nodes passed is invalid
-
exception
mcvirt.exceptions.
InvalidPermissionGroupException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Attempted to perform actions on an invalid permission group
-
exception
mcvirt.exceptions.
InvalidUserTypeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An invalid user type was specified.
-
exception
mcvirt.exceptions.
InvalidUsernameException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Username is within a reserved namespace
-
exception
mcvirt.exceptions.
InvalidVirtualMachineNameException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is being created with an invalid name
-
exception
mcvirt.exceptions.
InvalidVolumeGroupNameException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The specified name of the volume group is invalid
-
exception
mcvirt.exceptions.
IsoAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An ISO with the same name already exists
-
exception
mcvirt.exceptions.
IsoInUseException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The ISO is in use, so cannot be removed
-
exception
mcvirt.exceptions.
IsoNotPresentOnDestinationNodeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
ISO attached to VM does not exist on destination node whilst performing a migration]
-
exception
mcvirt.exceptions.
LibVirtConnectionException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An error ocurred whilst connecting to LibVirt
-
exception
mcvirt.exceptions.
LibvirtException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Issue with performing libvirt command
-
exception
mcvirt.exceptions.
LibvirtNotInstalledException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Libvirt does not appear to be installed
-
exception
mcvirt.exceptions.
LogicalVolumeDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A required logical volume does not exist
-
exception
mcvirt.exceptions.
MCVirtCommandException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Provides an exception to be thrown after errors whilst calling external commands
-
exception
mcvirt.exceptions.
MCVirtException
[source]¶ Bases:
exceptions.Exception
Provides an exception to be thrown for errors in MCVirt
-
exception
mcvirt.exceptions.
MCVirtLockException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A lock has already been found
-
exception
mcvirt.exceptions.
MigrationFailureExcpetion
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A Libvirt Exception occurred whilst performing a migration
-
exception
mcvirt.exceptions.
MissingConfigurationException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Configuration is missing
-
exception
mcvirt.exceptions.
MustGenerateCertificateException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The certificate cannot be manually added and must be generated
-
exception
mcvirt.exceptions.
NameNotSpecifiedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A name has not been specified and cannot be determined by the path/URL
-
exception
mcvirt.exceptions.
NetworkAdapterDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The network adapter does not exist
-
exception
mcvirt.exceptions.
NetworkAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Network already exists with the same name
-
exception
mcvirt.exceptions.
NetworkDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Network does not exist
-
exception
mcvirt.exceptions.
NetworkUtilizedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Network is utilized by virtual machines
-
exception
mcvirt.exceptions.
NodeAlreadyPresent
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Node being added is already connected to cluster
-
exception
mcvirt.exceptions.
NodeAuthenticationException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Incorrect password supplied for remote node
-
exception
mcvirt.exceptions.
NodeDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The node does not exist
-
exception
mcvirt.exceptions.
NodeVersionMismatch
[source]¶ Bases:
Pyro4.errors.SecurityError
A node is running a different version of MCVirt
-
exception
mcvirt.exceptions.
OpenSSLNotFoundException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The OpenSSL executable could not be found
-
exception
mcvirt.exceptions.
PasswordsDoNotMatchException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The new passwords do not match
-
exception
mcvirt.exceptions.
ReachedMaximumStorageDevicesException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Reached the limit to number of hard disks attached to VM
-
exception
mcvirt.exceptions.
RemoteCommandExecutionFailedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
A remote command execution fails
-
exception
mcvirt.exceptions.
RemoteNodeLockedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Remote node is locked
-
exception
mcvirt.exceptions.
RemoteObjectConflict
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The remote node contains an object that will cause conflict when syncing
-
exception
mcvirt.exceptions.
StorageTypeNotSpecified
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Storage type has not been specified
-
exception
mcvirt.exceptions.
StorageTypesCannotBeMixedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Storage types cannot be mixed within a single VM
-
exception
mcvirt.exceptions.
UnknownRemoteCommandException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An unknown command was passed to the remote machine
-
exception
mcvirt.exceptions.
UnknownStorageTypeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An hard drive object with an unknown disk type has been initialised
-
exception
mcvirt.exceptions.
UnprivilegedUserException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Unprivileged user running executable
-
exception
mcvirt.exceptions.
UnsuitableNodeException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The node is unsuitable to run the VM
-
exception
mcvirt.exceptions.
UserAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The given user already exists.
-
exception
mcvirt.exceptions.
UserDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The specified user does not exist
-
exception
mcvirt.exceptions.
UserNotPresentInGroup
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
User to be removed from group is not in the group
-
exception
mcvirt.exceptions.
VirtualMachineDoesNotExistException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Virtual machine does not exist
-
exception
mcvirt.exceptions.
VirtualMachineLockException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Lock cannot be set to the current lock state
-
exception
mcvirt.exceptions.
VmAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is being created with a duplicate name
-
exception
mcvirt.exceptions.
VmAlreadyRegisteredException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is already registered on a node
-
exception
mcvirt.exceptions.
VmAlreadyStartedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is already started when attempting to start it
-
exception
mcvirt.exceptions.
VmAlreadyStoppedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is already stopped when attempting to stop it
-
exception
mcvirt.exceptions.
VmDirectoryAlreadyExistsException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Directory for a VM already exists
-
exception
mcvirt.exceptions.
VmIsCloneException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VM is a clone
-
exception
mcvirt.exceptions.
VmNotRegistered
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
The virtual machine is not currently registered on a node
-
exception
mcvirt.exceptions.
VmRegisteredElsewhereException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
Attempt to perform an action on a VM registered on another node
-
exception
mcvirt.exceptions.
VmRunningException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An offline migration can only be performed on a powered off VM
-
exception
mcvirt.exceptions.
VmStoppedException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
An online migraiton can only be performed on a powered on VM
-
exception
mcvirt.exceptions.
VncNotEnabledException
[source]¶ Bases:
mcvirt.exceptions.MCVirtException
VNC 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.PyroObject
Obtains/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.ConfigFile
Provides 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:
object
Provides 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.ArgumentParser
Override the ArgumentParser class, in order to change the handling of errors.