Book Image

OpenStack Cloud Computing Cookbook

By : Cody Bunch
Book Image

OpenStack Cloud Computing Cookbook

By: Cody Bunch

Overview of this book

Table of Contents (19 chapters)
OpenStack Cloud Computing Cookbook Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Attaching volumes to an instance


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

Getting ready

To begin with, ensure you are logged in to the Ubuntu client that has access to the Nova client tools. If using the Vagrant environment that accompanies the book, you can access these tools from the controller node by running this command:

vagrant ssh controller

This recipe assumes you have created an openrc file. To create an openrc file on each node where you need it, open a text file named openrc and add the following contents:

export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=https://192.168.100.200:5000/v2.0/
export OS_KEY=/path/to/cakey.pem
export OS_CACERT=/path/to/ca.pem

These packages can be installed using the following commands:

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

How to do it...

Carry out the following steps to attach a...