Managing your cloud resources with OpenStack: Difference between revisions

Jump to navigation Jump to search
style editing continued
(style editing, first two sections)
(style editing continued)
Line 1: Line 1:
OpenStack is the software suite used on the Compute Canada Cloud to control hardware resources such as computers, storage and networking. It allows the creation and management of virtual machines ("VMs", or "instances"), which act like separate individual machines, by emulation in software. This allows users complete control over their computing environment, from choosing an operating system to software installation and configuration. Diverse use cases are supported, from hosting websites to creating virtual clusters. See official documentation at [http://docs.openstack.org/ http://docs.openstack.org/] for more details about OpenStack.
OpenStack is the software suite used on the Compute Canada Cloud to control hardware resources such as computers, storage and networking. It allows the creation and management of virtual machines ("VMs", or "instances"), which act like separate individual machines, by emulation in software. This allows users complete control over their computing environment, from choosing an operating system to software installation and configuration. Diverse use cases are supported, from hosting websites to creating virtual clusters. See official documentation at [http://docs.openstack.org/ http://docs.openstack.org/] for more details about OpenStack.


This page describes how to perform common tasks encountered while working with OpenStack.
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.


==Working with Volumes==
==Working with Volumes==
A '''volume''' provides storage which is not destroyed when a VM is terminated. On the Compute Canada clouds volumes use [https://en.wikipedia.org/wiki/Ceph_(software) Ceph] storage with a 3X 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===
===Creating a Volume===
Line 16: Line 16:
*Description:<br/>Optional text describing the volume
*Description:<br/>Optional text describing the volume
*Type: <br/>
*Type: <br/>
*Size (GB): <code>50</code><br/>
*Size (GB): <code>40</code>, or some suitable size<br/>
*Volume Source: <code>No source, empty volume</code><br/>
*Volume Source: <code>No source, empty volume</code><br/>
*Availability Zone: <code>Any Availability Zone</code><br/>
*Availability Zone: <code>Any Availability Zone</code><br/>
Line 23: Line 23:


===Accessing a Volume from a VM===
===Accessing a Volume from a VM===
To access the volume from a VM you must '''attach''' it. This is done by clicking the "More" drop down and selecting "Edit Attachments" and in the "Attach to Instance" drop down box select the VM you wish to attach it to and click the blue "Attach Volume" button. Once the volume is attached, it will show you on the Compute->Volumes dashboard that the newly created volume <code>data</code> is attached to your selected VM on <code>/dev/vdb</code> or some similar location. This is exactly the same as if you had inserted a USB key or an external drive.
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. To attach a volume,
* click the "More" drop down on the Volumes and Snapshots page,
* select "Edit Attachments",
* in the "Attach to Instance" drop down box select a VM,
* then click the blue "Attach Volume" button.  
The process should complete in a few seconds. Then the Compute->Volumes dashboard will show that 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===
===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 this will result in loss of data on that volume, unless this is what you want, 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.


<ol>
<ol>
<li>create a partition on the volume with <code>sudo fdisk /dev/vdb</code><br/>
<li>Create a partition on the volume with
The below shows the sequence of characters to enter to create a new partition on your volume.</li>
{{Command|sudo fdisk /dev/vdb}}<br/>
<code>fdisk</code> will prompt you to enter a command. Use this sequence of single-character commands to create a new partition on your volume.</li>


  n => new partition
  n => new partition
Line 39: Line 45:
  w => write partition table to disk and exit
  w => write partition table to disk and exit


<li> format the newly created partition with</li>
<li>Format the newly created partition with  
{{Command|sudo mkfs -t ext4 /dev/vdb1}}
{{Command|sudo mkfs -t ext4 /dev/vdb1}}
<li>Create a place to mount the device with</li>
<li>Create a place to mount the device with  
{{Command| sudo mkdir /media/data}}
{{Command|sudo mkdir /media/data}}
<li>Finally the volume can be mounted with</li>
<li>Finally, mount the volume with  
{{Command| sudo mount /dev/vdb1 /media/data}}
{{Command|sudo mount /dev/vdb1 /media/data}}
</ol>
</ol>


However, if the VM is rebooted for some reason the volume will need to be remounted. To cause the VM to mount the device during boot edit <code>/etc/fstab</code> to add new volume with a line like
If the VM is rebooted for some reason the volume will need to be remounted. To cause the VM to mount the volume automatically at boot time, edit <code>/etc/fstab</code> to add a new volume with a line like


  /dev/vdb1 /media/data ext4 defaults 0 2
  /dev/vdb1 /media/data ext4 defaults 0 2


Then to mount the device just added to <code>/etc/fstab</code> run
Then to mount the device just added to <code>/etc/fstab</code>, run  
{{Command| sudo mount -a}}
{{Command|sudo mount -a}}


===Booting From a Volume===
===Booting From a Volume===
Bureaucrats, cc_docs_admin, cc_staff
2,915

edits

Navigation menu