gnt-node list: Query filter support
[ganeti-local] / man / gnt-instance.rst
index 3814a88..397466e 100644 (file)
@@ -34,6 +34,7 @@ ADD
 | [--net=*N* [:options...] \| --no-nics]
 | [-B *BEPARAMS*]
 | [-H *HYPERVISOR* [: option=*value*... ]]
+| [-O, --os-parameters *param*=*value*... ]
 | [--file-storage-dir *dir\_path*] [--file-driver {loop \| blktap}]
 | {-n *node[:secondary-node]* \| --iallocator *name*}
 | {-o *os-type*}
@@ -127,8 +128,6 @@ The ``-B`` option specifies the backend parameters for the
 instance. If no such parameters are specified, the values are
 inherited from the cluster. Possible parameters are:
 
-
-
 memory
     the memory size of the instance; as usual, suffixes can be used to
     denote the unit, otherwise the value is taken in mebibites
@@ -151,8 +150,6 @@ the cluster defaults at cluster creation time.
 
 The possible hypervisor options are as follows:
 
-
-
 boot\_order
     Valid for the Xen HVM and KVM hypervisors.
 
@@ -411,6 +408,14 @@ usb\_mouse
     "tablet".
 
 
+The ``-O`` (``--os-parameters``) option allows customisation of the OS
+parameters. The actual parameter names and values depends on the OS
+being used, but the syntax is the same key=value. For example, setting
+a hypothetical ``dhcp`` parameter to yes can be achieved by::
+
+    gnt-instance add -O dhcp=yes ...
+
+
 The ``--iallocator`` option specifies the instance allocator plugin
 to use. If you pass in this option the allocator will select nodes
 for this instance automatically, so you don't need to pass them
@@ -619,8 +624,8 @@ LIST
 ^^^^
 
 | **list**
-| [--no-headers] [--separator=*SEPARATOR*] [--units=*UNITS*]
-| [-o *[+]FIELD,...*] [instance...]
+| [--no-headers] [--separator=*SEPARATOR*] [--units=*UNITS*] [-v]
+| [-o *[+]FIELD,...*] [--filter] [instance...]
 
 Shows the currently configured instances with memory usage, disk
 usage, the node they are running on, and their run status.
@@ -637,164 +642,13 @@ option is given, then the values are shown in mebibytes to allow
 parsing by scripts. In both cases, the ``--units`` option can be
 used to enforce a given output unit.
 
+The ``-v`` option activates verbose mode, which changes the display of
+special field states (see **ganeti(7)**).
+
 The ``-o`` option takes a comma-separated list of output fields.
 The available fields and their meaning are:
 
