openstack-manuals/doc/common/section_nova_boot_from_volume.xml
Tom Fifield f9cdba79aa Fixes to common section docs
Docs on a plane returns.

A cohort of small changes, reducing cruft and improving clarity of
these common sections.

Change-Id: I11c0ee83f4b2805304bb2e84e548c0a6aeaa135e
2013-09-26 16:30:51 -05:00

188 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="boot_from_volume">
<title>Launch an instance from a volume</title>
<para>After you <link linkend="create_volume_from_image">create
a bootable volume</link>, you <link
linkend="launch_image_from_volume">launch an instance from
the volume</link>.</para>
<procedure xml:id="create_volume_from_image">
<title>To launch and instance from a volume</title>
<step>
<para>To create a bootable volume from an image, run the
following command:
<screen><prompt>#</prompt> <userinput>cinder create --image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \
--display-name my-bootable-vol 8</userinput></screen>
</para>
<note>
<para>You can also use the <command>nova</command>
<option>volume-create</option> command to complete the same
action:
<screen><prompt>#</prompt> <userinput>nova volume-create \
--image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \
--display-name my-bootable-vol 8</userinput></screen></para>
</note>
<para>Optionally, to configure your volume, see the
<citetitle>Configuring Image Service and Storage for
Compute</citetitle> chapter in the <citetitle>OpenStack
Configuration Reference</citetitle>.</para>
</step>
<step>
<para>To list volumes, run the following command:</para>
<screen><prompt>$</prompt> <userinput>nova volume-list</userinput></screen>
<screen><?db-font-size 55%?><computeroutput>+--------------------------------------+-----------+-----------------+------+-------------+-------------+
| ID | Status | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+-----------+-----------------+------+-------------+-------------+
| bd7cf584-45de-44e3-bf7f-f7b50bf235e3 | available | my-bootable-vol | 8 | None | |
+--------------------------------------+-----------+-----------------+------+-------------+-------------+</computeroutput></screen>
<para>Copy the value in the <literal>ID</literal> field for your
volume.</para>
</step>
<step xml:id="launch_image_from_volume">
<para>To launch an instance, run the <command>nova</command>
<option>boot</option> command with the
<parameter>--block_device_mapping</parameter> parameter, as
follows:</para>
<screen><prompt>$</prompt> <userinput>nova boot --flavor <replaceable>FLAVOR</replaceable> --block_device_mapping \
<replaceable>DEVNAME</replaceable>=<replaceable>ID</replaceable>:<replaceable>TYPE</replaceable>:<replaceable>SIZE</replaceable>:<replaceable>DELETE_ON_TERMINATE</replaceable> <replaceable>NAME</replaceable></userinput></screen>
<para>The command arguments are:</para>
<informaltable>
<col width="30%"/>
<col width="70%"/>
<tbody>
<tr>
<td>
<para><parameter>--flavor</parameter>
<replaceable>FLAVOR</replaceable></para>
</td>
<td>
<para>The flavor ID.</para>
</td>
</tr>
<tr>
<td>
<para><parameter>--block_device_mapping</parameter>
<replaceable>DEVNAME</replaceable>=<replaceable>ID</replaceable>:<replaceable>type</replaceable>:<replaceable>size</replaceable>:<replaceable>delete-on-terminate</replaceable></para>
</td>
<td>
<itemizedlist>
<listitem>
<para><replaceable>DEVNAME</replaceable>. A device
name where the volume is attached in the system at
<filename>/dev/<replaceable>dev_name</replaceable></filename>.
This value is typically
<literal>vda</literal>.</para>
</listitem>
<listitem>
<para><replaceable>ID</replaceable>. The ID of the
volume to boot from, as shown in the output of
<command>nova volume-list</command>.</para>
</listitem>
<listitem>
<para><replaceable>type</replaceable>. Either
<literal>snap</literal> or any other value,
including a blank string. <literal>snap</literal>
means that the volume was created from a
snapshot.</para>
</listitem>
<listitem>
<para><replaceable>size</replaceable>. The size of
the volume, in GBs. It is safe to leave this blank
and have the Compute service infer the
size.</para>
</listitem>
<listitem>
<para><replaceable>delete-on-terminate</replaceable>.
Boolean. Indicates whether the volume is deleted
when the instance is deleted. You can
specify:</para>
<itemizedlist>
<listitem>
<para><literal>True</literal> or
<literal>1</literal>
</para>
</listitem>
<listitem>
<para><literal>False</literal> or
<literal>0</literal></para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</td>
</tr>
<tr>
<td>
<para><replaceable>NAME</replaceable></para>
</td>
<td>
<para>The name for the server.</para>
</td>
</tr>
</tbody>
</informaltable>
<note>
<para>You must specify an image when booting from a volume,
even though the specified image is not used. Otherwise, the
<literal>Attempt to boot from volume - no image
supplied</literal> error is returned.</para>
</note>
<para>You can also attach a swap disk on boot with the <parameter>--swap</parameter>
flag, or you can attach an ephemeral disk on boot with the <parameter>--ephemeral</parameter> flag.</para>
<para>For example, you might enter the following command to boot
from a volume with ID bd7cf584-45de-44e3-bf7f-f7b50bf235e. The
volume is not deleted when the instance is terminated:</para>
<screen><prompt>$</prompt> <userinput>nova boot --flavor 2 --image 397e713c-b95b-4186-ad46-6126863ea0a9 --block_device_mapping vda=bd7cf584-45de-44e3-bf7f-f7b50bf235e3:::0 myInstanceFromVolume</userinput></screen>
<screen><?db-font-size 65%?><computeroutput>+-------------------------------------+-------------------------------------------------+
| Property | Value |
+-------------------------------------+-------------------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | cirros-0.3.1-x86_64-uec |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| flavor | m1.small |
| id | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 |
| security_groups | [{u'name': u'default'}] |
| user_id | 376744b5910b4b4da7d8e6cb483b06a8 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-07-16T20:14:19Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| key_name | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | myInstanceFromVolume |
| adminPass | LhwEmx5Ho22M |
| tenant_id | 66265572db174a7aa66eba661f58eb9e |
| created | 2013-07-16T20:14:18Z |
| metadata | {} |
+-------------------------------------+-------------------------------------------------+</computeroutput></screen>
<para>Now when you list volumes, you can see that the volume is
attached to a server:</para>
<screen><prompt>$</prompt> <userinput>nova volume-list</userinput></screen>
<screen><?db-font-size 65%?><computeroutput>+--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+
| ID | Status | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+
| bd7cf584-45de-44e3-bf7f-f7b50bf235e3 | in-use | my-bootable-vol | 8 | None | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 |
+--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+</computeroutput></screen>
<para>Additionally, when you list servers, you see the server
that you booted from a volume:</para>
<screen><prompt>$</prompt> <userinput>nova list</userinput></screen>
<screen><?db-font-size 65%?><computeroutput>+--------------------------------------+----------------------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
| b3cdc6c0-85a7-4904-ae85-71918f734048 | myCirrosServer | ACTIVE | None | Running | private=10.0.0.3 |
| 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None | Running | private=10.0.0.4 |
+--------------------------------------+----------------------+--------+------------+-------------+------------------+</computeroutput></screen>
</step>
</procedure>
</section>