You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by da...@soleks.com on 2013/03/13 07:52:27 UTC
VM provisioning with minor CPU speed spoofing
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.
Re: VM provisioning with minor CPU speed spoofing
Posted by Chip Childers <ch...@sungard.com>.
On Tue, Mar 12, 2013 at 11:52:27PM -0700, dan@soleks.com wrote:
> 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.
Anyone have a comment on this suggested patch?