Attaching the block storage to an instance
The virtual storage device we just created is not much good to us unless it is attached to an instance that can make use of it. Luckily for us, we just launched an OpenStack instance and logged in to it. Perform the following steps to attach the block storage to an instance:
To show the attachment, start by connecting to the instance and listing the existing block devices on the instance that is running:
instance# ls /dev/vd* /dev/vda /dev/vda1
The boot device for this instance is
vda
; this is the Glance image that was used to boot.Now attach the volume you just created to the instance you have running. When you list the devices on the instance again, you will see the Cinder volume show up as
vdb
:undercloud# openstack server add volume "My First Instance" my_volume instance# ls /dev/vd* /dev/vda /dev/vda1 /dev/vdb
The Cinder volume was attached as
vdb
to the instance. Now that we have a new block device on the instance, we treat it just as we...