Ask Your Question
1

API call to obtain 'cpu_allocation_ratio'

asked 2015-03-04 10:02:32 -0600

mmaurizi gravatar image

Are there any API call to obtain 'cpu_allocation_ratio' for an hypervisor?

Thanks and regards

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-12 16:05:15 -0600

updated 2015-03-12 16:08:19 -0600

Yes i think you are looking for the 'nova hypervisor-show $computenodeid' command for hypervisor information, but i believe the cpu allocation ratio is defined in your nova.conf file. You can run these commands with the --debug option to show the REST API call 'GET v2/{tenant_id}/os-hypervisors' Nova API can fetch some hypervisor information like hypervisor host and list of servers hosted by the hypervisor. I am not aware of API that could satisfy the rest of your requirements.

Hypervisors (os-hypervisors)

Display extra statistical information from the machine that hosts the hypervisor through the API for the hypervisor (XenAPI or KVM/libvirt). http://developer.openstack.org/api-re...

[root@node-1 ~]# grep cpu_allocation_ratio /etc/nova/nova.conf 
#cpu_allocation_ratio=16.0
cpu_allocation_ratio=8.0

[root@node-1 ~]# nova help | grep hyp
    hypervisor-list             List hypervisors.
    hypervisor-servers          List servers belonging to specific
                                hypervisors.
    hypervisor-show             Display the details of the specified
                                hypervisor.
    hypervisor-stats            Get hypervisor statistics over all compute
    hypervisor-uptime           Display the uptime of the specified
[root@node-1 ~]# nova hypervisor-list
+----+---------------------+
| ID | Hypervisor hostname |
+----+---------------------+
| 3  | node-5.domain.tld   |
| 6  | node-4.domain.tld   |
| 7  | node-6.domain.tld   |
+----+---------------------+
[root@node-1 ~]# nova hypervisor-stats
+----------------------+-------+
| Property             | Value |
+----------------------+-------+
| count                | 3     |
| current_workload     | 0     |
| disk_available_least | 138   |
| free_disk_gb         | 138   |
| free_ram_mb          | 3606  |
| local_gb             | 139   |
| local_gb_used        | 1     |
| memory_mb            | 5654  |
| memory_mb_used       | 2048  |
| running_vms          | 1     |
| vcpus                | 3     |
| vcpus_used           | 1     |
+----------------------+-------+
[root@node-1 ~]# nova hypervisor-show 3
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property                  | Value                                                                                                                                                                                                                                       |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cpu_info_arch             | x86_64                                                                                                                                                                                                                                      |
| cpu_info_features         | ["pge", "clflush", "sep", "syscall", "vme", "tsc", "cmov", "fpu", "pat", "monitor", "lm", "msr", "nx", "fxsr", "pae", "mmx", "cx8", "mce", "de", "mca", "pse", "pni", "apic", "sse", "lahf_lm", "rdtscp", "sse2", "ssse3", "pse36", "mtrr"] |
| cpu_info_model            | core2duo                                                                                                                                                                                                                                    |
| cpu_info_topology_cores   | 1                                                                                                                                                                                                                                           |
| cpu_info_topology_sockets | 1                                                                                                                                                                                                                                           |
| cpu_info_topology_threads | 1                                                                                                                                                                                                                                           |
| cpu_info_vendor           | Intel                                                                                                                                                                                                                                       |
| current_workload          | 0                                                                                                                                                                                                                                           |
| disk_available_least      | 51                                                                                                                                                                                                                                          |
| free_disk_gb              | 51                                                                                                                                                                                                                                          |
| free_ram_mb               | 1388                                                                                                                                                                                                                                        |
| host_ip                   | 10.20.0.7                                                                                                                                                                                                                                   |
| hypervisor_hostname       | node-5.domain.tld                                                                                                                                                                                                                           |
| hypervisor_type           | QEMU                                                                                                                                                                                                                                        |
| hypervisor_version        | 2000000                                                                                                                                                                                                                                     |
| id                        | 3                                                                                                                                                                                                                                           |
| local_gb                  | 51                                                                                                                                                                                                                                          |
| local_gb_used             | 0                                                                                                                                                                                                                                           |
| memory_mb                 | 1900                                                                                                                                                                                                                                        |
| memory_mb_used            | 512                                                                                                                                                                                                                                         |
| running_vms               | 0                                                                                                                                                                                                                                           |
| service_host              | node-5.domain.tld                                                                                                                                                                                                                           |
| service_id                | 30                                                                                                                                                                                                                                          |
| vcpus                     | 1                                                                                                                                                                                                                                           |
| vcpus_used                | 0                                                                                                                                                                                                                                           |
+---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
edit flag offensive delete link more

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: 2015-03-04 10:02:32 -0600

Seen: 1,422 times

Last updated: Mar 12 '15