mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-16 17:53:08 +09:00
feature #189: Added VNC_BASE_PORT to the configuration file, and PORT generation
This commit is contained in:
1 parent
28e9d41ab1
commit
ec6b21ef9d
3 files changed
+24
-3
No files matched your search
@@ -15,6 +15,9 @@
|
||||
#
|
||||
# PORT: Port where oned will listen for xmlrpc calls.
|
||||
#
|
||||
# VNC_BASE_PORT: VNC ports for VMs can be automatically set to VNC_BASE_PORT +
|
||||
# VMID
|
||||
#
|
||||
# DEBUG_LEVEL: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
|
||||
#*******************************************************************************
|
||||
|
||||
@@ -26,6 +29,8 @@ VM_POLLING_INTERVAL = 60
|
||||
|
||||
PORT=2633
|
||||
|
||||
VNC_BASE_PORT = 5000
|
||||
|
||||
DEBUG_LEVEL=3
|
||||
|
||||
#*******************************************************************************
|
||||
|
||||
@@ -75,6 +75,12 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
|
||||
|
||||
attribute = new SingleAttribute("NETWORK_SIZE",value);
|
||||
conf_default.insert(make_pair(attribute->name(),attribute));
|
||||
|
||||
//NETWORK_SIZE
|
||||
value = "5900";
|
||||
|
||||
attribute = new SingleAttribute("VNC_BASE_PORT",value);
|
||||
conf_default.insert(make_pair(attribute->name(),attribute));
|
||||
|
||||
//DEBUG_LEVEL
|
||||
value = Log::WARNING;
|
||||
|
||||
@@ -468,10 +468,20 @@ void VirtualMachine::parse_graphics()
|
||||
|
||||
if ( port.empty() )
|
||||
{
|
||||
ostringstream oss;
|
||||
Nebula& nd = Nebula::instance();
|
||||
|
||||
oss << ( 5900 + oid );
|
||||
graphics->replace("PORT", oss.str());
|
||||
ostringstream oss;
|
||||
istringstream iss;
|
||||
|
||||
int base_port;
|
||||
string base_port_s;
|
||||
|
||||
nd.get_configuration_attribute("VNC_BASE_PORT",base_port_s);
|
||||
iss.str(base_port_s);
|
||||
iss >> base_port;
|
||||
|
||||
oss << ( base_port + oid );
|
||||
graphics->replace("PORT", oss.str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user