cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chip Childers <chip.child...@sungard.com>
Subject Re: VM provisioning with minor CPU speed spoofing
Date Thu, 14 Mar 2013 19:53:24 GMT
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?

Mime
View raw message