bkr job status

Here’s a one liner for showing the status of all your beaker jobs.

for JOB in $( bkr job-list -o $( bkr whoami | jq -r '.username' )  | jq -r ".[]"   ) ; do bkr job-results $JOB | xpath -q -e "string(/job/recipeSet/recipe/@status)" ; done

Select only the Jades

Some custom jq for RegEx selection of OpenStack Ironic baremetal nodes. Our Server types show up in their names. I want to be able to build lists of only the Mt. Jade Servers, which have names that look like this:


openstack baremetal node list  --sort provision_state:asc   -c UUID -c Name -f json | jq '.[] | select(.Name | test("jade."))'

Debugging a Clean Failure in Ironic

My team is running a small OpenStack cluster with reposnsibility for providing bare metal nodes via Ironic. Currently, we have a handful of nodes that are not usable. They show up as “Cleaning failed.” I’m learning how to debug this process.

Continue reading

Querying hostnames from beaker

If you have requested a single host from beaker, the following one liner will tell the hostname for it.

bkr job-results   $( bkr job-list  -o $USER  --unfinished | jq -r  ".[]" )   | xpath -q -e string\(/job/recipeSet/recipe/roles/role/system/@value\)

This requires jq and xpath, as well as the beaker command line packages.

For me on Fedora 33 the packages are:

  • perl-XML-XPath-1.44-7.fc33.noarch
  • jq-1.6-5.fc33.x86_64
  • python3-beaker-1.10.0-9.fc33.noarch
  • beaker-redhat-0.2.1-2.fc33eng.noarch
  • beaker-common-28.2-1.fc33.noarch
  • beaker-client-28.2-1.fc33.noarch

Merging root and home filesystems

Yocto takes up a lot of space when it builds. If the /home partition is 30 GB or smaller, I am going to fill it up. The systems I get provisioned from Beaker are routinely splitting their disks between / and /home. These are both logical volumes in the same volume group. This is easy to merge.

In order to merge them I find myself performing the following steps.

umount /home/
mkdir /althome

I then modify /etc/fstab so that the /home entry is now pointing to /althome. If I have done any work in /home/ayoung (almost always) I have to copy it to the new /home partition

mount /alhome/
cp  /althome/ayoung /home/ayoung

Once the home volume has been cleared, I can reclaim the space. The following lines will vary depending on the name of the machine.

lvremove /dev/rhel_hpe-moonshot-02-c07/home
lvresize  -L   +32.48G  /dev/rhel_hpe-moonshot-02-c07/root

I am explicitly reclaiming the size of the /home volume, which in this case is 32.48 GB.

A little bit of foresight can obviously avoid this problem; properly allocate the disks according to the workload. Requesting a machine with more disk is also an option.

But sometimes we have to fix mistakes.

Note that I use the lvdisplay command to see the names of the volumes.

In order to make use of the new space, I have to resize the file system. Since it is XFS, I use the xfs_grow command. I want the full size, so I don’t need to pass a parameter.

xfs_growfs /dev/mapper/rhel_hpe--moonshot--02--c07-root