wiki:OpenStackGlance
Last modified 20 months ago Last modified on 02/07/16 19:14:38

Glance

Glance is the VM image repository for OpenStack. Any VM you want to run in OpenStack needs to be added to the image repository for launching first.

Note: The stock JumpStart deploy of OpenStack includes Ubuntu 11.04 images. These images are fine for testing but it's preferable to have the latest stable images so we can easily install the OpenStack client tools for nova, glance, ceph and generally keep things on a more up-to-date footing.

CentOS Images

  1. Download your resource file if it's not already on the server from http://os.uabgrid.uab.edu by clicking Settings -> OpenStack Credentials -> Download RC File
  2. Copy it to the your openstack instance (i.e. a machine that access the glance service)
  3. Source the file and supply your password
  4. Upload the image (source is http://cloud.centos.org/centos/7/images/ )
    • Upload the image
      1. Old version of Glance
        user@host:~$ glance add name="CentOS 7 x86_64 1503 raw" is_public=true container_format=bare disk_format=qcow2 < CentOS-7-x86_64-GenericCloud-1503.qcow2
        Uploading image 'CentOS 7 x86_64 1503 qcow2'
        ========================================================================================================================================================[100%] 98.0M/s, ETA  0h  0m  0s
        Added new image with ID: 1fe3ab02-16a2-4bca-b813-3411f20a09c5
        
        
        user@host:~$ glance index
        ID                                   Name                           Disk Format          Container Format     Size          
        ------------------------------------ ------------------------------ -------------------- -------------------- --------------
        1fe3ab02-16a2-4bca-b813-3411f20a09c5 CentOS 7 x86_64 1503 raw       raw                  bare                     8589934592
        
        
      2. Newer version of Glance (Liberty ?). I installed this via PiP (pip install --user python-openstackclient) and it doesn't support --is-public True, so not sure how you make the image public
        $ glance image-create \
          --name centos-7.2-x86_64-1511-qcow2 \
          --disk-format qcow2 \
          --container-format bare \
          --file ~/Downloads/CentOS-7-x86_64-GenericCloud-1511.qcow2 \
          --progress
        
        WARNING: The client is falling back to v1 because the accessing to v2 failed. This behavior will be removed in future versions
        
        [=============================>] 100%
        
        +------------------+--------------------------------------+
        | Property         | Value                                |
        +------------------+--------------------------------------+
        | checksum         | 117c6e62493f09ed2ba86043953dca20     |
        | container_format | bare                                 |
        | created_at       | 2016-02-08T00:47:20                  |
        | deleted          | False                                |
        | deleted_at       | None                                 |
        | disk_format      | qcow2                                |
        | id               | 6d805fac-e02b-4130-b294-a1a2c00341f5 |
        | is_public        | False                                |
        | min_disk         | 0                                    |
        | min_ram          | 0                                    |
        | name             | centos-7.2-x86_64-1511-qcow2         |
        | owner            | d2412b8f82384514adf1ea4c2ee7d8c8     |
        | protected        | False                                |
        | size             | 899874816                            |
        | status           | active                               |
        | updated_at       | 2016-02-08T00:47:25                  |
        +------------------+--------------------------------------+
        
        
        $ glance image-list | grep centos-7.2
        
        WARNING: The client is falling back to v1 because the accessing to v2 failed. This behavior will be removed in future versions
        | 6d805fac-e02b-4130-b294-a1a2c00341f5 | centos-7.2-x86_64-1511-qcow2                               | qcow2       | bare             | 899874816   | active |
        
        

Ubuntu Images

Ubuntu maintains a set of cloud images which can be easily launched into Amazon's cloud with a click of a button. Fortunately, we can add these same images to our Glance repo and use them locally.

The basic process when using a client that has the nova tools installed and able to communicate with our OpenStack fabric:

  • Source the environment file for your tenant space
  • Download the desired Ubuntu cloud image (AMI disk1 image)
  • Add the image to the glance index

Ubuntu 14.04

Initialize the OpenStack tenant environment:

. openrc.sh

Get the image for Ubuntu 14.04 LTS server.

mkdir images/
cd images
wget http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img

Add the image to glance:

glance add name="trusty-server-14.04-cloudimg-amd64-disk1" is_public=true container_format=bare disk_format=raw < trusty-server-cloudimg-amd64-disk1.img

Ubuntu 12.04

Initialize the OpenStack tenant environment:

. openrc.sh

Get the image for Ubuntu 12.04 LTS server.

mkdir images/
cd images
wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img

Add the image to glance:

glance add name="ubuntu-12.04.2-lts-ami" is_public=true container_format=ami disk_format=raw < precise-server-cloudimg-amd64-disk1.img 

Work around for 12.04 load without Internet connection

Getting the Ubuntu 12.04 image loaded in our Glance repo was very simple but was complicated by the fact that the only working client that could load the image using the glance command was the controller node itself, and at the time that we were setting this up, the controller had no direct internet connection. This required downloading the ubuntu image to a staging area in my home dir and then transferring the image internal to our pilot fabric to the controller. (The same steps were needed for the openrc.sh file used to configure the glance client.)

The image we used was for Ubuntu 12.04 LTS server.

# on cheaha
cd iso
wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img

The image was then transferred to the controller via our gateway node (rcs-srv-02):

# on the controller
mkdir jpr-playground
cd jpr-playground/
scp jpr@172.22.1.6:iso/precise-server-cloudimg-amd64-disk1.img .

Transfer my OpenStack tenant access configuration downloaded from the OpenStack web interface:

# on the controller
scp jpr@172.22.1.6:Downloads/openrc.sh .
. openrc.sh

Then simply add the image to glance:

glance add name="ubuntu-12.04.2-lts-ami" is_public=true container_format=ami disk_format=raw < precise-server-cloudimg-amd64-disk1.img 
glance index

Preparing CentOS based systems

Creating an Image using perfSonar example

OpenStackImageCreation

Flavors

Adding new flavor

  • Login as admin and click on flavors tab: http://172.22.0.10/syspanel/flavors/
  • Click on 'Create flavor' and fill out details
    • Flavor Name: m1.grande
    • VCPUs: 2
    • Memory: 4096 MB
    • Root Disk: 30GB
    • Ephemeral Disk: 30GB