Instance related commands
Function |
|
Activate an instance's disks. |
Function |
|
Add an instance to the cluster. |
Function |
|
Create instances using a definition file. |
Function |
|
Moves an instance to another group. |
Function |
|
Connect to the console of an instance. |
Function |
|
Deactivate an instance's disks. |
Function |
|
Failover an instance. |
Function |
|
Generic multi-instance operations. |
Function |
|
Grow an instance's disks. |
Function |
|
List instance fields. |
Function |
|
List instances and their properties. |
Function |
|
Undocumented |
Function |
|
Migrate an instance. |
Function |
|
Move an instance. |
Function |
|
Recreate an instance's disks. |
Function |
|
Reinstall an instance. |
Function |
|
Remove an instance. |
Function |
|
Rename an instance. |
Function |
|
Replace the disks of an instance |
Function |
|
Modifies an instance. |
Function |
|
Compute instance run-time status. |
Variable | add |
Undocumented |
Variable | aliases |
Undocumented |
Variable | commands |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Variable | m |
Undocumented |
Function | _ |
Converts NIC/disk modifications from CLI to opcode. |
Function | _ |
Acts based on the result of opcodes.OpInstanceConsole . |
Function | _ |
Check for and ensure the given instance names exist. |
Function | _ |
Expand the given names using the passed mode. |
Function | _ |
Show block device information. |
Function | _ |
Formats the logical_id of a disk. |
Function | _ |
Format instance information for cli.PrintGenericInfo() |
Function | _ |
Helper function for _FormatInstanceInfo() |
Function | _ |
Helper function for _FormatInstanceInfo() |
Function | _ |
Helper function for _FormatInstanceInfo() |
Function | _ |
Parses disk sizes in parameters. |
Function | _ |
Parses the disk params for ExtStorage conversions. |
Function | _ |
Reboot instance(s). |
Function | _ |
Shutdown an instance. |
Function | _ |
Startup instances. |
Constant | _ENV |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _EXPAND |
Undocumented |
Constant | _INST |
Undocumented |
Constant | _LIST |
Undocumented |
Constant | _MISSING |
Undocumented |
Activate an instance's disks.
This serves two purposes:
- it allows (as long as the instance is not running) mounting the disks and modifying them from the node
- it repairs inactive secondary drbds
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Create instances using a definition file.
This function reads a json file with opcodes.OpInstanceCreate
serialisations.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain one element, the json filename |
Returns | |
int | the desired exit code |
Connect to the console of an instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
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.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Failover an instance.
The failover is done by shutting it down on its present node and starting it on the secondary.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
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.
Grow an instance's disks.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain three elements, the target instance name, the target disk id, and the target growth |
Returns | |
int | the desired exit code |
List instance fields.
Parameters | |
opts | the command line options selected by the user |
args:list | fields to list, or empty for all |
Returns | |
int | the desired exit code |
List instances and their properties.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Migrate an instance.
The migrate is done without shutdown.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Move an instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Recreate an instance's disks.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Reinstall an instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the name of the instance to be reinstalled |
Returns | |
int | the desired exit code |
Remove an instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the name of the instance to be removed |
Returns | |
int | the desired exit code |
Rename an instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain two elements, the old and the new instance names |
Returns | |
int | the desired exit code |
Replace the disks of an instance
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Modifies an instance.
All parameters take effect only at the next restart of the instance.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the instance name |
Returns | |
int | the desired exit code |
Compute instance run-time status.
Parameters | |
opts | the command line options selected by the user |
args:list | either an empty list, and then we query all instances, or should contain a list of instance names |
Returns | |
int | the desired exit code |
Converts NIC/disk modifications from CLI to opcode.
When opcodes.OpInstanceSetParams
was changed to support adding/removing disks at arbitrary indices, its parameter format changed. This function converts legacy requests (e.g. "--net add" or "--disk add:size=4G") to the newer format and adds support for new-style requests (e.g. "--new 4:add").
Parameters | |
mods:list of tuples | Modifications as given by command line parser |
Returns | |
list of tuples | Modifications as understood by opcodes.OpInstanceSetParams |
Acts based on the result of opcodes.OpInstanceConsole
.
Parameters | |
console:objects.InstanceConsole | Console object |
show | Whether to just display commands |
cluster | Cluster name as retrieved from master daemon |
feedback | Undocumented |
_runcmd | Undocumented |
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.
Parameters | |
client:ganeti.luxi.Client | the client to use for the query |
names:list | the list of instance names to query |
Raises | |
errors.OpPrereqError | in case any instance is missing |
Expand the given names using the passed mode.
For _EXPAND_CLUSTER, all instances will be returned. For _EXPAND_NODES_PRI/SEC, all instances having those nodes as primary/secondary will be returned. For _EXPAND_NODES_BOTH, all instances having those nodes as either primary or secondary will be returned. For _EXPAND_INSTANCES, the given instances will be returned.
Parameters | |
mode | one of _EXPAND_CLUSTER , _EXPAND_NODES_BOTH , _EXPAND_NODES_PRI , _EXPAND_NODES_SEC or _EXPAND_INSTANCES |
names | a list of names; for cluster, it must be empty, and for node and instance it must be a list of valid item names (short names are valid as usual, e.g. node1 instead of node1.example.com) |
client | Undocumented |
Returns | |
list | the list of names after the expansion |
Raises | |
errors.ProgrammerError | for unknown selection type |
errors.OpPrereqError | for invalid input parameters |
Show block device information.
This is only used by ShowInstanceConfig
, but it's too big to be left for an inline definition.
Parameters | |
idx:int | the index of the current disk |
top | if this a top-level disk? |
dev:dict | dictionary with disk information |
roman:boolean | whether to try to use roman integers |
Returns | |
a list of either strings, tuples or lists (which should be formatted at a higher indent level) |
Reboot instance(s).
This returns the opcode to reboot an instance, and its decorator will wrap this into a loop rebooting all desired instances.
Parameters | |
name | the name of the instance to act on |
opts | the command line options selected by the user |
Returns | |
the opcode needed for the operation |
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.
Parameters | |
name | the name of the instance to act on |
opts | the command line options selected by the user |
Returns | |
the opcode needed for the operation |
Startup instances.
This returns the opcode to start an instance, and its decorator will wrap this into a loop starting all desired instances.
Parameters | |
name | the name of the instance to act on |
opts | the command line options selected by the user |
Returns | |
the opcode needed for the operation |
Undocumented
Value |
|