1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

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

This commit is contained in:
Carlos Martín 2012-12-20 18:57:20 +01:00
parent 85678cbba8
commit 406877743e
5 changed files with 19 additions and 3 deletions

View File

@ -109,7 +109,6 @@ public:
Template::get(_name,value);
};
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------

View File

@ -38,6 +38,9 @@
# VMID
#
# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
#
# VM_SUBMIT_ON_HOLD: Forces VMs to be created on hold state instead of pending.
# Values: YES or NO.
#*******************************************************************************
#MANAGER_TIMER = 30
@ -68,6 +71,8 @@ VNC_BASE_PORT = 5900
DEBUG_LEVEL = 3
#VM_SUBMIT_ON_HOLD = "NO"
#*******************************************************************************
# Physical Networks configuration
#*******************************************************************************

View File

@ -98,6 +98,7 @@ void OpenNebulaTemplate::set_conf_default()
# DB
# VNC_BASE_PORT
# SCRIPTS_REMOTE_DIR
# VM_SUBMIT_ON_HOLD
#*******************************************************************************
*/
// MONITOR_INTERVAL
@ -167,6 +168,12 @@ void OpenNebulaTemplate::set_conf_default()
attribute = new SingleAttribute("SCRIPTS_REMOTE_DIR",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// VM_SUBMIT_ON_HOLD
value = "NO";
attribute = new SingleAttribute("VM_SUBMIT_ON_HOLD",value);
conf_default.insert(make_pair(attribute->name(),attribute));
/*
#*******************************************************************************
# Physical Networks configuration

View File

@ -22,6 +22,8 @@
#include <cstring>
#include <cstdio>
#define TO_UPPER(S) transform(S.begin(),S.end(),S.begin(),(int(*)(int))toupper)
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@ -487,7 +489,10 @@ bool Template::get(
return false;
}
if ( sval == "1" || sval == "true" || sval == "YES" ) {
TO_UPPER(sval);
if ( sval == "YES" )
{
value = true;
}
else

View File

@ -235,7 +235,7 @@ int VirtualMachinePool::allocate (
// ------------------------------------------------------------------------
vm = new VirtualMachine(-1, uid, gid, uname, gname, vm_template);
if (_submit_on_hold == true)
if ( _submit_on_hold == true || on_hold )
{
vm->state = VirtualMachine::HOLD;
}