Booting from a Cinder volume gives a number of benefits as an OpenStack Operator. You can provide a level of resiliency to your instances, or you can enable Live-Migration of an instance where you are not counting on Libvirt to migrate the disk for you.
Ensure you are logged in to the Ubuntu host where the cinder command-line utilities are installed and source your OpenStack environment admin credentials.
To boot an instance from a volume, we first need to select an image to boot from as well as a flavor of our choice. The steps are follows:
nova image-list
The command generates the following output:
m1.tiny
:nova flavor-list
The command generates the following output:
neutron net-list
The available networks will be displayed:
nova boot
command:nova boot --flavor m1.tiny --block-device source=image,id=trusty-image,shutdown=preserve,dest=volume,size=15,bootindex=0 --key_name demokey --nic net-id=03575e772-b021-425c-bc17-5a3263247fb8 --config-drive=true CookBook_Instance
As you can see, in the final step we passed a lot of new parameters to nova boot
to tell Nova to use Cinder while booting the image. Specifically, --block-device
, along with its sub-parameters source
, id
, shutdown
, destination
, size
, and boot index
, tell Nova to boot from a specific image (source
and id
), to preserve the Cinder volume when you shutdown the instance (shutdown
), and that the destination is to be a cinder-volume of a specific size (dest
and size
).