Browse Source

doc: fix and clarify --block-device usage in user docs

The docs on create a volume-backed server from the command
line were wrong in a few ways:

* The openstack server create command does not currently allow
  booting from a volume where a source image is provided and
  nova creates the volume from the image and uses that volume
  as the root disk. The nova boot command supports that, so the
  docs are updated to call out the nova boot command since that
  is the appropriate command in this case (even the syntax with
  the openstack server create --block-device was wrong).

* When creating a server from a bootable volume with the OSC CLI,
  either the --volume or --block-device options should be used
  for a single volume, but not both. The docs were using both, so
  the latter is dropped and a note is added which links to the CLI
  documentation for more details on --block-device option usage.

NOTE(amodi): The conflict is due to not having 
Ifa2e2bbb4c5f51f13d1a5832bd7dbf9f690fcad7 in Pike

Change-Id: I985b870759d6c21ef9357b04f39099c02354f135
Closes-Bug: #1794827
(cherry picked from commit 16027094eb)
(cherry picked from commit 6a6d0e9434)
(cherry picked from commit c55eff39f2)
Matt Riedemann 1 year ago
committed by Archit Modi
1 changed files with 21 additions and 5 deletions
  1. +21

+ 21
- 5
doc/source/user/launch-instance-from-volume.rst View File

@@ -208,13 +208,14 @@ the volume to boot an instance.
Note the ID of the flavor that you want to use to create a volume.

#. To create a bootable volume from an image and launch an instance from
this volume, use the ``--block-device`` parameter.
this volume, use the ``--block-device`` parameter with the ``nova boot``

For example:

.. code-block:: console

$ openstack server create --flavor FLAVOR --block-device \
$ nova boot --flavor FLAVOR --block-device \
source=SOURCE,id=ID,dest=DEST,size=SIZE,shutdown=PRESERVE,bootindex=INDEX \

@@ -250,6 +251,15 @@ the volume to boot an instance.

- ``NAME``. The name for the server.

See the `nova boot`_ command documentation and :doc:`block-device-mapping`
for more details on these parameters.

.. note:: As of the Stein release, the ``openstack server create`` command
does not support creating a volume-backed server from a source image like
the ``nova boot`` command. The next steps will show how to create a
bootable volume from an image and then create a server from that boot
volume using the ``openstack server create`` command.

#. Create a bootable volume from an image. Cinder makes a volume bootable
when ``--image`` parameter is passed.

@@ -260,11 +270,14 @@ the volume to boot an instance.
#. Create a VM from previously created bootable volume. The volume is not
deleted when the instance is terminated.

.. note:: The example here uses the ``--volume`` option for simplicity. The
``--block-device`` option could also be used for more granular control
over the parameters. See the `openstack server create`_ documentation for

.. code-block:: console

$ openstack server create --flavor 2 --volume VOLUME_ID \
--block-device source=volume,id=$VOLUME_ID,dest=volume,size=10,shutdown=preserve,bootindex=0 \
$ openstack server create --flavor 2 --volume VOLUME_ID myInstanceFromVolume
| Field | Value |
@@ -313,6 +326,9 @@ the volume to boot an instance.
| b7d4-0fee2fe1da0c | | | | on /dev/vda |

.. _nova boot:
.. _openstack server create:

.. _Attach_swap_or_ephemeral_disk_to_an_instance:

Attach swap or ephemeral disk to an instance