cc_staff
169
edits
(Added mention of unmounting or shutting down the VM first to ensure files aren't being accessed when the volume is detached.) |
|||
Line 122: | Line 122: | ||
==Detaching a Volume== | ==Detaching a Volume== | ||
Before detaching a volume it is important to make sure that the operating system and other programs running on your VM are not accessing files on your volume. If programs are modifying the contents of files on the volume when it is detached, the volume can be left in a corrupted state. Additionally if programs are reading files when a volume is detached it can result in unexpected behaviours of those programs. To ensure files are not being accessed the VM | Before detaching a volume it is important to make sure that the operating system and other programs running on your VM are not accessing files on your volume. If programs are modifying the contents of files on the volume when it is detached, the volume can be left in a corrupted state. Additionally if programs are reading files when a volume is detached it can result in unexpected behaviours of those programs. To ensure files are not being accessed shutdown the VM while you detach the volume. If you would prefer to avoid shutting down the VM, a successful [[Using_a_new_empty_volume_on_a_Linux_VM#Unmounting_a_device|unmounting of the device]] will also ensure that no files are being accessed before detaching the volume. | ||
To detach a volume, login to the OpenStack dashboard (see the [[Cloud|Cloud wiki page]] for a list of login links) and select the project containing the volume you wish to detach. Use the left side navigation pane to open the "Volumes" menu and select "Volumes". You will be presented with a list of all your volumes for that cloud project. Find the row for the particular volume you wish to detach and look at the "attached to" column, this will indicate where your volume is attached (if it says its attached to <code>/dev/vda</code> it is a boot volume, if it is attached to <code>/dev/vdb</code>, <code>/dev/vdc</code>, etc. it is an additional volume). If it is a boot volume you must delete the attached VM before the volume can be detached. If you try the following procedure on a boot volume before you have deleted the VM it is attached to, you will get an error message saying "Unable to detach volume". If the volume is not a boot volume you do not need to delete the VM it is attached to before proceeding. In the row for the volume you want to detach, go to the drop down box at the far right under the "Actions" column and select "Manage Attachments". On the new "Manage Volume Attachments" screen which appears, the VM the volume is attached to will be listed, next to which 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. | To detach a volume, login to the OpenStack dashboard (see the [[Cloud|Cloud wiki page]] for a list of login links) and select the project containing the volume you wish to detach. Use the left side navigation pane to open the "Volumes" menu and select "Volumes". You will be presented with a list of all your volumes for that cloud project. Find the row for the particular volume you wish to detach and look at the "attached to" column, this will indicate where your volume is attached (if it says its attached to <code>/dev/vda</code> it is a boot volume, if it is attached to <code>/dev/vdb</code>, <code>/dev/vdc</code>, etc. it is an additional volume). If it is a boot volume you must delete the attached VM before the volume can be detached. If you try the following procedure on a boot volume before you have deleted the VM it is attached to, you will get an error message saying "Unable to detach volume". If the volume is not a boot volume you do not need to delete the VM it is attached to before proceeding. In the row for the volume you want to detach, go to the drop down box at the far right under the "Actions" column and select "Manage Attachments". On the new "Manage Volume Attachments" screen which appears, the VM the volume is attached to will be listed, next to which 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. |