mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-25 06:03:36 +03:00
Feature #1103: Finish integrating the new oned.conf att. VM_SUBMIT_ON_HOLD
This commit is contained in:
parent
85678cbba8
commit
406877743e
@ -109,7 +109,6 @@ public:
|
|||||||
Template::get(_name,value);
|
Template::get(_name,value);
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -38,6 +38,9 @@
|
|||||||
# VMID
|
# VMID
|
||||||
#
|
#
|
||||||
# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
|
# 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
|
#MANAGER_TIMER = 30
|
||||||
@ -68,6 +71,8 @@ VNC_BASE_PORT = 5900
|
|||||||
|
|
||||||
DEBUG_LEVEL = 3
|
DEBUG_LEVEL = 3
|
||||||
|
|
||||||
|
#VM_SUBMIT_ON_HOLD = "NO"
|
||||||
|
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
# Physical Networks configuration
|
# Physical Networks configuration
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
|
@ -98,6 +98,7 @@ void OpenNebulaTemplate::set_conf_default()
|
|||||||
# DB
|
# DB
|
||||||
# VNC_BASE_PORT
|
# VNC_BASE_PORT
|
||||||
# SCRIPTS_REMOTE_DIR
|
# SCRIPTS_REMOTE_DIR
|
||||||
|
# VM_SUBMIT_ON_HOLD
|
||||||
#*******************************************************************************
|
#*******************************************************************************
|
||||||
*/
|
*/
|
||||||
// MONITOR_INTERVAL
|
// MONITOR_INTERVAL
|
||||||
@ -167,6 +168,12 @@ void OpenNebulaTemplate::set_conf_default()
|
|||||||
attribute = new SingleAttribute("SCRIPTS_REMOTE_DIR",value);
|
attribute = new SingleAttribute("SCRIPTS_REMOTE_DIR",value);
|
||||||
conf_default.insert(make_pair(attribute->name(),attribute));
|
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
|
# Physical Networks configuration
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdio>
|
#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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( sval == "1" || sval == "true" || sval == "YES" ) {
|
TO_UPPER(sval);
|
||||||
|
|
||||||
|
if ( sval == "YES" )
|
||||||
|
{
|
||||||
value = true;
|
value = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -235,7 +235,7 @@ int VirtualMachinePool::allocate (
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
vm = new VirtualMachine(-1, uid, gid, uname, gname, vm_template);
|
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;
|
vm->state = VirtualMachine::HOLD;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user