After Deprec

openstack_cloud_computing_cookbook

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

Contents of this Issue

Navigation

Page 174 of 317

Nova Volumes 164 Detaching volumes from an instance As Nova Volumes are persistent storage and the best way of thinking of them is as a USB drive, this means you can only attach them to a single computer at a time. When you remove it from the computer, you can then move it to another one and attach it. The same principle works with Nova Volumes. To detach a volume, we use another euca2ools aptly named euca-detach-volume, or from Nova Client, the option volume-detach. 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 detach a volume by using euca2ools: 1. First, we identify the volumes attached to running instances, by running the command euca-describe-volumes, as follows: euca-describe-volumes 2. This brings back the following output: VOLUME vol-00000003 5 nova in-use 2012-07-06T11:09:23.000Z ATTACHMENT vol-00000003 i-00000009 /dev/vdb attached | VOLUME vol-00000004 5 nova in-use 2012-07-06T11:20:50.000Z ATTACHMENT vol-00000004 i-00000009 /dev/vdc attached 3. In a shell on the running instance that has the volume mounted, we must first unmount the volume as follows: sudo umount /mnt 4. Back on the Ubuntu client where euca2ools is installed, we can now detach this volume, as follows: euca-detach-volume -i i-00000009 vol-00000003 5. We are now free to attach this to another running instance, with data preserved. 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