date | draft | weight | title |
---|---|---|---|
2016-05-09 |
false |
11 |
Lab 11 - Glance |
Mon | Mon | Mon | Mon | Tue | Tue | Tue | Tue | Wed | Wed | Wed | Thur | Thur | Thur | Thur |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 12 | 13 | 14 |
The objective of this lab is to offer some exposure to using the Glance (Image) service. In this lab, a CirrOS image has already been downloaded and named. We will 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: http://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 http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
-
SSH to your controller and log in as root (you might use PuTTy for this)
-
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
-
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
-
Log into the Horizon dashboard as
admin
//alta3
-
Navigate to Project > Compute > Instances
-
Confirm that the VM instance admin_box is running
-
While you're here, you may launch 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). On the Instance Boot Source, there are several options, but two are interesting to us, namely Boot from image and Boot from image (create new volume). Use the second, Boot from image (create new volume). This choice will create a new volume will cause nova to order cinder to create a new volume and install the bootable image there.
-
Just a note, if you launch a VM by selecting Boot from Image (Create new Volume), you'll notice that the image type is not listed in Horizon. This is a design bug, and has been noted by the OpenStack team. Read more about it here: https://bugs.launchpad.net/nova/+bug/1317880
- That's it for this lab! Hang tight, or check out the Additional Learning / References listed below while everyone else is wrapping up
The following are a list of pages we thought might be helpful for our students to know about: