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:
Start by listing the existing block devices on the instance that was started:
instance# ls /dev/vd* /dev/vda /dev/vda1
The boot device for this instance is
vda
.Now use Nova to 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
:control# nova volume-attach instance_name {volume-id} instance# ls /dev/vd* /dev/vda /dev/vda1 /dev/vdb
Now that we have a new block device on the instance, we treat it just as we would any other block device. Make a partition, create a file system, mount it, and read and write to it. The output from the following commands will be truncated...