O'Reilly logo

OpenStack Cloud Computing Cookbook by Kevin Jackson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Attaching volumes to instances

Now that we have a usable volume, we can attach this to any instance. We do this by using the euca-attach-volume command from euca2ools or the nova volume-attach command in Nova Client.

Getting ready

To begin with, ensure you are logged in to the Ubuntu client that has access to euca2ools or Nova Client tools. These packages can be installed using the following command:

sudo apt-get update
sudo apt-get-y install euca2ools python-novaclient

How to do it...

Carry out the following steps to attach a volume to an instance by using euca2ools:

  1. If you have no instance running, spin one up. Once running, run the euca-describe-instances command and note the instance ID.
    # Source in our EC2 credentials
    . ec2rc
    
    euca-describe-instances ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required