I have a private cloudstack cloud with the following configuration:

host server:

  • ubuntu 14.04
  • KVM hypervisor
  • 2x 2400 MHz CPU (amd athlon 64 X2 Dual Core Processor 4600+)

virtual machines:

  • 1x 500 MHz CPU (RESTRICTED use of 500mhz only by cloudstack)
  • ubuntu 14.04

When i utilize the vm with the stress utility to 100% the cpu of the host shows a utilization of 50%. So the vm is using one full cpu core of the host.

Is this a bug of cloudstack? Maybe of KVM?


this is vm configuration generated by cloudstack:

<domain type='kvm'>
  <description>Ubuntu 14.04 (64-bit)</description>
  <memory unit='KiB'>512000</memory>
  <currentMemory unit='KiB'>512000</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <sysinfo type='smbios'>
      <entry name='manufacturer'>Apache Software Foundation</entry>
      <entry name='product'>CloudStack KVM Hypervisor</entry>
      <entry name='uuid'>0c795c99-5bab-46f8-a321-71e3e398036b</entry>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='cdrom'/>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  <clock offset='utc'>
    <timer name='kvmclock'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/mnt/a5bb6304-61f7-3d9e-9706-1f447a6a5fdb/af0c4ab6-aaad-4990-9046-da6ac83a575f'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <target dev='hdc' bus='ide'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    <interface type='bridge'>
      <mac address='06:0b:00:00:00:15'/>
      <source bridge='cloudbr0'/>
        <inbound average='25600' peak='25600'/>
        <outbound average='25600' peak='25600'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    <serial type='pty'>
      <target port='0'/>
    <console type='pty'>
      <target type='serial' port='0'/>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='' passwd='-'>
      <listen type='address' address=''/>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    <memballoon model='none'/>
  <seclabel type='none'/>


  • If a car has a top speed of 60 mph but you restrict it to 30 mph, you're still using the car 100% of the time when you're going 30 mph. Whatever speed the CPU runs at, if you're using it at that speed, you're using all of it. – David Schwartz Dec 22 '16 at 9:56

The only thing in that XML for the guest that controls CPU usage is <shares>500&;lt;/shares>. This is not doing what you might think it is doing. 'Shares' is a merely relative weighting/prioritization for the guest, wrt other processes. eg if you have 2 guests on the host and one has a shares value of '500' and one has a shares value of '100', then the first guest will get x5 the amount of CPU time as the second guest.

If you want to place absolute caps on the CPU usage, eg to say 50% of a host CPU, then you need to use the <period> and <quota> settings instead. eg period of 1000000 and quota of 500000, will restrict the each vCPU to only use 50% of a host CPU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.