SCHED_REQUIREMENTS only work when restricted to oneadmin group


We have now 2 clusters (100 and 102) with nearly the same capabilities except a Lizardfs datastore.

We have older templates/images in a shared qcow2 datastore, usable on both clusters but I would like to restrict some of these template to the old cluster for now.

I added SCHED_REQUIREMENTS=CLUSTER_ID=\"100\"" to a template but this parameter completely disappear in the running VM and the scheduling is not impacted.

I made a test by uncommenting the SCHED_REQUIREMENTS in /etc/one/oned.conf and this time the scheduling is properly impacted and I found the attribute in onevm show -x ID | grep SCHED_REQUIREMENTS.

Our templates are generated by a jenkins user which is not oneadmin.

Is there a way to fulfill the following conditions:

  • SCHED_REQUIREMENTS can be set by a non oneadmin user
  • SCHED_REQUIREMENTS modify the scheduling policy

Versions of the related components and OS (frontend, hypervisors, VMs):

OpenNebula 5.8.1

Steps to reproduce:

In a dual host environment, with one noted as disabled

  1. Define a template with SCHED_REQUIREMENTS to select the disabled host
  2. Start the VM as a normal user

Current results:

  • The VM is scheduled on the enabled host.
  • There is no SCHED_REQUIREMENTS in the output of onevm show

Expected results:

  • The VM should no be scheduled because the selected host is disabled
  • The SCHED_REQUIREMENTS attribute should be in the output of onevm show

Hello @DaD

I have made a quick test and it’s working for me. So I have a template owned by a user that belongs to users group, then I added the sched requirement, finally I instantiated it and everything works fine:


This is the resulting VM.

Also, take in account that if the host is disabled, the scheduler is not going to deploy any VM on that host, take a look to this link.