OpenStack Ironic: Manual Node Tagging and Mapping

RedHat-Openstack-Logo

Some of the OpenStack director guides that I have seen and read suggest using ACH Tools to perform role matching, which matches Ironic nodes to the most appropriate roles (flavors) bases on their CPU, Memory, and Disk configurations.

However if you prefer to manually assign a role to a node follow the steps outlined below.

Creating Flavors

Before we can manually assign a role to a flavor, we must first create the flavor. In this example we are going to create 4 flavors.

First lets create the flavor that will be used for our OpenStack Overcloud Controllers.

# openstack flavor create –id auto –ram 8192 –disk 26 –vcpus 4 control
+—————————-+————————————–+
| Field | Value |
+—————————-+————————————–+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 26 |
| id | 4007f8a4-6ea9-400e-9142-6926f0538b29 |
| name | control |
| os-flavor-access:is_public | True |
| ram | 8192 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 4 |
+—————————-+————————————–+

Now lets create the flavor that will be used for our OpenStack Overcloud Compute Nodes.

# openstack flavor create –id auto –ram 6144 –disk 18 –vcpus 2 compute
+—————————-+————————————–+
| Field | Value |
+—————————-+————————————–+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 18 |
| id | 60d05417-d2ba-4f62-a37c-1bafbfaec30a |
| name | compute |
| os-flavor-access:is_public | True |
| ram | 6144 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+—————————-+————————————–+

Since our POC deployment will also include CEPH nodes, we need to also create a CEPH role.

# openstack flavor create –id auto –ram 4096 –disk 18 –vcpus 2 ceph
+—————————-+————————————–+
| Field | Value |
+—————————-+————————————–+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 18 |
| id | 5480e8e6-f895-4870-b4dc-e5fff5a32911 |
| name | ceph |
| os-flavor-access:is_public | True |
| ram | 4096 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+—————————-+————————————–+

Important Note: You need to have a baremetal role created otherwise your deployment will fail, use the command below to create it.

# openstack flavor create –id auto –ram 8192 –disk 58 –vcpus 4 baremetal

Now let’s check our work with the command below. You should see your 4 roles listed (Baremetal, Ceph, Control, and Compute).

#openstack flavor list

Manual Node Tagging

Now that we have created our flavors we need to map our Ironic nodes to these flavors. As stated previosly, we are going to do this manually instead of using ACH.

First we grab the UUIDs of our controllers and map them with the commands below.

#ironic node-update 03bac996-c718-4a7e-8eb1-d89d9c97ac4f add properties/capabilities=’profile:control,boot_option:local’

#ironic node-update 41ab6254-a1f6-4b22-a93f-e563c91e09a6 add properties/capabilities=’profile:control,boot_option:local’

#ironic node-update 3707f58c-a241-4274-8db5-5be9b47f6f27 add properties/capabilities=’profile:control,boot_option:local’

Now we do the same for the compute nodes

#ironic node-update 9a2e46a6-fa41-425a-b208-510d7fd8bcd4 add properties/capabilities=’profile:compute,boot_option:local’

#ironic node-update 930fd390-b768-4620-8619-ec6ff1b52cf3 add properties/capabilities=’profile:compute,boot_option:local’

Finally we do the same for our CEPH nodes.

#ironic node-update 212a910c-e865-4fcd-a3e6-7b40c2d61a83 add properties/capabilities=’profile:ceph,boot_option:local’

#ironic node-update 6840e184-f6e4-4310-8288-66cd030d61b9 add properties/capabilities=’profile:ceph,boot_option:local’

Confirmation of Matching

Now let’s confirm our matching with the command below.

# for i in $(ironic node-list | grep -v UUID | awk ‘{print $2;}’ \
| sed -e /^$/d); do ironic node-show $i | grep -A1 properties; echo “=======”; done;

Output below:

| properties | {u’memory_mb’: u’4096′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’2′, u’capabilities’: u’profile:ceph,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’4096′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’2′, u’capabilities’: u’profile:ceph,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’4096′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’2′, u’capabilities’: u’boot_option:local’} |
=======
| properties | {u’memory_mb’: u’6144′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’2′, u’capabilities’: u’profile:compute,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’6144′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’2′, u’capabilities’: u’profile:compute,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’8192′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’4′, u’capabilities’: u’profile:control,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’8192′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’4′, u’capabilities’: u’profile:control,boot_option:local’} |
=======
| properties | {u’memory_mb’: u’8192′, u’cpu_arch’: u’x86_64′, u’local_gb’: u’1′, |
| | u’cpus’: u’4′, u’capabilities’: u’profile:control,boot_option:local’} |
=======

Mapping Ironic Profiles to Flavors

Before we can begin an Overcloud deployment we must run through this final step. Here we will map the Ironic profiles to the flavors that we created.

Here we are mapping the Ironic profile for control, to the control flavor.

# openstack flavor set –property “cpu_arch”=”x86_64” \
> –property “capabilities:boot_option”=”local” \
> –property “capabilities:profile”=”control” control

Here we are mapping the Ironic profile for compute, to the compute flavor.

# openstack flavor set –property “cpu_arch”=”x86_64” \
> –property “capabilities:boot_option”=”local” \
> –property “capabilities:profile”=”compute” compute

Finally, we map the Ironic profile for ceph to the ceph flavor.

# openstack flavor set –property “cpu_arch”=”x86_64” \
> –property “capabilities:boot_option”=”local” \
> –property “capabilities:profile”=”ceph” ceph

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.