cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@soleks.com
Subject VM provisioning with minor CPU speed spoofing
Date Wed, 13 Mar 2013 06:52:27 GMT
Hi All,
Today i got the following problem. I have servers with 4x2Ghz CPUs, so it was reasonable for
me to create computational offers like 1x2GHz, 2x2GHz etc. But i failed to deploy VMs using
that offers. The reason was - actual cpu frequency is 1995 Mhz, so allocator didn't pass test.
To resolve issue i rounder CPU speed to 100Mhz. Here is modified HostOV.getSpeed() method:

@Override
public Long getSpeed() {
// return speed;
//
// Round CPU speed to 100 Mhz
//
if (speed != null)
  long lspeed = speed.longValue();
  return new Long ((lspeed/100 + (lspeed%100 >= 50 ? 1: 0))*100);
}
  return speed;
}



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message