Feature #1103

Create VMs on hold

Added by Carlos Martín almost 9 years ago. Updated almost 8 years ago.

Status:ClosedStart date:02/02/2012
Priority:NormalDue date:
Assignee:Carlos Martín% Done:

0%

Category:Core & System
Target version:Release 4.0
Resolution:fixed Pull request:

Description

VMs can be put 'on hold' with the 'onevm hold' command. The scheduler ignores VMs in this state, until the VM is released.

It should be possible to create VMs directly in this hold state, either with an optional parameter in the xml-rcp api, or a template attribute.

submit-on-hold.patch Magnifier (8.82 KB) Simon Boulet, 12/20/2012 02:18 PM

Associated revisions

Revision cec1f876
Added by Carlos Martín almost 8 years ago

Feature #1103: Add xmlrpc optional param to create VMs on hold

Revision 8d8da167
Added by Carlos Martín almost 8 years ago

Feature #1103: Add hold param to ruby & java oca, and cli.

onetemplate instantiate needs to be done also

Revision 7aff914b
Added by Carlos Martín almost 8 years ago

Feature #1103: Add xmlrpc optional param to instantiate templates on hold

Revision 26e472e0
Added by Carlos Martín almost 8 years ago

Feature #1103: Add instantiate hold param to ruby & java oca, and cli.

Revision 64b4f0d5
Added by Carlos Martín almost 8 years ago

Feature #1103: Patch by Simon Boulet

Revision 40687774
Added by Carlos Martín almost 8 years ago

Feature #1103: Finish integrating the new oned.conf att. VM_SUBMIT_ON_HOLD

Revision 02208c56
Added by Ruben S. Montero almost 8 years ago

feature #1103: Always deal with boolean values from oned.conf in the same way

History

#1 Updated by Ruben S. Montero over 8 years ago

  • Target version deleted (Release 3.4)

#2 Updated by Carlos Martín almost 8 years ago

  • Assignee set to Carlos Martín
  • Target version set to Release 4.0

#3 Updated by Simon Boulet almost 8 years ago

Hi,

This patch adds a VM_SUBMIT_ON_HOLD option to oned.conf.

It allows administrators to set VM_SUBMIT_ON_HOLD = "YES" in their oned.conf to force the submission of VM on HOLD instead of PENDING.

It can be very useful for administrators that want to prevent VMs from being automatically deployed. It allows for further deployment workflow customizations by using a CREATE VM HOOK that does different validations before placing the VM PENDING for the scheduler to deploy it.

For example, if you want VMs that have an even ID to be scheduled, but keep VMs that have a odd ID on hold. You could set VM_SUBMIT_ON_HOLD = "YES" in oned.conf, and have the following CREATE VM HOOK script:

#!/bin/sh
VM_ID=$1
if [ "`expr $VM_ID % 2`" = "0" ]; then
onevm release $VM_ID
fi

Please note I have modified the VirtualMachinePool::allocate method, removing the on_hold parameter, which I found wasn't really useful. Also added a Template::get method to retrieve a bool. I found it useful instead of carrying the string value and comparing to "YES". It treats "1", "true" and "YES" attribute value as True, everything else as False. I've found several occurrence of string == "YES" around the code, perhaps they could be changed to bool.

Simon

#4 Updated by Carlos Martín almost 8 years ago

Hi,

We wanted users to be able to set it for each new VM, so we added a new param. --hold in the CLI.
This is an alternative to your approach, where all VM creations are changed, so we merged both to allow users to decide which one is best for their use case.

Thanks!

#5 Updated by Ruben S. Montero almost 8 years ago

  • Category set to Core & System
  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF