TheJulia was kind enough to update the docs for Ironic to show me how to include IPMI information when creating nodes.
To all delete the old nodes
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ; do openstack baremetal node delete $UUID; done |
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ; do openstack baremetal node delete $UUID; done
nodes definition
I removed the ipmi common data from each definition as there is a password there, and I will set that afterwards on all nodes.
{
"nodes": [
{
"ports": [
{
"address": "00:21:9b:93:d0:90"
}
],
"name": "zygarde",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.10"
}
},
{
"ports": [
{
"address": "00:21:9b:9b:c4:21"
}
],
"name": "umbreon",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.11"
}
},
{
"ports": [
{
"address": "00:21:9b:98:a3:1f"
}
],
"name": "zubat",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.12"
}
}
]
} |
{
"nodes": [
{
"ports": [
{
"address": "00:21:9b:93:d0:90"
}
],
"name": "zygarde",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.10"
}
},
{
"ports": [
{
"address": "00:21:9b:9b:c4:21"
}
],
"name": "umbreon",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.11"
}
},
{
"ports": [
{
"address": "00:21:9b:98:a3:1f"
}
],
"name": "zubat",
"driver": "ipmi",
"driver_info": {
"ipmi_address": "192.168.123.12"
}
}
]
}
Create the nodes
openstack baremetal create ./nodes.ipmi.json |
openstack baremetal create ./nodes.ipmi.json
Check that the nodes are present
$ openstack baremetal node list
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+
| 3fa4feae-0d5c-4e38-a012-29258d40651b | zygarde | None | None | enroll | False |
| 00965ad4-c972-46fa-948a-3ce87aecf5ac | umbreon | None | None | enroll | False |
| 8702ea0c-aa10-4542-9292-3b464fe72036 | zubat | None | None | enroll | False |
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+ |
$ openstack baremetal node list
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+
| 3fa4feae-0d5c-4e38-a012-29258d40651b | zygarde | None | None | enroll | False |
| 00965ad4-c972-46fa-948a-3ce87aecf5ac | umbreon | None | None | enroll | False |
| 8702ea0c-aa10-4542-9292-3b464fe72036 | zubat | None | None | enroll | False |
+--------------------------------------+---------+---------------+-------------+--------------------+-------------+
Update IPMI common data
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ;
do openstack baremetal node set $UUID --driver-info ipmi_password=`cat ~/ipmi.password` --driver-info ipmi_username=admin ;
done |
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ;
do openstack baremetal node set $UUID --driver-info ipmi_password=`cat ~/ipmi.password` --driver-info ipmi_username=admin ;
done
EDIT: I had ipmi_user before and it does not work. Needs to be ipmi_username.
Final Check
And if I look in the returned data for the definition, we see the password is not readable:
$ openstack baremetal node show zubat -f yaml | grep ipmi_password
ipmi_password: '******' |
$ openstack baremetal node show zubat -f yaml | grep ipmi_password
ipmi_password: '******'
Power On
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ; do openstack baremetal node power on $UUID ; done |
for UUID in `openstack baremetal node list -f json | jq -r '.[] | .UUID' ` ; do openstack baremetal node power on $UUID ; done
Change “on” to “off” to power off.