Added "vg" argument to the --disk syntax
authorDmitry Chernyak <dmi.chernyak@gmail.com>
Thu, 25 Nov 2010 00:14:36 +0000 (03:14 +0300)
committerIustin Pop <iustin@google.com>
Thu, 25 Nov 2010 11:21:27 +0000 (11:21 +0000)
Added "vg" argument to the "gnt-instance ... --disk" syntax specification.
Now is ok to write:

gnt-instance add ... --disk N:size=NNg,vg=VG_NAME ...

But not all internal structures are ready to handle this yet.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: removed changes to design-2.0.rst]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

doc/admin.rst
lib/constants.py
man/gnt-backup.rst
man/gnt-instance.rst

index 3daf408..c173811 100644 (file)
@@ -356,7 +356,7 @@ then create a Ganeti instance in the usual way, except that instead of
 passing the disk information you specify the current volumes::
 
   gnt-instance add -t plain -n HOME_NODE ... \
-    --disk 0:adopt=lv_name INSTANCE_NAME
+    --disk 0:adopt=lv_name[,vg=vg_name] INSTANCE_NAME
 
 This will take over the given logical volumes, rename them to the Ganeti
 standard (UUID-based), and without installing the OS on them start
index 12b816b..63807ad 100644 (file)
@@ -664,10 +664,12 @@ NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
 IDISK_SIZE = "size"
 IDISK_MODE = "mode"
 IDISK_ADOPT = "adopt"
+IDISK_VG = "vg"
 IDISK_PARAMS_TYPES = {
   IDISK_SIZE: VTYPE_SIZE,
   IDISK_MODE: VTYPE_STRING,
   IDISK_ADOPT: VTYPE_STRING,
+  IDISK_VG: VTYPE_STRING,
   }
 IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
 
index 9c8900c..106efd0 100644 (file)
@@ -63,7 +63,7 @@ IMPORT
 
 | **import**
 | {-n *node[:secondary-node]* | --iallocator *name*}
-| [--disk *N*:size=*VAL* [,mode=*ro|rw*]...]
+| [--disk *N*:size=*VAL* [,vg=*VG*], [,mode=*ro|rw*]...]
 | [--net *N* [:options...] | --no-nics]
 | [-B *BEPARAMS*]
 | [-H *HYPERVISOR* [: option=*value*... ]]
@@ -81,11 +81,11 @@ as visible with the **list** command.
 The ``disk`` option specifies the parameters for the disks of the
 instance. The numbering of disks starts at zero. For each disk, at
 least the size needs to be given, and optionally the access mode
-(read-only or the default of read-write) can also be specified. The
-size is interpreted (when no unit is given) in mebibytes. You can
-also use one of the suffixes m, g or t to specificy the exact the
-units used; these suffixes map to mebibytes, gibibytes and
-tebibytes.
+(read-only or the default of read-write) and LVM volume group can also
+be specified. The size is interpreted (when no unit is given) in
+mebibytes. You can also use one of the suffixes m, g or t to specificy
+the exact the units used; these suffixes map to mebibytes, gibibytes
+and tebibytes.
 
 Alternatively, a single-disk instance can be created via the ``-s``
 option which takes a single argument, the size of the disk. This is
index 5e8d8fe..08b7e00 100644 (file)
@@ -28,7 +28,8 @@ ADD
 
 | **add**
 | {-t {diskless | file \| plain \| drbd}}
-| {--disk=*N*: {size=*VAL* \| adopt=*LV*},mode=*ro\|rw* \| -s *SIZE*}
+| {--disk=*N*: {size=*VAL* \| adopt=*LV*}[,vg=*VG*][,mode=*ro\|rw*]
+|  \| -s *SIZE*}
 | [--no-ip-check] [--no-name-check] [--no-start] [--no-install]
 | [--net=*N* [:options...] \| --no-nics]
 | [-B *BEPARAMS*]
@@ -47,10 +48,10 @@ The ``disk`` option specifies the parameters for the disks of the
 instance. The numbering of disks starts at zero, and at least one disk
 needs to be passed. For each disk, either the size or the adoption
 source needs to be given, and optionally the access mode (read-only or
-the default of read-write) can also be specified. The size is
-interpreted (when no unit is given) in mebibytes. You can also use one
-of the suffixes *m*, *g* or *t* to specify the exact the units used;
-these suffixes map to mebibytes, gibibytes and tebibytes.
+the default of read-write) and LVM volume group can also be specified.
+The size is interpreted (when no unit is given) in mebibytes. You can
+also use one of the suffixes *m*, *g* or *t* to specify the exact the
+units used; these suffixes map to mebibytes, gibibytes and tebibytes.
 
 When using the ``adopt`` key in the disk definition, Ganeti will
 reuse those volumes (instead of creating new ones) as the
@@ -477,6 +478,8 @@ Example::
       -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
     # gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
       -n node1.example.com instance1.example.com
+    # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
+      -B memory=512 -o debian-etch -n node1.example.com instance1.example.com
     # gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
       -n node1.example.com:node2.example.com instance2.example.com
 
@@ -833,7 +836,8 @@ MODIFY
 | [-H *HYPERVISOR\_PARAMETERS*]
 | [-B *BACKEND\_PARAMETERS*]
 | [--net add*[:options]* \| --net remove \| --net *N:options*]
-| [--disk add:size=*SIZE* \| --disk remove \| --disk *N*:mode=*MODE*]
+| [--disk add:size=*SIZE*[,vg=*VG*] \| --disk remove \|
+|  --disk *N*:mode=*MODE*]
 | [-t plain | -t drbd -n *new_secondary*]
 | [--os-name=*OS* [--force-variant]]
 | [--submit]
@@ -855,9 +859,10 @@ conversion. When changing from the plain to the drbd disk template, a
 new secondary node must be specified via the ``-n`` option.
 
 The ``--disk add:size=``*SIZE* option adds a disk to the instance. The
-``--disk remove`` option will remove the last disk of the
-instance. The ``--disk`` *N*``:mode=``*MODE* option will change the
-mode of the Nth disk of the instance between read-only (``ro``) and
+optional ``vg=``*VG* option specifies LVM volume group other than default
+vg to create disk on. The ``--disk remove`` option will remove the last
+disk of the instance. The ``--disk`` *N*``:mode=``*MODE* option will change
+the mode of the Nth disk of the instance between read-only (``ro``) and
 read-write (``rw``).
 
 The ``--net add:``*options* option will add a new NIC to the