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:

  1. 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.

  2. 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 ...

Get OpenStack Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.