Useful commands related to Openstack baremetal provisioning (Ironic)
CLI commands:
List nodes:
openstack baremetal node list
ironic node-list
Create node:
openstack --os-baremetal-api-version 1.9 baremetal node create --driver ipmi --name node10
Nodes operations:
export OS_CLOUD=admin_identity
export OS_BAREMETAL_API_VERSION=latest
export OS_BAREMETAL_API_VERSION=latest
openstack baremetal node show 25f88b00-1da1-45c9-9b7b-81c7ce373dce
openstack baremetal node manage cfg01-n1
openstack baremetal node provide cfg01-n1
If node is in error state:
openstack --os-baremetal-api-version 1.33 baremetal node undeploy bmt02-n2
openstack baremetal node set --driver ipmi 25f88b00-1da1-45c9-9b7b-81c7ce373dce
openstack baremetal node set --driver ipmi 25f88b00-1da1-45c9-9b7b-81c7ce373dce
Set resource_class for ironic node:
openstack baremetal node set --resource-class baremetal.small bmt01-n0
this feature available from pike (microversion 1.21)
openstack --os-baremetal-api-version 1.21 baremetal node set bmt01-n0 --resource-class baremetal.small
openstack --os-baremetal-api-version 1.33 baremetal node show bmt01-n0
Associate resource class with flavor:
nova flavor-create my-baremetal-flavor auto 384 10 1 (#RAM=384, DISK=10GB, 1 CPU)
nova flavor-key my-baremetal-flavor set resources:CUSTOM_BAREMETAL_SMALL=1
nova flavor-key my-baremetal-flavor set resources:VCPU=0
nova flavor-key my-baremetal-flavor set resources:MEMORY_MB=0
nova flavor-key my-baremetal-flavor set resources:DISK_GB=0
Show Ironic endpoints:
openstack catalog show baremetal
Show drivers:
openstack baremetal driver list
Boot:
nova boot --flavor m1.extra_tiny_test --image TestCirros-0.3.5 --nic net-id=d205e77d-e892-4bed-8fb8-7419c3e107dd nm1