After Deprec

openstack_cloud_computing_cookbook

Issue link: https://read.uberflip.com/i/1334488

Contents of this Issue

Navigation

Page 171 of 317

Chapter 8 161 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 The following output will be displayed RESERVATION r-7r0wjd2o cookbook default INSTANCE i-00000009 ami-00000002 172.16.1.1 10.0.0.3 running openstack (cookbook, openstack1) 0 m1.tiny 2011-12-11T15:33:43Z nova aki-00000001 ami-00000000 2. Using the instance ID, we can attach the volume to our running instance, as follows: euca-attach-volume -i i-00000009 -d /dev/vdb vol-00000003 3. This will output the name of the volume when successful. To view this, log in to your running instance and view the volume that is now attached: sudo fdisk -l /dev/vdb www.it-ebooks.info

Articles in this issue

Links on this page

Archives of this issue

view archives of After Deprec - openstack_cloud_computing_cookbook