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, storage)[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 callsuper().create_subparser(parent, storage)
(to create the main ‘deploy’ subparser if it doesn’t already exist) then callself.subparsers.add_parser()
to add their own sub-subparser.Parameters: - parent (object) – Subparser grouping object returned by
ArgumentParser.add_subparsers()
- storage (dict) – Dict of { ‘label’: subparser } to be updated with subparser(s) created, if any.
- parent (object) – Subparser grouping object returned by
-
ready_to_run
()[source]¶ Check whether the module is ready to
run()
.Returns: (True, ready_message)
or(False, reason_why_not)
-
configuration
¶ 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
-
hypervisor
¶ Hypervisor to deploy to.
Raise: InvalidInputError
if not a recognized value.
-
network_map
¶ Mapping of network names to networks.
-
password
= None¶ Server login password.
-
power_on
¶ Whether to automatically power on the VM after deployment.
-
subparsers
= None¶ Subparser grouping for hypervisor-specific sub-subparsers.
Subclasses should generally have their
create_subparser()
implementations create their sub-subparsers undersubparsers
and NOT underparent
.
-
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, storage)[source]¶ Add subparser for the CLI of this submodule.
This will create the shared
parser
underparent
, then create our own sub-subparser undersubparsers
.Parameters: - parent (object) – Subparser grouping object returned by
ArgumentParser.add_subparsers()
- storage (dict) – Dict of { ‘label’: subparser } to be updated with subparser(s) created, if any.
- parent (object) – Subparser grouping object returned by
-
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()
reportsFalse
-
datastore
= None¶ ESXi datastore to deploy to.
-
locator
= None¶ vSphere target locator.
-
ovftool_args
¶ List of CLI arguments to pass through to
ovftool
.
-