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.

CPU isolation check 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 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 5 Comments

  1. graliontorile

    Together with almost everything that appears to be building throughout this subject material, many of your viewpoints happen to be quite refreshing. Even so, I beg your pardon, but I can not give credence to your whole plan, all be it stimulating none the less. It would seem to me that your comments are not totally validated and in simple fact you are generally your self not even totally certain of your point. In any event I did enjoy looking at it.

  2. Koto118Dog

    Thank you for taking your time to explain all the details in this article.

  3. crorkservice

    Hello there, just became alert to your blog through Google, and found that it’s really informative. I am gonna watch out for brussels. I’ll be grateful if you continue this in future. A lot of people will be benefited from your writing. Cheers!

  4. ‏ipod nano

    I appreciate you sharing this blog article.Really thank you! Really Cool.

  5. gralion torile

    I like what you guys are up too. Such smart work and reporting! Carry on the superb works guys I have incorporated you guys to my blogroll. I think it’ll improve the value of my website 🙂

Leave a Reply