clones/updates and sets up teuthology to use teuthology-lock
clones/updates ceph-cm-ansible
locks a machine of the requested type(s) (or uses hosts passed in as arguments), setting their descriptions to “Locked to capture FOG image for Jenkins build ###”
uses /usr/local/sbin/set-next-server.sh on the store01 DHCP server to set the targets to PXE boot from cobbler (rather than fog) and restarts the dhcpd
sshes to ubuntu@cobbler.front to set the right cobbler profile for the host and enable netboot
powercycles the hosts in question
while the hosts are rebooting, Uses curl and the FOG api to GET an image id or POST an image template to create the image, and then sets up fog for image capture
sleeps for 10s to allow the hosts to become inaccessible so it can..
..start polling for the sentinel file /ceph-qa-ready which is created at the very end of the process. (The cobbler install flow is documented below)
If there's an error or /ceph-qa-ready isn't present, retry for up to 2 hours. If normal completion is seen, set DHCP back to PXE-from-fog, run ansible-playbook (from teuthology, against the host) with tools/prep-fog-capture.yml, which removes some files from the prior installation:
disables network configuration, kills the /var/lib/ceph mount and removes from fstab, removes any ssh host keys, unsubscribes from RHEL, removes a katello.facts file, disables periodic dnf makecache jobs, cleans the dnf cache, stops ntp/chrony, and sets the hwclock
restarts dhcpd
waits for any in-progress fog images to complete, pauses the teuthology queue if there are any
powercycles the targets to boot into FOG and capture, and waits for FOG task completion
teuthology-lock –unlock's any locked hosts and unpauses the queue if needed