Feature #1103
Create VMs on hold
Status: | Closed | Start date: | 02/02/2012 | |
---|---|---|---|---|
Priority: | Normal | Due 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.
Associated revisions
Feature #1103: Add xmlrpc optional param to create VMs on hold
Feature #1103: Add hold param to ruby & java oca, and cli.
onetemplate instantiate needs to be done also
Feature #1103: Add xmlrpc optional param to instantiate templates on hold
Feature #1103: Add instantiate hold param to ruby & java oca, and cli.
Feature #1103: Patch by Simon Boulet
Feature #1103: Finish integrating the new oned.conf att. VM_SUBMIT_ON_HOLD
feature #1103: Always deal with boolean values from oned.conf in the same way
History
#1 Updated by Ruben S. Montero over 9 years ago
- Target version deleted (
Release 3.4)
#2 Updated by Carlos Martín over 8 years ago
- Assignee set to Carlos Martín
- Target version set to Release 4.0
#3 Updated by Simon Boulet over 8 years ago
- File submit-on-hold.patch added
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 over 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 over 8 years ago
- Category set to Core & System
- Status changed from New to Closed
- Resolution set to fixed