Skip to content

Latest commit

 

History

History
60 lines (33 loc) · 2.81 KB

10.md

File metadata and controls

60 lines (33 loc) · 2.81 KB

+++ date = "2015-09-30" draft = false weight = 10 title = "Lab 10 - Glance" +++

Lab Duration: 20 minutes

Lab Objective

The objective of this lab is to offer some exposure to using the Glance (Image) service. In this lab, we'll download a CirrOS image, give it a name it, then launch an instance with it.

We keep talking about CirrOS. If it hasn't been explained already, CirrOS is a minimal (CirrOS < 15Mb) Linux distro that was designed for testing cloud instances (such as those on an OpenStack compute node). Take a minute, and check out all of the CirrOS downloads available by navigating to: https://download.cirros-cloud.net/.

Be aware that if your deployment is using QEMU or KVM, OpenStack recommends that you use images using the qcow2 format. The most recent 64-bit qcow2 image is available at https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

1. Creating a new image with glance at the CLI

  1. SSH to your controller and log in as root (you might use PuTTy for this)

  2. Once logged into the controller, issue the following command:

    [root@controller ~]# source keystonerc_admin

    [root@controller ~(keystone_admin)]# glance image-list

    [root@controller ~(keystone_admin)]# glance help image-create

    • The location option is important to note. It does not copy the entire image into the Image service, but references an original location where the image can be found. Upon launching an instance of that image, the Image service accesses the image from the location specified.

    [root@controller ~(keystone_admin)]# glance image-create --name cirros_alpha --disk-format qcow2 --container-format bare --is-public true --location https://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

    [root@controller ~(keystone_admin)]# glance image-list

  3. Launch an instance from the command line with the new instance cirros_alpha:

    [root@controller ~(keystone_admin)]# neutron net-list

    • Highlight the id of the private network

    [root@controller ~(keystone_admin)]# nova boot --flavor custom.shrimpy --image cirros_alpha --nic net-id=<private_network_id> admin_box

  4. Log into the Horizon dashboard as admin // alta3

  5. Navigate to Project > Compute > Instances

  • Confirm that the VM instance admin_box is running

  • While you're here, see if you can start another VM with Horizon. Call it what ever you'd like, but be sure to launch it with the new image we created (cirros_alpha).

  1. That's it for this lab! Hang tight, or check out the Additional Learning / References listed below while everyone else is wrapping up

Additional Learning / References

The following are a list of pages we thought might be helpful for our students to know about: