Skip to content

Instantly share code, notes, and snippets.

@mbruzek
Created July 6, 2018 18:48
Show Gist options
  • Save mbruzek/2e7bf57fe4d3ea43be7d3180066bffa7 to your computer and use it in GitHub Desktop.
Save mbruzek/2e7bf57fe4d3ea43be7d3180066bffa7 to your computer and use it in GitHub Desktop.
The instructions to clean OpenShift nodes between deploys
for ironic_id in $(ironic node-list | awk {'print $2'} | grep -v UUID | egrep -v '^$'); do
ironic node-set-provision-state $ironic_id manage;
done
# Check ironic node-list for managemable
for ironic_id in $(ironic node-list | awk {'print $2'} | grep -v UUID | egrep -v '^$'); do
openstack baremetal node clean $ironic_id --clean-steps '[{"interface": "deploy", "step": "erase_devices_metadata"}]';
done
# watch ironic node list until all cleaned
for ironic_id in $(ironic node-list | awk {'print $2'} | grep -v UUID | egrep -v '^$'); do
ironic node-set-provision-state $ironic_id provide;
done
# Check all available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment