cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amir Nashat <Amir.Nas...@citrix.com>
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
correct?

Thanks for your feedback!

Amir



-----Original Message-----
From: Prachi Damle [mailto:Prachi.Damle@citrix.com] 
Sent: Wednesday, August 08, 2012 2:12 PM
To: cloudstack-users@incubator.apache.org
Subject: RE: CloudStack Allocator Pre-Condition Check

 Amir,

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
allocator.

Thanks,
Prachi


-----Original Message-----
From: Amir Nashat [mailto:Amir.Nashat@citrix.com] 
Sent: Wednesday, August 08, 2012 1:58 PM
To: cloudstack-users@incubator.apache.org
Subject: CloudStack Allocator Pre-Condition Check

Hello,

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
condition.

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
approach.


Thank you,

Amir

Mime
View raw message