Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
h2. Introduction


h3. Purpose

To provide some additional infrastructure statistics i.e., number of hosts/ CPU sockets managed by cloudstack which reflects the size of the cloud.



h3. Scope

Scope of this document is to provide a functional specification for the Report CPU sockets implementation for 4.3 release.



h3. References

Proposal: [http://mail-archives.apache.org/mod_mbox/cloudstack-dev/201310.mbox/%3CFF3AF618-A5C8-4F36-8F3A-C8280A154287@citrix.com%3E]
Jira ticket: [https://issues.apache.org/jira/browse/CLOUDSTACK-4908]





h2. Feature Specifications

Cloudstack manages different types of hosts that contains one or more physical cpu sockets.

We can list the number of hosts that are managed by CS using listHosts API. We introduce a new parameter value called "cpusockets" that holds the number cpu sockets of particular host where ever we can retrieve (otherwise we mark it as NULL).

Upon listing hosts we can count the number of cpu sockets for all hosts.


*Xenserver*:

\- In Xenserver version 6.2 there is xapi call "host-cpu-info" in which we can get the "socket-count" per each host.

\- In earlier versions of Xenserver 6.2 there is no such call so we do not counting cpu sockets for those hypervisors.

*VMWare*:

\- vim25 provides data object "HostHardwareSummary" in which we can get the cpu socket count from the parameter, *numCpuPkgs - "*Number of physical CPU packages on the host. Physical CPU packages are chips   that contain one or more processors. Processors contained by a package are   also known as CPU cores. For example, one dual-core package is comprised of   one chip that contains two CPU cores.*"\*

*KVM*:

\- Using Virsh command "nodeinfo" number of cpu sockets can be retrieved.

h2. Database

We introduce a new column named "cpu_scokets" in the table "host" which holds the number of cpu sockets for the hypervisors.

*New Column: Table "host"*


*cpu_sockets* int(10) unsigned DEFAULT NULL

h2. {color:#000000}API Changes{color}


h3. {color:#000000}Changes to existing APIs{color}

We will introduce
1) new parameter in listhost API call named "hypervisortype"
2) new parameter in listhost response named "cpusockets"

[http://localhost:8080/client/api?command=listHosts&hypervisortype=xenserver&sessionkey=uMjdI0ko3GbIkvPk3GLSnn7zNTY%3D&page=1&pageSize=20&type=routing&listAll=true&_=1382505530956|http://localhost:8080/client/api?command=listHosts&hypervisortype=xenserver&sessionkey=uMjdI0ko3GbIkvPk3GLSnn7zNTY%3D&page=1&pageSize=20&type=routing&listAll=true&_=1382505530956]


{ "listhostsresponse" : { "count":1 ,"host" : \[

{"id":"e3764714-d4c6-45ae-a20a-347ec21ae7e9",
 "name":"xenserver-kxbhjemt","state":"Up","disconnected":"2013-10-23T10:43:44+0530","type":"Routing","ipaddress":"10.147.28.61","zoneid":"687ba836-b694-43a2-a9a4-f29192c76b1d","zonename":"zone1","podid":"9ca3373b-693b-4509-93aa-935416037c2d","podname":"pod1","version":"4.2.1-SNAPSHOT","hypervisor":"XenServer",",

...

*"cpusockets":1,*"cpunumber":4,"cpuspeed":3093,"cpuallocated":"0%","cpuused":"0.05%","cpuwithoverprovisioning":"12372.0","networkkbsread":4544,"networkkbswrite":14745,"memorytotal":7907453568,"memoryallocated":1342177280,"memoryused":2327940,"capabilities":"xen-3.0-x86_64  , xen-3.0-x86_32p , hvm-3.0-x86_32 , hvm-3.0-x86_32p ,  hvm-3.0-x86_64","lastpinged":"1970-01-16T20:31:42+0530","managementserverid":1,"clusterid":"fad3a193-fa14-4999-bf30-e8088801118f","clustername":"xen","clustertype":"CloudManaged","islocalstorageactive":false,"created":"2013-10-22T17:20:18+0530","events":"Ping;  ManagementServerDown; AgentConnected; AgentDisconnected;  ShutdownRequested; StartAgentRebalance; HostDown; Remove;  PingTimeout","resourcestate":"Enabled","hypervisorversion":"6.1.0","hahost":false}

...

\] } }

h2. {color:#000000}UI changes{color}

From UI it looks like

===========================================================
Hypervisor	\| Hosts	        \| Sockets
===========================================================
VMware	        \| 20		\| 45
\---------------------------------------------\-
XenServer	\| 50		\| 70
\---------------------------------------------\-
KVM		\| 15		\| 35
\---------------------------------------------\-
Hyper-V	        \| 30		\| unknown

===========================================================

Some minimal calculations are required from the listHost response.
1) Call listHosts API with filter "hypervisortype" (say xenserver)
2) take the count of number of hosts
3) In the response we need to take sum of all the values of parameter  "cpusockets". If cpusockets are not mentioned for particular hypervisor  type we leave the value as unknown.

This we need to for all hypervisor types.