+ <title>BATCH-CREATE</title>
+ <cmdsynopsis>
+ <command>batch-create</command>
+ <arg choice="req">instances_file.json</arg>
+ </cmdsynopsis>
+
+ <para>
+ This command (similar to the Ganeti 1.2
+ <command>batcher</command> tool) submits multiple instance
+ creation jobs based on a definition file. The instance
+ configurations do not encompass all the possible options for
+ the <command>add</command> command, but only a subset.
+ </para>
+
+ <para>
+ The instance file should be a valid-formed JSON file,
+ containing a dictionary with instance name and instance
+ parameters. The accepted parameters are:
+
+ <variablelist>
+ <varlistentry>
+ <term>disk_size</term>
+ <listitem>
+ <simpara>The size of the disks of the instance.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>disk_templace</term>
+ <listitem>
+ <simpara>The disk template to use for the instance,
+ the same as in the <command>add</command>
+ command.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>backend</term>
+ <listitem>
+ <simpara>A dictionary of backend parameters.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>hypervisor</term>
+ <listitem>
+ <simpara>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.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>mac, ip, bridge</term>
+ <listitem>
+ <simpara>Specifications for the one NIC that will be
+ created for the instance.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>primary_node, secondary_node</term>
+ <listitem>
+ <simpara>The primary and optionally the secondary node
+ to use for the instance (in case an iallocator script
+ is not used).</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>iallocator</term>
+ <listitem>
+ <simpara>Instead of specifying the nodes, an
+ iallocator script can be used to automatically compute
+ them.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>start</term>
+ <listitem>
+ <simpara>whether to start the instance</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>ip_check</term>
+ <listitem>
+ <simpara>Skip the check for already-in-use instance;
+ see the description in the <command>add</command>
+ command for details.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>file_storage_dir, file_driver</term>
+ <listitem>
+ <simpara>Configuration for the <literal>file</literal>
+ disk type, see the <command>add</command> command for
+ details.</simpara>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+
+ <para>
+ A simple definition for one instance can be (with most of
+ the parameters taken from the cluster defaults):
+ <screen>
+{
+ "instance3": {
+ "template": "drbd",
+ "os": "debootstrap",
+ "disk_size": ["25G"],
+ "iallocator": "dumb"
+ },
+ "instance5": {
+ "template": "drbd",
+ "os": "debootstrap",
+ "disk_size": ["25G"],
+ "iallocator": "dumb",
+ "hypervisor": "xen-hvm",
+ "hvparams": {"acpi": true},
+ "backend": {"memory": 512}
+ }
+}
+</screen>
+ </para>
+
+ <para>
+ The command will display the job id for each submitted instance, as follows:
+ <screen>
+# gnt-instance batch-create instances.json
+instance3: 11224
+instance5: 11225
+</screen>
+ </para>
+
+ </refsect3>
+
+ <refsect3>