| [{-B|\--backend-parameters} *BEPARAMS*]
| [{-H|\--hypervisor-parameters} *HYPERVISOR* [: option=*value*... ]]
| [{-O|\--os-parameters} *param*=*value*... ]
-| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap}]
+| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap \| blktap2}]
| {{-n|\--node} *node[:secondary-node]* \| {-I|\--iallocator} *name*}
| {{-o|\--os-type} *os-type*}
| [\--submit]
connected to the said network. ``--no-conflicts-check`` can be used
to override this check. The special value **pool** causes Ganeti to
select an IP from the the network the NIC is or will be connected to.
+ One can pick an externally reserved IP of a network along with
+ ``--no-conflict-check``. Note that this IP cannot be assigned to
+ any other instance until it gets released.
mode
specifies the connection mode for this NIC: routed, bridged or
better performance. Especially if you use a network file system
(e.g. NFS) to store your instances this is the recommended choice.
+blktap2
+ Analogous to the blktap driver, but used by newer versions of Xen.
+
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
BATCH-CREATE
^^^^^^^^^^^^
-**batch-create** {instances\_file.json}
+| **batch-create**
+| [{-I|\--iallocator} *instance allocator*]
+| {instances\_file.json}
This command (similar to the Ganeti 1.2 **batcher** tool) submits
-multiple instance creation jobs based on a definition file. The
-instance configurations do not encompass all the possible options for
-the **add** command, but only a subset.
+multiple instance creation jobs based on a definition file. This
+file can contain all options which are valid when adding an instance
+with the exception of the ``iallocator`` field. The IAllocator is,
+for optimization purposes, only allowed to be set for the whole batch
+operation using the ``--iallocator`` parameter.
-The instance file should be a valid-formed JSON file, containing a
-dictionary with instance name and instance parameters. The accepted
-parameters are:
+The instance file must be a valid-formed JSON file, containing an
+array of dictionaries with instance creation parameters. All parameters
+(except ``iallocator``) which are valid for the instance creation
+OP code are allowed. The most important ones are:
-disk\_size
- The size of the disks of the instance.
+instance\_name
+ The FQDN of the new instance.
disk\_template
The disk template to use for the instance, the same as in the
**add** command.
-backend
+disks
+ Array of disk specifications. Each entry describes one disk as a
+ dictionary of disk parameters.
+
+beparams
A dictionary of backend parameters.
hypervisor
- A dictionary with a single key (the hypervisor name), and as value
- the hypervisor options. If not passed, the default hypervisor and
- hypervisor options will be inherited.
+ The hypervisor for the instance.
-mac, ip, mode, link
- Specifications for the one NIC that will be created for the
- instance. 'bridge' is also accepted as a backwards compatible
- key.
+hvparams
+ A dictionary with the hypervisor options. If not passed, the default
+ hypervisor options will be inherited.
nics
List of NICs that will be created for the instance. Each entry
Please don't provide the "mac, ip, mode, link" parent keys if you
use this method for specifying NICs.
-primary\_node, secondary\_node
+pnode, snode
The primary and optionally the secondary node to use for the
- instance (in case an iallocator script is not used).
-
-iallocator
- Instead of specifying the nodes, an iallocator script can be used
- to automatically compute them.
+ instance (in case an iallocator script is not used). If those
+ parameters are given, they have to be given consistently for all
+ instances in the batch operation.
start
whether to start the instance
A simple definition for one instance can be (with most of the
parameters taken from the cluster defaults)::
- {
- "instance3": {
- "template": "drbd",
- "os": "debootstrap",
- "disk_size": ["25G"],
- "iallocator": "dumb"
+ [
+ {
+ "mode": "create",
+ "instance_name": "instance1.example.com",
+ "disk_template": "drbd",
+ "os_type": "debootstrap",
+ "disks": [{"size":"1024"}],
+ "nics": [{}],
+ "hypervisor": "xen-pvm"
},
- "instance5": {
- "template": "drbd",
- "os": "debootstrap",
- "disk_size": ["25G"],
- "iallocator": "dumb",
+ {
+ "mode": "create",
+ "instance_name": "instance2.example.com",
+ "disk_template": "drbd",
+ "os_type": "debootstrap",
+ "disks": [{"size":"4096", "mode": "rw", "vg": "xenvg"}],
+ "nics": [{}],
"hypervisor": "xen-hvm",
"hvparams": {"acpi": true},
- "backend": {"maxmem": 512, "minmem": 256}
+ "beparams": {"maxmem": 512, "minmem": 256}
}
- }
+ ]
The command will display the job id for each submitted instance, as
follows::
# gnt-instance batch-create instances.json
- instance3: 11224
- instance5: 11225
+ Submitted jobs 37, 38
REMOVE
^^^^^^
| [\--offline \| \--online]
| [\--submit]
| [\--ignore-ipolicy]
+| [\--hotplug]
| {*instance*}
Modifies the memory size, number of vcpus, ip address, MAC address
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
+If ``--hotplug`` is given any disk and NIC modifications will take
+effect without the need of actual reboot. Please note that this feature
+is currently supported only for KVM hypervisor and there are some
+restrictions: a) KVM versions >= 1.0 support it b) instances with chroot
+or uid pool security model do not support disk hotplug c) RBD disks with
+userspace access mode can not be hotplugged (yet) d) if hotplug fails
+(for any reason) a warning is printed but execution is continued e)
+for existing NIC modification interactive verification is needed unless
+``--force`` option is passed.
+
See **ganeti**\(7) for a description of ``--submit`` and other common
options.