Wednesday, December 21, 2016

OpenStack Day 3 - Creating the Boot Images

Today I had intended to create boot images and to get the nodes registered and introspected. Sadly my old friend IPMI had other plans. That's a story I'll share in the next posting because it really deserves it's own spotlight.

This will be an easy one.

So when your Overcloud machines boot up they will PXE boot from the Undercloud director. In order for that to happen we need to make sure these boot images are available and this was not done as part of the undercloud deployment.

The TripleO documentation recommends having the latest images and specifically that images for previous OpenStack releases may not function properly. You can download these images from  http://buildlogs.centos.org/centos/7/cloud/x86_64/tripleo_images/newton/delorean/ or you can build them yourself. TripleO docs say "It's recommended to build images on the installed undercloud directly since all the dependencies are already present.". English is a slippery language. Does this mean "If your going to build them, building them on the undercloud is recommended" or does it mean "Building your own is recommended and when you do it you should do it on the undercloud"?

For me this is at least partially a learning exercise and building them seems like it will be interesting. The only real options are: "include Ceph?" and "Whole Disk Images?"  I'll be using Ceph so that part is pretty easy. Whole Disk Images ( http://tripleo.org/advanced_deployment/whole_disk_images.html) I don't have an opinion on yet so for now I'm going to skip that.

A couple of notes before we get to it:

NOTE#1: Your undercloud machine requires at least 10G of RAM (preferably 16) before it will use tmpfs for building these images. If you don't have that it'll use the physical drives and that will probably take longer. Maybe lots longer.
NOTE#2: The TripleO documentation for the image build command includes two '--config-file' options. That doesn't appear to be an option with the version of newton I'm using so I just left those out and went with '--all'. Maybe good. Maybe bad.

export OS_YAML="/usr/share/openstack-tripleo-common/image-yaml/overcloud-images-centos7.yaml"
STABLE_RELEASE="newton"
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
export DIB_YUM_REPO_CONF="$DIB_YUM_REPO_CONF /etc/yum.repos.d/CentOS-Ceph-Jewel.repo"
openstack overcloud image build --all
openstack overcloud image upload

Time passes... and finally:

"Successfully build all request images"

In undercloud.conf I had the image directory as the default "." so it dumped the images in ~stack.

drwxrwxr-x. 3 stack stack 26 Dec 19 19:09 ironic-python-agent.d
-rw-rw-r--. 1 stack stack 354615883 Dec 19 19:11 ironic-python-agent.initramfs
-rwxr-xr-x. 2 stack stack 5393328 Dec 19 19:11 ironic-python-agent.vmlinuz
-rwxr-xr-x. 2 stack stack 5393328 Dec 19 19:11 ironic-python-agent.kernel
-rw-rw-r--. 1 stack stack 544162 Dec 19 19:11 dib-agent-ramdisk.log
drwxrwxr-x. 3 stack stack 26 Dec 19 19:49 overcloud-full.d
-rwxr-xr-x. 1 root root 5393328 Dec 19 19:49 overcloud-full.vmlinuz
-rw-r--r--. 1 root root 43240180 Dec 19 19:49 overcloud-full.initrd
-rw-r--r--. 1 stack stack 1222114816 Dec 19 19:57 overcloud-full.qcow2
-rw-rw-r--. 1 stack stack 2657590 Dec 19 19:57 dib-overcloud-full.log

and a couple of files in /httpboot
$ ls -al /httpboot/

total 351584
drwxr-xr-x.  2 ironic           ironic                  66 Dec 20 14:23 .
dr-xr-xr-x. 20 root             root                  4096 Dec 20 17:36 ..
-rwxr-xr-x.  1 root             root               5393328 Dec 20 14:23 agent.kernel
-rw-r--r--.  1 root             root             354615883 Dec 20 14:23 agent.ramdisk
-rw-r--r--.  1 ironic-inspector ironic-inspector       456 Dec 19 15:17 inspector.ipxe

Next step is to upload the images.

$ . ~/stackrc && openstack overcloud image upload
Image "overcloud-full-vmlinuz" was uploaded.
+--------------------------------------+------------------------+-------------+---------+--------+
| ID | Name | Disk Format | Size | Status |
+--------------------------------------+------------------------+-------------+---------+--------+
| 53dc9ea9-0909-4b68-b042-b3385d0ae186 | overcloud-full-vmlinuz | aki | 5393328 | active |
+--------------------------------------+------------------------+-------------+---------+--------+
Image "overcloud-full-initrd" was uploaded.
+--------------------------------------+-----------------------+-------------+----------+--------+
| ID | Name | Disk Format | Size | Status |
+--------------------------------------+-----------------------+-------------+----------+--------+
| f7e18615-5b27-4d08-973f-81af3be8dc22 | overcloud-full-initrd | ari | 43240180 | active |
+--------------------------------------+-----------------------+-------------+----------+--------+
Image "overcloud-full" was uploaded.
+--------------------------------------+----------------+-------------+------------+--------+
| ID | Name | Disk Format | Size | Status |
+--------------------------------------+----------------+-------------+------------+--------+
| 16681e9d-348d-4af0-97e4-0fe6a8ae89f6 | overcloud-full | qcow2 | 1222114816 | active |
+--------------------------------------+----------------+-------------+------------+--------+
Image "bm-deploy-kernel" was uploaded.
+--------------------------------------+------------------+-------------+---------+--------+
| ID | Name | Disk Format | Size | Status |
+--------------------------------------+------------------+-------------+---------+--------+
| bac48742-2159-470a-b813-19b5ba43936a | bm-deploy-kernel | aki | 5393328 | active |
+--------------------------------------+------------------+-------------+---------+--------+
Image "bm-deploy-ramdisk" was uploaded.
+--------------------------------------+-------------------+-------------+-----------+--------+
| ID | Name | Disk Format | Size | Status |
+--------------------------------------+-------------------+-------------+-----------+--------+
| d3588fa2-1826-4975-9768-bcd674ed0958 | bm-deploy-ramdisk | ari | 354615883 | active |
+--------------------------------------+-------------------+-------------+-----------+--------+

$ openstack image list
+--------------------------------------+------------------------+--------+
| ID                                   | Name                   | Status |
+--------------------------------------+------------------------+--------+
| d3588fa2-1826-4975-9768-bcd674ed0958 | bm-deploy-ramdisk      | active |
| bac48742-2159-470a-b813-19b5ba43936a | bm-deploy-kernel       | active |
| 16681e9d-348d-4af0-97e4-0fe6a8ae89f6 | overcloud-full         | active |
| f7e18615-5b27-4d08-973f-81af3be8dc22 | overcloud-full-initrd  | active |
| 53dc9ea9-0909-4b68-b042-b3385d0ae186 | overcloud-full-vmlinuz | active |
+--------------------------------------+------------------------+--------+

And with that we are good to go on the image front.

Next up.. the heartbreak of trying to use old hardware and how IPMI doesn't love it.

No comments:

Post a Comment