Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 2.4


Skip to end of metadata
Go to start of metadata

 

 

Background

For certain hypervisors and guest operating systems, the ability to configure cores per socket enables virtual machine users to take greater advantage of physical processing power for each machine. In particular, for ESXi 5.0 and 5.1, Windows virtual machines can be configured to run with more than one core per socket.  For example, on a physical machine, a Windows VM that will run on four physical CPUs will make use of dual cores in these physical CPUs. However, only four virtual CPUs can be used and by default these will have only 1 core each, thus restricting the processing power of the Windows virtual machine. 

See VMWare documentation on setting cores per CPU

Set Cores per Socket

In Abiquo 2.4.2, you can edit templates or virtual machines to set the cores per socket using the API only. This feature is currently only available on ESXi.

In Abiquo, you can set up to 32 cores per socket. In your hypervisor, there will be a limit, for example, 8 or 16 cores per socket, depending on the hypervisor version and license. If you edit a template, the change will apply to all virtual machines created from the template after the change is made. If you edit a virtual machine, the change will apply after the reconfigure is completed.

If you set the cores per socket, at the same time:

  • Set the total number of cores to a multiple of the cores per socket
    • Set enough cores to fill at least one socket.

if you do not set them, your request to set the cores per socket may fail with a message that the total number of cores is not divisible by the cores per socket.

GUI # CPU value

In the Abiquo GUI, # CPUs = total number of cores.

Upgrade Considerations

An extra column has been added to the Abiquo database in the VM and VM template tables to hold the value of the optional coresPerSocket attribute. However, by default this attribute is null, so this upgrade does not change the value of existing database records. If you retrieve an existing virtual machine using the API, this optional value will not be returned. However, after you add the value, it will be returned.

API Example of Set Cores per Socket

Get a virtual machine template.

curl --verbose -u admin:xabiquo http://10.60.13.33/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5 -X GET -H "accept:application/vnd.abiquo.virtualmachinetemplate+xml;version=2.4" | xmlindent -nbe

The result of the get VM template query is a virtual machine template.

 Click here to expand...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<virtualMachineTemplate>
    <link title="Others" rel="category" type="application/vnd.abiquo.category+xml" href="http://10.60.13.33:80/api/config/categories/1"/>
    <link rel="conversions" type="application/vnd.abiquo.conversions+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5/conversions"/>
    <link rel="datacenter" type="application/vnd.abiquo.datacenter+xml" href="http://10.60.13.33:80/api/admin/datacenters/1"/>
    <link rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1"/>
    <link rel="diskfile" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=diskFile"/>
    <link title="Core" rel="edit" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5"/>
    <link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://10.60.13.33:80/api/admin/enterprises/1"/>
    <link rel="ovfdocument" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=envelope"/>
    <link rel="tasks" type="application/vnd.abiquo.tasks+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5/tasks"/>
    <link rel="template" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf"/>
    <link rel="templatedefinition" href="http://rs.bcn.abiquo.com:9000/ovf/305/desc.ovf"/>
    <link rel="templatestatus" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=status"/>
    <id>5</id>
    <name>Core</name>
    <description>root : abiquo</description>
    <osType>UNRECOGNIZED</osType>
    <osVersion></osVersion>
    <path>1/rs.bcn.abiquo.com/abiport9000/ovf/305/Core.qcow2</path>
    <diskFormatType>QCOW2_SPARSE</diskFormatType>
    <diskFileSize>12976128</diskFileSize>
    <cpuRequired>1</cpuRequired>
    <ramRequired>64</ramRequired>
    <hdRequired>104857600</hdRequired>
    <shared>false</shared>
    <state>DONE</state>
    <creationDate>2013-07-24T11:08:28+02:00</creationDate>
    <creationUser>SYSTEM</creationUser>
    <chefEnabled>false</chefEnabled>
    <iconUrl>http://rs.bcn.abiquo.com:9000/public/icons/tinycore.png</iconUrl>
    <loginUser>user</loginUser>
    <loginPassword>password</loginPassword>
    <ethernetDriverType>E1000</ethernetDriverType>
    <diskControllerType>SCSI</diskControllerType>
</virtualMachineTemplate>

Edit this template to:

  • change cpuRequired=1  to cpuRequired=2  
  • add coresPerSocket=2 

