Update boot from volume

Partial-Bug: #1215081

Change-Id: I4972144f9f8dbc1d110a7d0be5a85ba189419b03
author: diane fleming
This commit is contained in:
Diane Fleming 2013-10-15 22:06:14 -05:00 committed by Andreas Jaeger
parent af0042836e
commit 04d2015aec

View File

@ -4,53 +4,69 @@
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="boot_from_volume"> xml:id="boot_from_volume">
<title>Launch an instance from a volume</title> <title>Launch an instance from a volume</title>
<para>After you <link linkend="create_volume_from_image">create <para>After you create a bootable volume, you can launch an instance
a bootable volume</link>, you <link from that volume.</para>
linkend="launch_image_from_volume">launch an instance from <para>Optionally, to configure your volume, see the <link
the volume</link>.</para> xlink:href="http://docs.openstack.org/trunk/config-reference/content/config_overview.html"
><citetitle>OpenStack Configuration
Reference</citetitle></link>.</para>
<procedure xml:id="create_volume_from_image"> <procedure xml:id="create_volume_from_image">
<title>To launch and instance from a volume</title> <title>To launch an instance from a volume</title>
<step><para>To choose an image to create a bootable volume from, run the
following command to list images:</para>
<screen><prompt>$</prompt> <userinput>nova image-list</userinput>
<computeroutput>+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| e0b7734d-2331-42a3-b19e-067adc0da17d | cirros-0.3.1-x86_64-uec | ACTIVE | |
| 75bf193b-237b-435e-8712-896c51484de9 | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | |
| 19eee81c-f972-44e1-a952-1dceee148c47 | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+</computeroutput></screen></step>
<step> <step>
<para>To create a bootable volume from an image, run the <para>To create a bootable volume from an image, include the
following command: image ID in the command:</para>
<screen><prompt>#</prompt> <userinput>cinder create --image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \ <screen><prompt>#</prompt> <userinput>cinder create --image-id e0b7734d-2331-42a3-b19e-067adc0da17d --display-name my-boot-vol 8</userinput>
--display-name my-bootable-vol 8</userinput></screen> <computeroutput>+---------------------+--------------------------------------+
</para> | Property | Value |
<note> +---------------------+--------------------------------------+
<para>You can also use the <command>nova</command> | attachments | [] |
<option>volume-create</option> command to complete the same | availability_zone | nova |
action: | bootable | false |
<screen><prompt>#</prompt> <userinput>nova volume-create \ | created_at | 2013-10-16T01:27:48.645390 |
--image-id 397e713c-b95b-4186-ad46-6126863ea0a9 \ | display_description | None |
--display-name my-bootable-vol 8</userinput></screen></para> | display_name | my-boot-vol |
</note> | id | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 |
<para>Optionally, to configure your volume, see the | image_id | e0b7734d-2331-42a3-b19e-067adc0da17d |
<citetitle>Configuring Image Service and Storage for | metadata | {} |
Compute</citetitle> chapter in the <citetitle>OpenStack | size | 8 |
Configuration Reference</citetitle>.</para> | snapshot_id | None |
| source_volid | None |
| status | creating |
| volume_type | None |
+---------------------+--------------------------------------+</computeroutput></screen>
<para>Before the volume builds, its <literal>bootable</literal>
state is <literal>false</literal>.</para>
</step> </step>
<step> <step>
<para>To list volumes, run the following command:</para> <para>To list volumes, run the following command:</para>
<screen><prompt>$</prompt> <userinput>nova volume-list</userinput></screen> <screen><prompt>$</prompt> <userinput>cinder list</userinput>
<screen><?db-font-size 55%?><computeroutput>+--------------------------------------+-----------+-----------------+------+-------------+-------------+ <computeroutput>+--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Attached to | | ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+-----------------+------+-------------+-------------+ +--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+
| bd7cf584-45de-44e3-bf7f-f7b50bf235e3 | available | my-bootable-vol | 8 | None | | | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 | available | my-boot-vol | 8 | None | true | |
+--------------------------------------+-----------+-----------------+------+-------------+-------------+</computeroutput></screen> +--------------------------------------+-----------+-----------------+------+-------------+----------+-------------+</computeroutput></screen>
<para>Copy the value in the <literal>ID</literal> field for your <para>Note that the <literal>bootable</literal> state is now
volume.</para> <literal>true</literal>. Copy the value in the
<literal>ID</literal> field for your volume.</para>
</step> </step>
<step xml:id="launch_image_from_volume"> <step xml:id="launch_image_from_volume">
<para>To launch an instance, run the <command>nova</command> <para>To launch an instance, include the
<option>boot</option> command with the <parameter>--block_device_mapping</parameter>
<parameter>--block_device_mapping</parameter> parameter, as parameter:</para>
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>
<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> <para>The command arguments are:</para>
<informaltable> <informaltable>
<col width="30%"/> <thead><tr><th>Parameter</th><th>Description</th></tr></thead>
<col width="70%"/>
<tbody> <tbody>
<tr> <tr>
<td> <td>
@ -132,56 +148,48 @@
<para>You can also attach a swap disk on boot with the <parameter>--swap</parameter> <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> 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 <para>For example, you might enter the following command to boot
from a volume with ID bd7cf584-45de-44e3-bf7f-f7b50bf235e. The from a volume. The volume is not deleted when the instance is
volume is not deleted when the instance is terminated:</para> 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><prompt>$</prompt> <userinput>nova boot --flavor 2 --image e0b7734d-2331-42a3-b19e-067adc0da17d \
<screen><?db-font-size 65%?><computeroutput>+-------------------------------------+-------------------------------------------------+ --block_device_mapping vda=3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46:::0 myInstanceFromVolume</userinput>
| Property | Value | <computeroutput>+-------------------------------------+--------------------------------------+
+-------------------------------------+-------------------------------------------------+ | Property | Value |
| OS-EXT-STS:task_state | scheduling | +-------------------------------------+--------------------------------------+
| image | cirros-0.3.1-x86_64-uec | | OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building | | image | cirros-0.3.1-x86_64-uec |
| OS-EXT-SRV-ATTR:instance_name | instance-00000003 | | OS-EXT-STS:vm_state | building |
| flavor | m1.small | | OS-EXT-SRV-ATTR:instance_name | instance-00000003 |
| id | 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | | flavor | m1.small |
| security_groups | [{u'name': u'default'}] | | id | 8ed8b0f9-70de-4662-a16c-0b51ce7b17b4 |
| user_id | 376744b5910b4b4da7d8e6cb483b06a8 | | security_groups | [{u'name': u'default'}] |
| OS-DCF:diskConfig | MANUAL | | user_id | 352b37f5c89144d4ad0534139266d51f |
| accessIPv4 | | | OS-DCF:diskConfig | MANUAL |
| accessIPv6 | | | accessIPv4 | |
| progress | 0 | | accessIPv6 | |
| OS-EXT-STS:power_state | 0 | | progress | 0 |
| OS-EXT-AZ:availability_zone | nova | | OS-EXT-STS:power_state | 0 |
| config_drive | | | OS-EXT-AZ:availability_zone | nova |
| status | BUILD | | config_drive | |
| updated | 2013-07-16T20:14:19Z | | status | BUILD |
| hostId | | | updated | 2013-10-16T01:43:26Z |
| OS-EXT-SRV-ATTR:host | None | | hostId | |
| key_name | None | | OS-EXT-SRV-ATTR:host | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None | | key_name | None |
| name | myInstanceFromVolume | | OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| adminPass | LhwEmx5Ho22M | | name | myInstanceFromVolume |
| tenant_id | 66265572db174a7aa66eba661f58eb9e | | adminPass | BULD33uzYwhq |
| created | 2013-07-16T20:14:18Z | | tenant_id | f7ac731cc11f40efbc03a9f9e1d1d21f |
| metadata | {} | | created | 2013-10-16T01:43:25Z |
+-------------------------------------+-------------------------------------------------+</computeroutput></screen> | metadata | {} |
<para>Now when you list volumes, you can see that the volume is +-------------------------------------+--------------------------------------+</computeroutput></screen>
attached to a server:</para> <para>Now when you list volumes, the volume is attached to a
<screen><prompt>$</prompt> <userinput>nova volume-list</userinput></screen> server:</para>
<screen><?db-font-size 65%?><computeroutput>+--------------------------------------+--------+-----------------+------+-------------+--------------------------------------+ <screen><prompt>$</prompt> <userinput>nova volume-list</userinput>
| ID | Status | Display Name | Size | Volume Type | Attached to | <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> | 3195a5a7-fd0d-4ac3-b919-7ba6cbe11d46 | in-use | my-boot-vol | 8 | None | 8ed8b0f9-70de-4662-a16c-0b51ce7b17b4 |
<para>Additionally, when you list servers, you see the server +--------------------------------------+-----------+-----------------+------+-------------+--------------------------------------+</computeroutput></screen>
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> </step>
</procedure> </procedure>
</section> </section>