Ironic / Bifrost

Debug

source /opt/stack/bifrost/env-vars
ironic node-show ${NODE}
 
Asynchronous exception for node 00000000-0000-0000-0000-AC1F6B0EF226:
Node failed to deploy. Exception: Failed to deploy instance: Unexpected error while running command. Command: env
ANSIBLE_CONFIG=/usr/local/lib/python2.7/dist-packages/ironic_staging_drivers/ansible/playbooks/ansible.cfg
ansible-playbook
    /opt/openstack-prepare-baremetal/ironic-staging-driver-ansible/playbooks/deploy_node.yaml
    -i /usr/local/lib/python2.7/dist-packages/ironic_staging_drivers/ansible/playbooks/inventory -e {
"ironic": {"nodes": [{"ip": "10.11.12.13", "extra": {
        "prov_ip": null, "root_disk": "/dev/sda"}, "user": "ansible", "name": "00000000-0000-0000-0000-AC1F6B0EF226"}], "image": {"mem_req": 407, "validate_certs": "yes", "url": "http://10.33.33.40:8080/httpboot/img-bionic-minimal.tgz", "checksum": "md5:a50dc06157e4c7dd773389e4717323d5", "disk_format": "tgz", "source": "http://10.33.33.40:8080/httpboot/img-bionic-minimal.tgz", "type": "whole-disk-image"}, "configdrive": {"type": "url", "location": "http://10.11.12.40:8080/configdrive-00000000-0000-0000-0000-AC1F6B0EF226.iso.gz"}}} --skip-tags=wait
 
# cat /usr/local/lib/python2.7/dist-packages/ironic_staging_drivers/ansible/playbooks/ansible.cfg
[ssh_connection]
retries=1000

Log

/var/log/ansible.log

Delete node

ironic node-set-provision-state ${NODE} deleted
ironic node-set-maintenance ${NODE} on
ironic node-delete ${NODE}

https://docs.openstack.org/tripleo-docs/latest/install/advanced_deployment/node_states.html

Rebuild Bifrost PXE boot image

mkdir /tmp/ansible_ubuntu
cd /tmp/ansible_ubuntu
xzcat /httpboot/ansible_ubuntu.initramfs | cpio -idmv
# apply changes
mv /httpboot/ansible_ubuntu.initramfs /httpboot/ansible_ubuntu.initramfs.$(date -I)
find ./ | cpio -H newc -o | xz -9 --format=lzma >  /httpboot/ansible_ubuntu.initramfs

Rebuild / Change image

cd /tmp/img-bionic-minimal
tar czf /httpboot/img-bionic-minimal.tgz .

Links
https://www.mirantis.com/blog/automate-bare-metal-server-provisioning-using-ironic-bifrost-and-the-ansible-deploy-driver/
http://dtantsur.github.io/talks/fosdem2016/
https://docs.openstack.org/bifrost/latest/install/index.html
https://specs.openstack.org/openstack/tripleo-specs/specs/pike/tripleo-routed-networks-ironic-inspector.html