The edited template contains <coresPerSocket>2</coresPerSocket>

 Click here to expand...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<virtualMachineTemplate>
    <link title="Others" rel="category" type="application/vnd.abiquo.category+xml" href="http://10.60.13.33:80/api/config/categories/1"/>
    <link rel="conversions" type="application/vnd.abiquo.conversions+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5/conversions"/>
    <link rel="datacenter" type="application/vnd.abiquo.datacenter+xml" href="http://10.60.13.33:80/api/admin/datacenters/1"/>
    <link rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1"/>
    <link rel="diskfile" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=diskFile"/>
    <link title="Core" rel="edit" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5"/>
    <link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://10.60.13.33:80/api/admin/enterprises/1"/>
    <link rel="ovfdocument" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=envelope"/>
    <link rel="tasks" type="application/vnd.abiquo.tasks+xml" href="http://10.60.13.33:80/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/5/tasks"/>
    <link rel="template" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf"/>
    <link rel="templatedefinition" href="http://rs.bcn.abiquo.com:9000/ovf/305/desc.ovf"/>
    <link rel="templatestatus" href="http://10.60.13.33:80/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F305%252Fdesc.ovf?format=status"/>
    <id>5</id>
    <name>Core</name>
    <description>root : abiquo</description>
    <osType>UNRECOGNIZED</osType>
    <osVersion></osVersion>
    <path>1/rs.bcn.abiquo.com/abiport9000/ovf/305/Core.qcow2</path>
    <diskFormatType>QCOW2_SPARSE</diskFormatType>
    <diskFileSize>12976128</diskFileSize>
    <cpuRequired>2</cpuRequired>
	<coresPerSocket>2</coresPerSocket>
    <ramRequired>64</ramRequired>
    <hdRequired>104857600</hdRequired>
    <shared>false</shared>
    <state>DONE</state>
    <creationDate>2013-07-24T11:08:28+02:00</creationDate>
    <creationUser>SYSTEM</creationUser>
    <chefEnabled>false</chefEnabled>
    <iconUrl>http://rs.bcn.abiquo.com:9000/public/icons/tinycore.png</iconUrl>
    <loginUser>user</loginUser>
    <loginPassword>password</loginPassword>
    <ethernetDriverType>E1000</ethernetDriverType>
    <diskControllerType>SCSI</diskControllerType>
</virtualMachineTemplate>

Modify the template in the repository with a put request

curl --verbose -u admin:xabiquo http://10.60.13.33/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/8 -X PUT -H "accept:application/vnd.abiquo.virtualmachinetemplate+xml;version=2.4" -H "content-type:application/vnd.abiquo.virtualmachinetemplate+xml;version=2.4" -d @vm_template.xml

The put request will modify the template and return the resulting virtual machine template.

View ESXi Hypervisor Attributes for VMs

Abiquo sets the following attributes in the ESXi API for virtual machines.

 
ESXi GUIAbiquo GUIAbiquo APi Attribute
Number of cores per socket-coresPerSocket
Total number of cores

# CPU

  • virtual machine template: cpuRequired
  • virtual machine: cpu

As you can see, in the ESX GUI, you can only edit the Number of virtual sockets or the Number of cores per socket. However, using the ESX API, you can set the Total number of cores.

The Number of virtual sockets value is computed from the Total number of cores divided by the Number of cores per socket. Hence the Total number of cores must be a multiple of the Number of cores per socket.

 


Default Values of Cores Per Socket 

By default this optional attribute is not set in templates or virtual machines. The default ratio for all hypervisors is one core per socket and this value is used if this attribute is not set. This means that one virtual CPU uses one CPU socket and one core, regardless of how many cores may be available.

Set Total Number of Cores in GUI

You can set the total number of cores in the GUI by changing the # CPU field, which is the same as the API attributes called cpu for virtual machines and cpuRequired for virtual machine templates. 

In Abiquo 2.4.2 you cannot set the coresPerSocket in the GUI. 

Set CPUs in VM Templates

You can set the number of CPUs for VM templates and Abiquo will use this value as the total number of cores for all virtual machines created from this template after the value is changed. By default, the number of cores per socket is effectively 1, so the number of virtual sockets will be equal to the total number of cores. A change to this value will be validated to check that it is a multiple of the number of cores per socket. The minimum value will be the number of cores per socket, because a virtual machine must have at least one socket.

 

Set CPUs on Virtual Machines

 

You can set the number of CPUs for virtual machines and Abiquo will reconfigure the virtual machine to use this value as the total number of cores. By default, the number of cores per socket is effectively 1, so the number of virtual sockets will be equal to the total number of cores. A change to this value will be validated to check that it is a multiple of the number of cores per socket. The minimum value will be the number of cores per socket, because a virtual machine must have at least one socket