openstack-manuals/doc/common/section_nova_boot_from_volume.xml
Diane Fleming 64b6c9261e Folder rename, file rename, flattening of directories
Current folder name	New folder name	        Book title
----------------------------------------------------------
basic-install 	        DELETE
cli-guide	        DELETE
common	                common
NEW	                admin-guide-cloud	Cloud Administrators Guide
docbkx-example	        DELETE
openstack-block-storage-admin 	DELETE
openstack-compute-admin 	DELETE
openstack-config 	config-reference	OpenStack Configuration Reference
openstack-ha 	        high-availability-guide	OpenStack High Availabilty Guide
openstack-image	        image-guide	OpenStack Virtual Machine Image Guide
openstack-install 	install-guide	OpenStack Installation Guide
openstack-network-connectivity-admin 	admin-guide-network 	OpenStack Networking Administration Guide
openstack-object-storage-admin 	DELETE
openstack-security 	security-guide	OpenStack Security Guide
openstack-training 	training-guide	OpenStack Training Guide
openstack-user 	        user-guide	OpenStack End User Guide
openstack-user-admin 	user-guide-admin	OpenStack Admin User Guide
glossary	        NEW        	OpenStack Glossary

bug: #1220407

Change-Id: Id5ffc774b966ba7b9a591743a877aa10ab3094c7
author: diane fleming
2013-09-08 15:15:50 -07:00

187 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 wordsize="20">Launch an instance from a volume</title>
<para>After you <link xlink:href="#create_volume_from_image">create
a bootable volume</link>, you <link
xlink:href="#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>
<!-- Commenting out because the OpenStack Config Reference is not available yet -->
<!--<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>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>