What is CPU isolation in OpenStack?

Dear friends today we will see what is CPU isolation in OpenStack? and how it will work? So lets start and see step by step CPU isolation in OpenStack.

CPU isolation (or CPU affinity) is a way to force the system scheduler to only use some of the logical CPU cores for a particular process. If isolation is not utilized the system will try to balance the work and use all cores for all the processes. For more details about CPU isolation you can Click-Here

How CPU isolation work?

CPU isolation simply means isolating one of CPU from any process to be get loaded. If you have a embedded system/board which has multiple processors.

For example:- we are taking quad processor system where each core has 4 CPU/processor unit in it. Considering a generic scheduler algorithm, It is never defined like which process should be loaded on which processor/CPU. Every process can run on any processor until the specific process is pinned to the particular CPU. When any one processor is isolated, it means no other process or interrupt will be scheduled for that processor/CPU.

How to check CPU isolation in Linux operating system?

To check CPU isolation in our operating system we can use below commands.

cat /sys/devices/system/cpu/isolated
[root@overcloud-ovscompute-6 ~]# cat /sys/devices/system/cpu/isolated

[root@overcloud-ovscompute-6 ~]#

You can see here we didn’t find any output that means CPU is isolation is not done in this host.

Metadata set in flavor

If you want to launch a CPU dedicated VM, then you have to set your flavor metadata with hw:cpu_policy=dedicated. Like below: –

CPU isolation

In order to launch a CPU thread isolated VM, you can set your flavor metadata with below option.

hw:cpu_policy=dedicated, and hw:cpu_thread_policy=isolate

[stack@undercloud (overcloudrc) ~]$ openstack flavor show d7d31cd0-6ebc-4d30-aef7-3d4504dcc163
+----------------------------+------------------------------------------------------------------------------+
| Field                      | Value                                                                        |
+----------------------------+------------------------------------------------------------------------------+
| OS-FLV-DISABLED:disabled   | False                                                                        |
| OS-FLV-EXT-DATA:ephemeral  | 0                                                                            |
| access_project_ids         | b9c4a3a8ae3148379cfce69011790a3c                                             |
| disk                       | 16                                                                           |
| id                         | d7d31cd0-6ebc-4d30-aef7-3d4504dcc163                                         |
| name                       | 2_8_16                                                                 |
| os-flavor-access:is_public | False                                                                        |
| properties                 | hw:cpu_policy='dedicated', hw:cpu_thread_policy='isolate', performance='high' |
| ram                        | 8192                                                                         |
| rxtx_factor                | 1.0                                                                          |
| swap                       | 1024                                                                         |
| vcpus                      | 2                                                                            |
+----------------------------+------------------------------------------------------------------------------+
[stack@undercloud (overcloudrc) ~]$

That’s all, in this tutorial we have learned what is CPU-isolation, How to check it in Linux operating system, and how we can set flavor metadata for CPU isolation. if you want to change hugepages in Openstack you can click on below link.

How to change hugepages in Openstack compute nodes

This Post Has 2 Comments

  1. graliontorile

    Good day very nice website!! Guy .. Excellent .. Amazing .. I will bookmark your blog and take the feeds also‚ĶI’m glad to find a lot of helpful info right here within the submit, we want develop extra techniques in this regard, thank you for sharing.

  2. zoritoler imol

    I dugg some of you post as I cogitated they were very useful very useful

Leave a Reply