cc_staff
1,486
edits
(add category and parent link) |
No edit summary |
||
Line 4: | Line 4: | ||
This page describes how to perform common tasks encountered while working with OpenStack. It is assumed that you have already read [[Cloud Quick Start]] and understand the basic operations of launching and connecting to a VM. Most tasks can be performed using the dashboard, as described there and below. But some require use of the command line tools, for example [[#Creating an Image From a Volume|creating an image]]. See [[OpenStack Command Line Clients]] for more information. | This page describes how to perform common tasks encountered while working with OpenStack. It is assumed that you have already read [[Cloud Quick Start]] and understand the basic operations of launching and connecting to a VM. Most tasks can be performed using the dashboard, as described there and below. But some require use of the command line tools, for example [[#Creating an Image From a Volume|creating an image]]. See [[OpenStack Command Line Clients]] for more information. | ||
==Working with Volumes | =Security Groups= | ||
=Working with Volumes= | |||
A '''volume''' provides storage which is not destroyed when a VM is terminated. On the Compute Canada cloud resources, volumes use [https://en.wikipedia.org/wiki/Ceph_(software) Ceph] storage with a 3-fold replication factor to provide safety against hardware failure. More documentation about OpenStack volumes can be found [http://docs.openstack.org/user-guide/common/cli_manage_volumes.html here]. | A '''volume''' provides storage which is not destroyed when a VM is terminated. On the Compute Canada cloud resources, volumes use [https://en.wikipedia.org/wiki/Ceph_(software) Ceph] storage with a 3-fold replication factor to provide safety against hardware failure. More documentation about OpenStack volumes can be found [http://docs.openstack.org/user-guide/common/cli_manage_volumes.html here]. | ||
==Creating a Volume== | |||
[[File:OpenStack-Dashboard-Compute-Volumes.png|800px|thumb| OpenStack Dashboard, Volumes page (Click for larger image)]] | [[File:OpenStack-Dashboard-Compute-Volumes.png|800px|thumb| OpenStack Dashboard, Volumes page (Click for larger image)]] | ||
Line 23: | Line 25: | ||
Finally click the blue "Create Volume" button. | Finally click the blue "Create Volume" button. | ||
==Accessing a Volume from a VM== | |||
To access the volume you must first '''attach''' it to a running VM. This is analogous to inserting a USB key or plugging an external drive into your personal computer. You can attach a volume from the Compute->Volumes page. | To access the volume you must first '''attach''' it to a running VM. This is analogous to inserting a USB key or plugging an external drive into your personal computer. You can attach a volume from the Compute->Volumes page. | ||
* At the right-hand end of the line describing the volume will be a drop-down menu. Select "Manage Attachments" or "Edit Attachments". | * At the right-hand end of the line describing the volume will be a drop-down menu. Select "Manage Attachments" or "Edit Attachments". | ||
Line 30: | Line 32: | ||
The process should complete in a few seconds. Then the Compute->Volumes page will show the newly created volume is attached to your selected VM on <code>/dev/vdb</code> or some similar location. | The process should complete in a few seconds. Then the Compute->Volumes page will show the newly created volume is attached to your selected VM on <code>/dev/vdb</code> or some similar location. | ||
==Formatting and Mounting an Empty Volume== | |||
On most Linux distributions the following steps can be used to partition, format, and mount the newly created volume. NOTE: If this is not a newly created volume the partition and format steps should be skipped as they will result in loss of data on that volume, and only the steps to mount the volume should be followed. | On most Linux distributions the following steps can be used to partition, format, and mount the newly created volume. NOTE: If this is not a newly created volume the partition and format steps should be skipped as they will result in loss of data on that volume, and only the steps to mount the volume should be followed. | ||
Line 60: | Line 62: | ||
{{Command|sudo mount -a}} | {{Command|sudo mount -a}} | ||
==Booting From a Volume== | |||
If running a persistent machine, booting from a volume is a safer option. When creating a VM booting from an image, rather than a volume, it will store the VM on the local disk of the actual machine running the VM. If something went wrong with that machine or its disk, there is a good chance your VM would be lost. Volume storage has a built in redundancy which will protect your volumes from hardware failure. | If running a persistent machine, booting from a volume is a safer option. When creating a VM booting from an image, rather than a volume, it will store the VM on the local disk of the actual machine running the VM. If something went wrong with that machine or its disk, there is a good chance your VM would be lost. Volume storage has a built in redundancy which will protect your volumes from hardware failure. | ||
Line 69: | Line 71: | ||
If creating a volume as part of the process of launching the VM, select <code>Boot from image (creates a new volume)</code> select the image to use and the size of the volume. The default device name of <code>vda</code> should work well. If this volume is something you would like to remain longer than the VM ensure that the "Delete on Terminate" check box is unchecked. If you are unsure about this option, it is better to leave this box unchecked as you can always manually delete the volume later as an extra step. | If creating a volume as part of the process of launching the VM, select <code>Boot from image (creates a new volume)</code> select the image to use and the size of the volume. The default device name of <code>vda</code> should work well. If this volume is something you would like to remain longer than the VM ensure that the "Delete on Terminate" check box is unchecked. If you are unsure about this option, it is better to leave this box unchecked as you can always manually delete the volume later as an extra step. | ||
==Creating an Image From a Volume== | |||
Creating an image from a volume allows you to download the image either for a backup or to use in virtual box. | Creating an image from a volume allows you to download the image either for a backup or to use in virtual box. | ||
{{Command|openstack image create --disk-format <format> --volume <volume_name> <image_name>}} | {{Command|openstack image create --disk-format <format> --volume <volume_name> <image_name>}} | ||
where <volume_name> can be found from the OpenStack dash board by clicking on the volume name and <image_name> is the name given to the image you are creating and <format> is the disk format (two possible values are qcow2 and vmdk). See [[OpenStack Command Line Clients]] for more details about working with command line. This image can then be downloaded in the way described in [[OpenStack#Downloading an image into a local VirtualBox | Downloading an image into a local VirtualBox]] | where <volume_name> can be found from the OpenStack dash board by clicking on the volume name and <image_name> is the name given to the image you are creating and <format> is the disk format (two possible values are qcow2 and vmdk). See [[OpenStack Command Line Clients]] for more details about working with command line. This image can then be downloaded in the way described in [[OpenStack#Downloading an image into a local VirtualBox | Downloading an image into a local VirtualBox]] | ||
=Accessing a VM with Multiple Users= | |||
[[File:VM multi user cloud init.png|400px|thumb| Cloud init to add multiple users (Click for larger image)]] | [[File:VM multi user cloud init.png|400px|thumb| Cloud init to add multiple users (Click for larger image)]] | ||
Line 146: | Line 148: | ||
Then you can create a new virtual machine and attach the vmdk image to it see [http://techathlon.com/how-to-run-a-vmdk-file-in-oracle-virtualbox/] for detailed instructions on this. | Then you can create a new virtual machine and attach the vmdk image to it see [http://techathlon.com/how-to-run-a-vmdk-file-in-oracle-virtualbox/] for detailed instructions on this. | ||
[[Category:CC-Cloud]] | [[Category:CC-Cloud]] |