diff --git a/doc/admin.rst b/doc/admin.rst index 3daf408650221995f4acc9ff0d8e49042d076a7e..c173811220ad1d67c05ee1eacdf9b115fc9802e1 100644 --- a/doc/admin.rst +++ b/doc/admin.rst @@ -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 diff --git a/lib/constants.py b/lib/constants.py index 12b816b25471219d714b70e4b4d37a81b8169f84..63807add5ce64c3f47c0fc055230feb2c1745d3b 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -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()) diff --git a/man/gnt-backup.rst b/man/gnt-backup.rst index 9c8900c07309c4c6e2266f144c1da4a01b72935d..106efd01089a5f3cdeeec555e06e34d1c3f50536 100644 --- a/man/gnt-backup.rst +++ b/man/gnt-backup.rst @@ -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 diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst index 5e8d8fe23a5280e7d522d9c1668ddfd525438e04..08b7e0001e850c31c2ddfb28fdced8df35a60c5c 100644 --- a/man/gnt-instance.rst +++ b/man/gnt-instance.rst @@ -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