User Tools

Site Tools


CHPC Cloud Resources

How can I use an OpenStack cloud?

As an OpenStack cloud end user, you can provision your own resources within the limits set by cloud administrators.

The examples in this guide show you how to perform tasks by using the following methods:

  • OpenStack dashboard: Use this web-based graphical interface, code named horizon, to view, create, and manage resources.
  • OpenStack command-line clients: Each core OpenStack project has a command-line client that you can use to run simple commands to view, create, and manage resources in a cloud and automate tasks by using scripts.

Introduction - Volumes

Openstack volumes are logical block devices that can be attached to a single instance to provide a persistent location for data storage. Unlike a virtual machine's local disk which is destroyed along with the VM, volumes are decoupled from instances so that they may be attached and reattached to different instances. This allows you to create & destroy instances as you see fit while maintaining a persistent store for data.

1. Create Volume.

From the Openstack dashboard, click Compute > Volumes > Create Volume, fill out the form by providing a meaningful name, description and size. Once this is done, click ‘Create Volume’. Your volume will be created and you can move on to the next step, ‘Attach a volume to an instance’.

2. Attach a volume to an Instance.

From the Openstack dashboard, click Compute > Volumes and then on the Actions drop down for the volume you want to attach to an Instance, click ‘Manage Attachments’.

From the Manage Volume Attachments form, select the Instance you wish to attach to and click ‘Attach Volume’. This will dynamically attach the volume as a new logical block device to your instance. Move on to the next section of identifying the block device from within your Instance.

3. Identify A volume within Instance.

SSH into your instance, su to root and run ‘lsblk’

‘vda’ is the first disk of your Instance and contains one partition ‘vda1’ which contains the operating system. Any volumes attached to your Instance will be named ‘vdb, vdc, vdd’ & etc. Identify the new disk by checking the size and comparing that to the size you created in the Openstack dashboard. Now that you have identified the logical block device from within the Instance you can move on to Formatting.

4. Formatting the Volume.

Prerequisite: Install xfsprogs

As root: On Ubuntu based systems

  apt-get install xfsprogs -y

Format using xfs

We are using xfs in this example because it is widely supported and supports extremely large volume sizes (9 exabytes)

  mkfs.xfs -f /dev/vdc

5. Mounting a Volume.

Create a directory to mount the volume (example ‘data1’), mount the volume and then verify the mount.

As root:

    "mkdir data1
     mount -t xfs /dev/vdc /data1
     df -hT /data1"

6. Re-attaching the volume to a different Instance.

a) Unmount the volume.

As root, use the command “umount” to unmount the directory data1

  umount /data1

NB Remove or comment out the line added in /etc/fstab if applicable.

b) Detach a volume.

From the Openstack dashboard, click Compute > Volumes and then on the Actions drop down for the volume you want to attach to an Instance, click ‘Manage Attachments’.

From the Manage Volume Attachments form, Click ‘Detach Volume’ for the instance you wish to detach the volume from.

7. Re-attach Volume.

Follow the steps at the beginning of this guide to attach the volume to a desired instance. DO NOT Format the volume from the new instance. Skip that step and go directly to mounting. The volume is now mounted on a different Instance and the data is preserved.

8. Extend Volume (Grow)

Volumes can also be extended in size. In order to Extend the volume it must be unmounted and detached from an Instance.

   Note: Volumes cannot have their size reduced.

Enter the new size of the volume and click Extend Volume.

Re-attach the volume to your Instance, and remount the volume from within the instance. You will need to grow the xfs filesystem before it will make the new space available.

As root:

   xfs_growfs /dev/vdc -d

For more details, visit the openstack official pages:Manage Volumes

Upload and manage images

A virtual machine image, referred to in this document simply as an image, is a single file that contains a virtual disk that has a bootable operating system installed on it. Images are used to create virtual machine instances within the cloud. For information about creating image files, see the OpenStack Virtual Machine Image Guide.

1. Upload an image

Follow this procedure to upload an image to a project:

 a) Log in to the dashboard.
 b) Select the appropriate project from the drop down menu at the top left.
 c) On the Project tab, open the Compute tab and click Images category.
 d) Click Create Image.

Then Create An Image dialog box appears

Select “Create Image”, After you have filled all the required information.

How to deploy windows on openstack

Windows Image for OpenStack: For most Linux distributions, it is possible to download a generic QCOW2 file for the purposes of running instances in a cloud environment. However, Microsoft does not provide such instances for any Cloud platform other than Azure.

Since Microsoft Windows is still a major component in many IT infrastructures, there may be a need to run Windows-based instances on OpenStack.

To upload Windows image, We suggest that you follow this tutorial for Preparing windows images before uploading to the openstack environment.

     Note: CHPC does not provide licenses, Appropriate licenses for any software run on the service by
     users must be sought and applied by the users, including any licenses that may be required to run
     instance operating systems.

Access and security for instances

  work in progess...!
/var/www/wiki/data/pages/guide/cloud.txt · Last modified: 2020/09/04 16:18 by lphukungoane