I'm interested in this idea as well. Without modifying the ONE code
here is how it could be accomplished by extending the IM MAD and using
the "REQUIREMENTS" section of a VM template to exclude a host that is
already running a guest of the same type.
How to go about it is the somewhat kludgey part. The IM MAD scripts are
run on the host; as far as I can tell from the host it is impossible to
easily see the names of the guests running on it. The best idea I could
think of would be to ssh back to the FE and run "onevm list | grep
$HOST" and process that.
Next, how do you group the guests? Assuming the guests have the naming
scheme of <type>NNN you could group them by removing the NNN. Another
way to do it would be to do a onevm show on each guest but that may be
too resource intensive.
Putting this all together, here is the IM MAD script:
#!/bin/sh
VM_HOST=`hostname`
FE=onefe
GUEST_TYPES="`ssh $FE onevm list --list NAME,HOST | grep $VM_HOST | awk
'{ print $1 }' | sed 's/[0-9]*$//g' | sort -u`"
GUEST_TYPES=":`echo $GUEST_TYPES | sed 's/ /:/g'`:"
echo "GUEST_TYPES=\"$GUEST_TYPES\""
For example type "ntp" you'd put in the template
REQUIREMENTS = "GUEST_TYPES != \"*:ntp:*\""
(I haven't tested this at all).
On 12/11/2012 10:47 AM, Gary S. Cuozzo wrote:
Hello,
We have certain vm's which are related and provide redundancy and/or
failover to each other. Ideally, we'd like to avoid the situation
where these vm's run on the same host machine. Is there a way to
configure the scheduler so it would know to rule out a host if another
related vm was already running there?
If there is no feature in ONE already, what I'm thinking is having an
attribute that can be set in the vm template which could be used to
group vm's together. Then, the scheduler can just check to see if a
vm that is part of the same group(s) is already running and rule that
host out if there is. It could also optionally override the attribute
if it could not find a 'unique' host to deploy on (for example,
multiple hosts are unavailable and there are not enough resource to
deploy to unique hosts).
Please let me know if a feature already exists or if my idea is worth
pursuing.
Cheers,
gary
_______________________________________________
Users mailing list
[email protected]
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
--
Mark Wagner | [email protected]
System Administrator | Intelius Inc.
_______________________________________________
Users mailing list
[email protected]
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org