This is a blog with random OpenStack and Linux related notes so I don't forget things. If you find something inaccurate or that could be fixed, please file a bug report here.

View on GitHub

Back to home

21 June 2016

Modifying Your Overcloud Images

by Juan Antonio Osorio Robles

It has been the case several times where I have done a change in a puppet module, but I don’t want to completely rebuild the images. Well libguestfs-tools is your friend.

In this case, I’m testing some changes in puppet-tripleo that attempt to request certificates for keystone. So I have a local copy of the puppet-tripleo repository in my home directory. Note that I also have a local copy of the overcloud-full image in my home directory.

Copying files to the image is fairly simple with the help of virt-copy-in. But before this, one thing to note, is that opposed to what one would think, the puppet manifests for the overcloud (and the undercloud) are not in the directory you would expect. Usually you have your installed puppet modules in /etc/puppet/modules, but in our case, that directory only contains symlinks. So, since they are symlinks, using virt-copy-in will not work in this case. So we must know that for RDO there is the convention to put the OpenStack-related puppet modules in /usr/share/openstack-puppet/modules/. So knowing this we can finally copy our modules:

virt-copy-in -a overcloud-full.qcow2 \            # your local overcloud image
    puppet-tripleo/manifests/ \                   # your local puppet manifests
    /usr/share/openstack-puppet/modules/tripleo/  # the destination directory

To verify that this worked, we can use guestfish:

$ guestfish -a  overcloud-full.qcow2

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
><fs> mount /dev/sda /
><fs> ls /etc/puppet/modules/tripleo/manifests/
><fs> exit

This modified our local copy of the image. So now what’s left is to update the undercloud to host our modified image. We can achieve this with the following command:

openstack overcloud image upload --update-existing

This will check our local copies of the overcloud images in case there are changes to them, and upload them to the undercloud’s Glance instance if there are differences. With this done, we now are ready to deploy our changes.

tags: tripleo - openstack

Back to home