cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amir Nashat <>
Subject RE: CloudStack Allocator Pre-Condition Check
Date Wed, 08 Aug 2012 21:15:32 GMT
Hi Prachi,

So are you suggesting to set the returnUpTo value to 0?

To confirm, I can get the hostname of the guest VM from vmProfile.getHostName() ...this is

Thanks for your feedback!


-----Original Message-----
From: Prachi Damle [] 
Sent: Wednesday, August 08, 2012 2:12 PM
Subject: RE: CloudStack Allocator Pre-Condition Check


Yes to add any custom checks on top of the existing host allocation you will need to write
your HostAllocator extending the default FirstFitAllocator. Also replace the FirstFitAllocator
in componets.xml by your custom allocator.
If your condition verification fails, your allocator should return an empty list of hosts
and not an error. The deployment planner will handle the empty result returned by the host


-----Original Message-----
From: Amir Nashat [] 
Sent: Wednesday, August 08, 2012 1:58 PM
Subject: CloudStack Allocator Pre-Condition Check


I would like to get feedback as to the best approach for performing a pre-condition check
before allocating a guest vm to a physical host. For my example, a pre-condition check is
to verify the guest vm does not use an existing DNS entry. If the pre-condition fails we do
not want to allocate the guest vm to the physical host and we want to record this as an error

As far as I can tell the only option I have is to extend the default FirstFitAllocator class
and override the allocateTo methods to first perform my pre-condition verification and if
it passes then to call the the overridden allocateTo() method. If it fails then I would throw
a RuntimeException of some sort or possibly set the returnUpTo value equal to 0.

Can you please advise as what would be the best approach? If anyone else is performing pre-conditions
checks in their allocation logic before provisioning a guest VM please let me know of your

Thank you,


View raw message