Add one use case for configdrive

Change-Id: I14fd9fc2f00e7b70c512e4ff9b272a11c2f82271
This commit is contained in:
Lin Tan 2016-05-31 11:16:23 +08:00
parent db9d497505
commit 07ebb5a20f

View File

@ -2198,6 +2198,11 @@ Enabling the configuration drive (configdrive)
Starting with the Kilo release, the Bare Metal service supports exposing
a configuration drive image to the instances.
Configuration drive can store metadata and attaches to the instance when it
boots. One use case for using the configuration drive is to expose a
networking configuration when you do not use DHCP to assign IP addresses to
instances.
The configuration drive is usually used in conjunction with the Compute
service, but the Bare Metal service also offers a standalone way of using it.
The following sections will describe both methods.
@ -2206,10 +2211,14 @@ The following sections will describe both methods.
When used with Compute service
------------------------------
To enable the configuration drive when deploying an instance, pass
``--config-drive true`` parameter to the ``nova boot`` command, for example::
To enable the configuration drive and passes user customized script when deploying an
instance, pass ``--config-drive true`` parameter and ``--user-data`` to the
``nova boot`` command, for example::
nova boot --config-drive true --flavor baremetal --image test-image instance-1
nova boot --config-drive true --flavor baremetal --image test-image --user-data ./my-script instance-1
Then ``my-script`` is accessible from the configuration drive and could be
performed automatically by cloud-init if it is integrated with the instance image.
It's also possible to enable the configuration drive automatically on
all instances by configuring the ``OpenStack Compute service`` to always