Ask Your Question
1

How can I find out the total number of physical cores from an entire cloud?

asked 2016-05-10 09:22:57 -0500

Hello and thanks in advance for any guidance regarding this topic..

I am currently new to OpenStack and I was wondering if there is a way to find out all the physical cores (the total number) from an OpenStack Cloud.

I am trying out a few things and I started playing with the nova python client, since nova compute sits in one place and interacts through different api's with different hypervisors (the long tree list which it supports so far, most of the well known type 1 hypervisors, be it kvm, quemu, xen, hyperv, etc.) it knows the number of physical and also virtual CPUs of all the virtual hosts (physical servers on which one has installed a type 1 hypervisor)

I am also doing a recap for myself so I apologize if I insult anyone with the details..so nova knows about all the physical cores of all virtual nodes from a cloud, or multiple clouds if you wish (different regions, etc.) and it has to know because the scheduler based on filtering has to select the most optimal one (enough cpu cores, ram, etc) to spin a VM on top of it. I tested this with nova hypervisor stats / nova hypervisor show and it shows exactly what I need.

But the problem is, there are some virutal nodes without a hypervisor on top of them, as this is necessary for a best practice not to mix them, so there are storage nodes, etc. Well now, since it does not have a hypervisor, nova wont be able to tell me about the topology of the cpu info (cores, etc.) and I need to count those as well..

Cinder cant tell me either, since it doesn't need to know about cpus, and I dont think it cares either, since its main purpose is storage. So my question is, how can I get the number of physical cpus out of the storage nodes as well, and out of all production machines which are not going to be used for instances, from an entire cloud.

One way I thought of this was to write like a small python script which can request the system info from all those that dont have a hypervisor and put it in one place, merge that with what I get from nova and I would be done, but this doesn't actually suit me very well, so I need a better solution, one that can use the openstack projects if possible or one that can be integrated with openstack..

An example would be, I have a cloud made out of 8 virtual hosts and 2 storage nodes, each of the physical server, no matter its purpose has 4 physical cores, therefore I have 40 physical cores in my cloud, with nova I can get 32, how can I get the remaining?

Thank you in advance once again

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-06-07 03:42:38 -0500

updated 2016-06-07 03:55:59 -0500

Hello,

You can use (CLI) to get the virtual CPU cores (used/available) and other things with :

nova hypervisor-stats
openstack hypervisor stats show

or the corresponding python API calls :

from novaclient import client
nova = client.Client(...)
nova.hypervisors.statistics().to_dict()

BTW, I'm writing a python script that does this and reports it through email, it is not actually released to the world, but I'll put it on github soon, and come back here to put a pointer to it...

I came to your question because I'm searching the equivalent for persistent storage (cinder)...

If you want the "real" physical cores numbers, you may have to scale that according to /etc/nova.conf's cpu_allocation_ratio configuration variable, and maybe also check if you have CMT/SMT (hyperthreading, etc...) enabled on the physical CPUs or not...

edit flag offensive delete link more

Comments

Hello and thx for the answer,

As I aforementioned, the nova-hypervisor-stats & show does help me a a lot when it comes down to physical CPU cores of the compute nodes, you add them when you deploy your cloud setup and after that and nova can tell you a great deal about those

Marius Mucenicu gravatar imageMarius Mucenicu ( 2016-06-08 04:44:46 -0500 )edit

But what I'm trying to get is more or less the same as yourself, I would like to find a way to get all the physical CPU cores of all the machines in the cloud, that are not compute nodes (working with hypervisors), storage etc. and I'm curious whether its possible from os api or a script is needed

Marius Mucenicu gravatar imageMarius Mucenicu ( 2016-06-08 04:46:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-05-10 09:22:57 -0500

Seen: 1,542 times

Last updated: Jun 07 '16