+ <title>Common environment</title>
+ <para>
+ All commands will get their input via environment variables. A
+ common set of variables will be exported for all commands, and
+ some of them might have extra ones. Note that all counts are
+ zero-based.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>OS_API_VERSION</term>
+ <listitem>
+ <simpara>The OS api version that the rest of the
+ environment conforms to.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>INSTANCE_NAME</term>
+ <listitem>
+ <simpara>The instance name the script should operate
+ on.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>INSTANCE_OS</term>
+ <listitem>
+ <simpara>The name os the instance's OS as Ganeti knows
+ it. This can simplify the OS scripts by providing the same
+ scripts under multiple names, and then the scripts can use
+ this name to alter their behaviour.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>HYPERVISOR</term>
+ <listitem>
+ <simpara>The hypervisor of this instance.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DISK_COUNT</term>
+ <listitem>
+ <simpara>The number of disks the instance has. The actual
+ disk defitions are in a set of additional variables. The
+ instance's disk will be numbered from 0 to this value
+ minus one.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DISK_%N_PATH</term>
+ <listitem>
+ <simpara>The path to the storage for disk N of the
+ instance. This might be either a block device or a regular
+ file, in which case the OS scripts should use
+ <emphasis>losetup</emphasis> (if they need to mount
+ it). E.g. the first disk of the instance might be exported
+ as <envar>DISK_0_PATH=/dev/drbd0</envar>.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DISK_%N_ACCESS</term>
+ <listitem>
+ <simpara>This is how the hypervisor will export the
+ instance disks: either read-write (<emphasis>rw</emphasis>) or
+ read-only (<emphasis>ro</emphasis>).</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DISK_%N_FRONTEND_TYPE</term>
+ <listitem>
+ <simpara>(Optional) If applicable to the current
+ hypervisor type: the type of the device exported by the
+ hypervisor. For example, the Xen HVM hypervisor can export
+ disks as either <emphasis>paravirtual</emphasis> or
+ <emphasis>ioemu</emphasis>.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DISK_%N_BACKEND_TYPE</term>
+ <listitem>
+ <simpara>How files are visible on the node side. This can
+ be either <emphasis>block</emphasis> (when using block
+ devices) or <emphasis>file:type</emphasis>, where
+ <emphasis>type</emphasis> is either
+ <emphasis>loop</emphasis> <emphasis>blktap</emphasis>
+ depending on how the hypervisor will be configured. Note
+ that not all backend types apply to all
+ hypervisors.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>NIC_COUNT</term>
+ <listitem>
+ <simpara>Similar to the <envar>DISK_COUNT</envar>, this
+ represents the number of NICs of the instance.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>NIC_%N_MAC</term>
+ <listitem>
+ <simpara>The MAC address associated with this
+ interface.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>NIC_%N_IP</term>
+ <listitem>
+ <simpara>The IP address, if any, associated with the N-th
+ NIC of the instance.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>NIC_%N_BRIDGE</term>
+ <listitem>
+ <simpara>The bridge to which this NIC will be attached
+ to.</simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>NIC_%N_FRONTEND_TYPE</term>
+ <listitem>
+ <para>(Optional) If applicable, the type of the exported
+ NIC to the instance, this can be one of of: <simplelist
+ type="inline"> <member>rtl8139</member>
+ <member>ne2k_pci</member> <member>ne2k_isa</member>
+ <member>paravirtual</member> </simplelist>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>DEBUG_LEVEL</term>
+ <listitem>
+ <simpara>If non-zero, this should cause the OS script to
+ generate verbose logs of its execution, for
+ troubleshooting purposes. Currently only
+ <emphasis>0</emphasis> and <emphasis>1</emphasis> are
+ valid values.</simpara>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+
+ <refsect2>