Trees | Indices | Help |
|
---|
|
Instance related commands
|
|||
list |
|
||
boolean |
|
||
|
|||
|
|||
int |
|
||
|
|||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
|
|||
|
|||
|
|||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
int |
|
||
|
|||
|
|||
|
|||
|
|||
int |
|
||
int |
|
|
|||
_SHUTDOWN_CLUSTER = "cluster"
|
|||
_SHUTDOWN_NODES_BOTH = "nodes"
|
|||
_SHUTDOWN_NODES_PRI = "nodes-pri"
|
|||
_SHUTDOWN_NODES_SEC = "nodes-sec"
|
|||
_SHUTDOWN_NODES_BOTH_BY_TAGS = "nodes-by-tags"
|
|||
_SHUTDOWN_NODES_PRI_BY_TAGS = "nodes-pri-by-tags"
|
|||
_SHUTDOWN_NODES_SEC_BY_TAGS = "nodes-sec-by-tags"
|
|||
_SHUTDOWN_INSTANCES = "instances"
|
|||
_SHUTDOWN_INSTANCES_BY_TAGS = "instances-by-tags"
|
|||
_SHUTDOWN_NODES_TAGS_MODES = _SHUTDOWN_NODES_BOTH_BY_TAGS, _SH
|
|||
_VALUE_TRUE = "true"
|
|||
_LIST_DEF_FIELDS = ["name", "hypervisor", "os", "pnode", "stat default list of options for ListInstances |
|||
m_force_multi = cli_option("--force-multiple", dest= "force_mu
|
|||
m_pri_node_opt = cli_option("--primary", dest= "multi_mode", h
|
|||
m_sec_node_opt = cli_option("--secondary", dest= "multi_mode",
|
|||
m_node_opt = cli_option("--node", dest= "multi_mode", help= "F
|
|||
m_clust_opt = cli_option("--all", dest= "multi_mode", help= "S
|
|||
m_inst_opt = cli_option("--instance", dest= "multi_mode", help
|
|||
m_node_tags_opt = cli_option("--node-tags", dest= "multi_mode"
|
|||
m_pri_node_tags_opt = cli_option("--pri-node-tags", dest= "mul
|
|||
m_sec_node_tags_opt = cli_option("--sec-node-tags", dest= "mul
|
|||
m_inst_tags_opt = cli_option("--tags", dest= "multi_mode", hel
|
|||
add_opts = [BACKEND_OPT, DISK_OPT, DISK_TEMPLATE_OPT, FILESTOR
|
|||
commands = {'add':(AddInstance, [ArgHost(min= 1, max= 1)], add
|
|||
aliases = {'start': 'startup', 'stop': 'shutdown',} dictionary with aliases for commands |
Imports: sys, os, itertools, simplejson, StringIO, opcodes, constants, compat, utils, errors, netutils
|
Expand the given names using the passed mode. For _SHUTDOWN_CLUSTER, all instances will be returned. For _SHUTDOWN_NODES_PRI/SEC, all instances having those nodes as primary/secondary will be returned. For _SHUTDOWN_NODES_BOTH, all instances having those nodes as either primary or secondary will be returned. For _SHUTDOWN_INSTANCES, the given instances will be returned.
|
Ask the user to confirm an operation on a list of instances. This function is used to request confirmation for doing an operation on a given list of instances.
|
Check for and ensure the given instance names exist. This function will raise an OpPrereqError in case they don't exist. Otherwise it will exit cleanly.
|
Generic multi-instance operations. The will return a wrapper that processes the options and arguments given, and uses the passed function to build the opcode needed for the specific operation. Thus all the generic loop/confirmation code is abstracted into this function. |
List instances and their properties.
|
Add an instance to the cluster. This is just a wrapper over GenericInstanceCreate. |
Create instances using a definition file. This function reads a json file with instances defined in the form: {"instance-name":{ "disk_size": [20480], "template": "drbd", "backend": { "memory": 512, "vcpus": 1 }, "os": "debootstrap", "primary_node": "firstnode", "secondary_node": "secondnode", "iallocator": "dumb"} } Note that primary_node and secondary_node have precedence over iallocator.
|
Reinstall an instance.
|
Remove an instance.
|
Rename an instance.
|
Activate an instance's disks. This serves two purposes:
|
Deactivate an instance's disks. This function takes the instance name, looks for its primary node and the tries to shutdown its block devices on that node.
|
Recreate an instance's disks.
|
Grow an instance's disks.
|
Startup instances. This returns the opcode to start an instance, and its decorator will wrap this into a loop starting all desired instances.
|
Reboot instance(s). This returns the opcode to reboot an instance, and its decorator will wrap this into a loop rebooting all desired instances.
|
Shutdown an instance. This returns the opcode to shutdown an instance, and its decorator will wrap this into a loop shutting down all desired instances.
|
Replace the disks of an instance
|
Failover an instance. The failover is done by shutting it down on its present node and starting it on the secondary.
|
Migrate an instance. The migrate is done without shutdown.
|
Move an instance.
|
Connect to the console of an instance.
|
Show block device information. This is only used by ShowInstanceConfig, but it's too big to be left for an inline definition.
|
Formats a list of data at a given indent level. If the element of the list is:
|
Formats a parameter dictionary.
|
Compute instance run-time status.
|
Modifies an instance. All parameters take effect only at the next restart of the instance.
|
|
_SHUTDOWN_NODES_TAGS_MODES
|
_LIST_DEF_FIELDSdefault list of options for ListInstances
|
m_force_multi
|
m_pri_node_opt
|
m_sec_node_opt
|
m_node_opt
|
m_clust_opt
|
m_inst_opt
|
m_node_tags_opt
|
m_pri_node_tags_opt
|
m_sec_node_tags_opt
|
m_inst_tags_opt
|
add_opts
|
commands
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Dec 9 15:55:23 2010 | http://epydoc.sourceforge.net |