Managing your cloud resources with OpenStack: Difference between revisions

Added section about detaching volumes
No edit summary
(Added section about detaching volumes)
Line 120: Line 120:
Cloning is the recommended method for copying volumes. While it is possible to make an image of an existing volume and use it to create a new volume, cloning is much faster and requires less movement of data behind the scenes. This method is handy if you have a persistent VM and you want to test out something before doing it on your production site. It is highly recommended to shutdown your VM before creating a clone of the volume as the newly created volume may be left in an inconsistent state if there was writing to the source volume during the time the clone was created. To create a clone you must use the [[OpenStack Command Line Clients|command line client]] with this command
Cloning is the recommended method for copying volumes. While it is possible to make an image of an existing volume and use it to create a new volume, cloning is much faster and requires less movement of data behind the scenes. This method is handy if you have a persistent VM and you want to test out something before doing it on your production site. It is highly recommended to shutdown your VM before creating a clone of the volume as the newly created volume may be left in an inconsistent state if there was writing to the source volume during the time the clone was created. To create a clone you must use the [[OpenStack Command Line Clients|command line client]] with this command
{{Command|openstack volume create --source <source-volume-id> --size <size-of-new-volume> <name-of-new-volume>}}
{{Command|openstack volume create --source <source-volume-id> --size <size-of-new-volume> <name-of-new-volume>}}
==Detaching a Volume==
If an attached volume is the boot volume for the VM (e.g. attached to <code>/dev/vda</code>) the VM must be deleted in order to detach the volume. If on the other hand, the volume has been attached to the VM as an additional volume (e.g. attached to <code>/dev/vdb</code>, <code>/dev/vdc</code>, etc.) it can be detached by going to "Project"->"Volumes"->"Volumes" and then finding the row for the particular volume you wish to detach and going to the drop down box at the far right under the "Actions" column and selecting "Manage Attachements". On the new "Manage Volume Attachements" screen which appears, the instance the volume is attached to will be listed, next to wich will be a "Detach Volume" button. Click this button to detach the volume, it will ask you to confirm you want to detach this volume by clicking the "Detach Volume" button on a second screen that appears. If you try this proceedure on a boot volume you will get an error message saying "Unable to detach volume".


=Working with images= <!--T:42-->
=Working with images= <!--T:42-->
cc_staff
1,486

edits