COT.deploy module¶
Module for deploying VM descriptions to a hypervisor to instantiate VMs.
Classes
COTDeploy | Semi-abstract class for submodules used to deploy a VM to a hypervisor. |
COTDeployESXi | Submodule for deploying VMs on ESXi and VMware vCenter/vSphere. |
- class COTDeploy(UI)[source]¶
Bases: COT.submodule.COTReadOnlySubmodule
Semi-abstract class for submodules used to deploy a VM to a hypervisor.
Provides some baseline parameters and input validation that are expected to be common across all concrete subclasses.
Inherited attributes: UI, package,
Attributes: generic_parser, parser, subparsers, hypervisor, configuration, username, password, power_on, vm_name, network_map
- create_subparser(parent)[source]¶
Add subparser for the CLI of this submodule.
Note
Unlike most submodules, this one has subparsers of its own - 'cot deploy PACKAGE <hypervisor>' so subclasses of this module should call super().create_subparser(parent) (to create the main ‘deploy’ subparser) then call self.subparsers.add_parser() to add their own sub-subparser.
Parameters: parent (object) – Subparser grouping object returned by ArgumentParser.add_subparsers() Returns: ('deploy', subparser)
- ready_to_run()[source]¶
Check whether the module is ready to run().
Returns: (True, ready_message) or (False, reason_why_not)
- configuration[source]¶
VM configuration profile to use for deployment.
Raise: InvalidInputError if not a profile defined in the VM.
- generic_parser = None¶
Generic parser object providing args that most subclasses will use.
Subclasses can call self.subparsers.add_parser(parents=[self.generic_parser]) to automatically inherit this set of args
- network_map = None¶
Mapping of network names to networks
- parser = None¶
Subparser providing cot deploy PACKAGE ... CLI.
- password = None¶
Server login password.
- subparsers = None¶
Subparser grouping for hypervisor-specific sub-subparsers.
Subclasses should generally have their create_subparser() implementations create their sub-subparsers under subparsers and NOT under parent.
- username = None¶
Server login username.
- vm_name = None¶
Name of the created virtual machine
- class COTDeployESXi(UI)[source]¶
Bases: COT.deploy.COTDeploy
Submodule for deploying VMs on ESXi and VMware vCenter/vSphere.
Inherited attributes: UI, package, generic_parser, parser, subparsers, hypervisor, configuration, username, password, power_on, vm_name, network_map
Attributes: locator, datastore, ovftool_args
- create_subparser(parent)[source]¶
Add subparser for the CLI of this submodule.
This will create the shared parser under parent, then create our own sub-subparser under subparsers.
Parameters: parent (object) – Subparser grouping object returned by ArgumentParser.add_subparsers() Returns: ('deploy', subparser)
- ready_to_run()[source]¶
Check whether the module is ready to run().
Returns: (True, ready_message) or (False, reason_why_not)
- run()[source]¶
Do the actual work of this submodule - deploying to ESXi.
Raises InvalidInputError: if ready_to_run() reports False
- datastore = None¶
ESXi datastore to deploy to.
- locator = None¶
vSphere target locator.