-
-
-name
-    the instance name
-
-os
-    the OS of the instance
-
-pnode
-    the primary node of the instance
-
-snodes
-    comma-separated list of secondary nodes for the instance; usually
-    this will be just one node
-
-admin\_state
-    the desired state of the instance (either "yes" or "no" denoting
-    the instance should run or not)
-
-disk\_template
-    the disk template of the instance
-
-oper\_state
-    the actual state of the instance; can be one of the values
-    "running", "stopped", "(node down)"
-
-status
-    combined form of admin\_state and oper\_stat; this can be one of:
-    ERROR\_nodedown if the node of the instance is down, ERROR\_down if
-    the instance should run but is down, ERROR\_up if the instance
-    should be stopped but is actually running, ADMIN\_down if the
-    instance has been stopped (and is stopped) and running if the
-    instance is set to be running (and is running)
-
-oper\_ram
-    the actual memory usage of the instance as seen by the hypervisor
-
-oper\_vcpus
-    the actual number of VCPUs the instance is using as seen by the
-    hypervisor
-
-ip
-    the ip address Ganeti recognizes as associated with the first
-    instance interface
-
-mac
-    the first instance interface MAC address
-
-nic\_mode
-    the mode of the first instance NIC (routed or bridged)
-
-nic\_link
-    the link of the first instance NIC
-
-sda\_size
-    the size of the instance's first disk
-
-sdb\_size
-    the size of the instance's second disk, if any
-
-vcpus
-    the number of VCPUs allocated to the instance
-
-tags
-    comma-separated list of the instances's tags
-
-serial\_no
-    the so called 'serial number' of the instance; this is a numeric
-    field that is incremented each time the instance is modified, and
-    it can be used to track modifications
-
-ctime
-    the creation time of the instance; note that this field contains
-    spaces and as such it's harder to parse
-
-    if this attribute is not present (e.g. when upgrading from older
-    versions), then "N/A" will be shown instead
-
-mtime
-    the last modification time of the instance; note that this field
-    contains spaces and as such it's harder to parse
-
-    if this attribute is not present (e.g. when upgrading from older
-    versions), then "N/A" will be shown instead
-
-uuid
-    Show the UUID of the instance (generated automatically by Ganeti)
-
-network\_port
-    If the instance has a network port assigned to it (e.g. for VNC
-    connections), this will be shown, otherwise - will be displayed.
-
-beparams
-    A text format of the entire beparams for the instance. It's more
-    useful to select individual fields from this dictionary, see
-    below.
-
-disk.count
-    The number of instance disks.
-
-disk.size/N
-    The size of the instance's Nth disk. This is a more generic form of
-    the sda\_size and sdb\_size fields.
-
-disk.sizes
-    A comma-separated list of the disk sizes for this instance.
-
-disk\_usage
-    The total disk space used by this instance on each of its nodes.
-    This is not the instance-visible disk size, but the actual disk
-    "cost" of the instance.
-
-nic.mac/N
-    The MAC of the Nth instance NIC.
-
-nic.ip/N
-    The IP address of the Nth instance NIC.
-
-nic.mode/N
-    The mode of the Nth instance NIC
-
-nic.link/N
-    The link of the Nth instance NIC
-
-nic.macs
-    A comma-separated list of all the MACs of the instance's NICs.
-
-nic.ips
-    A comma-separated list of all the IP addresses of the instance's
-    NICs.
-
-nic.modes
-    A comma-separated list of all the modes of the instance's NICs.
-
-nic.links
-    A comma-separated list of all the link parameters of the instance's
-    NICs.
-
-nic.count
-    The number of instance nics.
-
-hv/*NAME*
-    The value of the hypervisor parameter called *NAME*. For details of
-    what hypervisor parameters exist and their meaning, see the **add**
-    command.
-
-be/memory
-    The configured memory for the instance.
-
-be/vcpus
-    The configured number of VCPUs for the instance.
-
-be/auto\_balance
-    Whether the instance is considered in N+1 checks.
-
+@QUERY_FIELDS_INSTANCE@
 
 If the value of the option starts with the character ``+``, the new
 field(s) will be added to the default list. This allows to quickly
@@ -810,8 +664,14 @@ to ask the remote nodes for the data. This can be helpful for big
 clusters when you only want some data and it makes sense to specify
 a reduced set of output fields.
 
-The default output field list is: name, os, pnode, admin\_state,
-oper\_state, oper\_ram.
+If exactly one argument is given and it appears to be a query filter
+(see **ganeti(7)**), the query result is filtered accordingly. For
+ambiguous cases (e.g. a single field name as a filter) the ``--filter``
+(``-F``) option forces the argument to be treated as a filter (e.g.
+``gnt-instance list -F admin_state``).
+
+The default output field list is: ``name``, ``os``, ``pnode``,
+``admin_state``, ``oper_state``, ``oper_ram``.
 
 
 LIST-FIELDS
@@ -852,7 +712,8 @@ MODIFY
 | [--disk add:size=*SIZE*[,vg=*VG*] \| --disk remove \|
 |  --disk *N*:mode=*MODE*]
 | [-t plain | -t drbd -n *new_secondary*]
-| [--os-name=*OS* [--force-variant]]
+| [--os-type=*OS* [--force-variant]]
+| [-O, --os-parameters *param*=*value*... ]
 | [--submit]
 | {*instance*}
 
@@ -861,9 +722,9 @@ and/or nic parameters for an instance. It can also add and remove
 disks and NICs to/from the instance. Note that you need to give at
 least one of the arguments, otherwise the command complains.
 
-The ``-H`` option specifies hypervisor options in the form of
-name=value[,...]. For details which options can be specified, see
-the **add** command.
+The ``-H``, ``-B`` and ``-O`` options specifies hypervisor, backend
+and OS parameter options in the form of name=value[,...]. For details
+which options can be specified, see the **add** command.
 
 The ``-t`` option will change the disk template of the instance.
 Currently only conversions between the plain and drbd disk templates
@@ -884,7 +745,7 @@ instance. The available options are the same as in the **add** command
 of the instance, while the ``--net`` *N*:*options* option will
 change the parameters of the Nth instance NIC.
 
-The option ``--os-name`` will change the OS name for the instance
+The option ``--os-type`` will change the OS name for the instance
 (without reinstallation). In case an OS variant is specified that
 is not found, then by default the modification is refused, unless
 ``--force-variant`` is passed. An invalid OS will also be refused,
@@ -911,8 +772,8 @@ instance(s) must be stopped when running this command. If the
 
 The ``--select-os`` option switches to an interactive OS reinstall.
 The user is prompted to select the OS template from the list of
-available OS templates. OS parameters can be overridden using
-``-O``.
+available OS templates. OS parameters can be overridden using ``-O``
+(more documentation for this option under the **add** command).
 
 Since this is a potentially dangerous command, the user will be
 required to confirm this action, unless the ``-f`` flag is passed.
@@ -938,11 +799,11 @@ the IP it resolves to must not be reachable (in order to prevent
 duplicate IPs the next time the instance is started). The IP test
 can be skipped if the ``--no-ip-check`` option is passed.
 
-The ``--no-name-check`` skips the check for the new instance name
-via the resolver (e.g. in DNS or /etc/hosts, depending on your
-setup). Since the name check is used to compute the IP address, if
-you pass this option you must also pass the ``--no-ip-check``
-option.
+The ``--no-name-check`` skips the check for the new instance name via
+the resolver (e.g. in DNS or /etc/hosts, depending on your setup) and
+that the resolved name matches the provided name. Since the name check
+is used to compute the IP address, if you pass this option you must also
+pass the ``--no-ip-check`` option.
 
 The ``--submit`` option is used to send the job to the master
 daemon but not wait for its completion. The job ID will be shown so
@@ -1236,7 +1097,7 @@ already running.
 DEACTIVATE-DISKS
 ^^^^^^^^^^^^^^^^
 
-**deactivate-disks** [--submit] {*instance*}
+**deactivate-disks** [-f] [--submit] {*instance*}
 
 De-activates the block devices of the given instance. Note that if
 you run this command for an instance with a drbd disk template,
@@ -1244,6 +1105,13 @@ while it is running, it will not be able to shutdown the block
 devices on the primary node, but it will shutdown the block devices
 on the secondary nodes, thus breaking the replication.
 
+The ``-f``/``--force`` option will skip checks that the instance is
+down; in case the hypervisor is confused and we can't talk to it,
+normally Ganeti will refuse to deactivate the disks, but with this
+option passed it will skip this check and directly try to deactivate
+the disks. This can still fail due to the instance actually running or
+other issues.
+
 The ``--submit`` option is used to send the job to the master
 daemon but not wait for its completion. The job ID will be shown so
 that it can be examined via **gnt-job info**.
@@ -1357,8 +1225,8 @@ MIGRATE
 
 **migrate** [-f] {--cleanup} {*instance*}
 
-**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
-{*instance*}
+**migrate** [-f] [--allow-failover] [--non-live]
+[--migration-mode=live\|non-live] {*instance*}
 
 Migrate will move the instance to its secondary node without
 shutdown. It only works for instances having the drbd8 disk
@@ -1390,6 +1258,11 @@ instances's disks are configured correctly. In this mode, the
 
 The option ``-f`` will skip the prompting for confirmation.
 
+If ``--allow-failover`` is specified it tries to fallback to failover if
+it already can determine that a migration wont work (i.e. if the
+instance is shutdown). Please note that the fallback will not happen
+during execution. If a migration fails during execution it still fails.
+
 Example (and expected output)::
 
     # gnt-instance migrate instance1
@@ -1475,3 +1348,5 @@ be extended with the contents of that file (each line becomes a tag).
 In this case, there is not need to pass tags on the command line (if
 you do, tags from both sources will be removed). A file name of - will
 be interpreted as stdin.
+
+.. vim: set textwidth=72 :