[one-users] Force VMs from specific template to deploy on single host only

Hamada, Ondrej ondrej.hamada at acision.com
Mon Dec 15 04:27:39 PST 2014

Thank you Carlos,
I’ve finally tried this out and it works as proposed. The only complication shows up when the hypervisor does not have enough resources to host all the grouped machines. However this is a little bit difficult to handle some additional scripts in a highly dynamic environment.

Are there any plans to extend the scheduler to handle this grouping requirement?


From: Carlos Martín Sánchez [mailto:cmartin at opennebula.org]
Sent: Monday, September 29, 2014 4:56 PM
To: Hamada, Ondrej
Cc: users at lists.opennebula.org
Subject: Re: [one-users] Force VMs from specific template to deploy on single host only


On Mon, Sep 29, 2014 at 2:08 PM, Hamada, Ondrej <ondrej.hamada at acision.com<mailto:ondrej.hamada at acision.com>> wrote:
I’m trying to figure out how to force the virtual machines based on one template to deploy always together on a single node. A scenario:

I have four nodes. I need to deploy five VMs related to each other. I want all the five to be deployed on the same host. Little bit later I need to deploy another set of five VMs. I want all the five of them to be deployed on a single node, but it should be different node then the preceding set of five VMs was deployed on.

Speaking in terms of available scheduler policies is combination of packing and stripping. First use the stripping – find the node with highest count of available resources and then packing – deploy the VMs on same node.

Is this even possible in OpenNebula?

What you describe cannot be done automatically in OpenNebula. You can make use of the CURRENT_VMS [1] requirement variable, but this requires some manual setup:

Let's say the IDs for group 1 are 10..14, and group 2 IDs are 15..19.

Set the SCHED_REQUIREMENTS to "CURRENT_VMS=10" for VMs 11..14, and "CURRENT_VMS=15" for 16..19.
This will make each group to be deployed in the same host.

If you also set "CURRENT_VMS != 10" for VM 15, the second group will not be deployed in the same host as the first one.

This can be done from the same template. Each time you instantiate, the second param can be a path to an extra file that will be merged with the existing Template [2].


[1] http://docs.opennebula.org/4.8/user/references/template.html#requirement-expression-syntax
[2] http://docs.opennebula.org/4.8/user/virtual_resource_management/vm_guide.html#instantiating-templates

Carlos Martín, MSc
Project Engineer
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org<http://www.opennebula.org/> | cmartin at opennebula.org<mailto:cmartin at opennebula.org> | @OpenNebula<http://twitter.com/opennebula>
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20141215/cc704931/attachment-0001.htm>

More information about the Users mailing list