mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 5764: More changes
This commit is contained in:
parent
afc0adf28a
commit
417a3c8c18
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Thu Aug 19 09:21:10 PDT 2010
|
||||
build.number=65
|
||||
#Thu Aug 19 11:24:57 PDT 2010
|
||||
build.number=71
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the GNU General Public License v3 or later.
|
||||
*
|
||||
* It is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.cloud.consoleproxy;
|
||||
|
||||
import com.cloud.agent.api.AgentControlAnswer;
|
||||
import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
|
||||
import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
|
||||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
|
||||
public interface ConsoleProxyManager extends Manager {
|
||||
public static final int DEFAULT_PROXY_CAPACITY = 50;
|
||||
public static final int DEFAULT_STANDBY_CAPACITY = 10;
|
||||
public static final int DEFAULT_PROXY_VM_RAMSIZE = 1024; // 1G
|
||||
|
||||
public static final int DEFAULT_PROXY_CMD_PORT = 8001;
|
||||
public static final int DEFAULT_PROXY_VNC_PORT = 0;
|
||||
public static final int DEFAULT_PROXY_URL_PORT = 80;
|
||||
public static final int DEFAULT_PROXY_SESSION_TIMEOUT = 300000; // 5 minutes
|
||||
|
||||
public static final String ALERT_SUBJECT = "proxy-alert";
|
||||
|
||||
public ConsoleProxyVO assignProxy(long dataCenterId, long userVmId);
|
||||
|
||||
public ConsoleProxyVO startProxy(long proxyVmId, long startEventId);
|
||||
public boolean stopProxy(long proxyVmId, long startEventId);
|
||||
public boolean rebootProxy(long proxyVmId, long startEventId);
|
||||
public boolean destroyProxy(long proxyVmId, long startEventId);
|
||||
|
||||
public void onLoadReport(ConsoleProxyLoadReportCommand cmd);
|
||||
public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd);
|
||||
|
||||
public void onAgentConnect(HostVO host, StartupCommand cmd);
|
||||
public void onAgentDisconnect(long agentId, Status state);
|
||||
}
|
||||
@ -45,93 +45,84 @@ import com.cloud.ha.HighAvailabilityManager;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.host.dao.HostDao;
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
import com.cloud.vm.UserVmVO;
|
||||
import com.cloud.vm.VMInstanceVO;
|
||||
import com.cloud.vm.VirtualMachine.Type;
|
||||
import com.cloud.vm.VirtualMachineManager;
|
||||
import com.cloud.vm.VirtualMachineName;
|
||||
import com.cloud.vm.VirtualMachine.Type;
|
||||
import com.cloud.vm.dao.UserVmDao;
|
||||
import com.cloud.vm.dao.VMInstanceDao;
|
||||
|
||||
@Local(value={ConsoleProxyManager.class})
|
||||
public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, VirtualMachineManager<ConsoleProxyVO> {
|
||||
private static final Logger s_logger = Logger.getLogger(AgentBasedConsoleProxyManager.class);
|
||||
@Local(value = { ConsoleProxyManager.class })
|
||||
public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, VirtualMachineManager<ConsoleProxyVO>, AgentHook {
|
||||
private static final Logger s_logger = Logger.getLogger(AgentBasedConsoleProxyManager.class);
|
||||
|
||||
private String _name;
|
||||
protected HostDao _hostDao;
|
||||
protected UserVmDao _userVmDao;
|
||||
private String _instance;
|
||||
private VMInstanceDao _instanceDao;
|
||||
private ConsoleProxyListener _listener;
|
||||
@Inject
|
||||
protected HostDao _hostDao;
|
||||
@Inject
|
||||
protected UserVmDao _userVmDao;
|
||||
private String _instance;
|
||||
@Inject
|
||||
private VMInstanceDao _instanceDao;
|
||||
private ConsoleProxyListener _listener;
|
||||
|
||||
protected int _consoleProxyUrlPort = ConsoleProxyManager.DEFAULT_PROXY_URL_PORT;
|
||||
protected boolean _sslEnabled = false;
|
||||
AgentManager _agentMgr;
|
||||
protected int _consoleProxyUrlPort = ConsoleProxyManager.DEFAULT_PROXY_URL_PORT;
|
||||
protected int _consoleProxyPort = ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT;
|
||||
protected boolean _sslEnabled = false;
|
||||
@Inject
|
||||
AgentManager _agentMgr;
|
||||
|
||||
public int getVncPort(VMInstanceVO vm) {
|
||||
public int getVncPort(VMInstanceVO vm) {
|
||||
if (vm.getHostId() == null) {
|
||||
return -1;
|
||||
}
|
||||
GetVncPortAnswer answer = (GetVncPortAnswer)_agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getName()));
|
||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getName()));
|
||||
return answer == null ? -1 : answer.getPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
|
||||
if(s_logger.isInfoEnabled())
|
||||
s_logger.info("Start configuring AgentBasedConsoleProxyManager");
|
||||
if (s_logger.isInfoEnabled())
|
||||
s_logger.info("Start configuring AgentBasedConsoleProxyManager");
|
||||
|
||||
_name = name;
|
||||
|
||||
ComponentLocator locator = ComponentLocator.getCurrentLocator();
|
||||
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
|
||||
if (configDao == null) {
|
||||
throw new ConfigurationException(
|
||||
"Unable to get the configuration dao.");
|
||||
}
|
||||
ComponentLocator locator = ComponentLocator.getCurrentLocator();
|
||||
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
|
||||
if (configDao == null) {
|
||||
throw new ConfigurationException("Unable to get the configuration dao.");
|
||||
}
|
||||
|
||||
Map<String, String> configs = configDao.getConfiguration(
|
||||
"management-server", params);
|
||||
String value = configs.get("consoleproxy.url.port");
|
||||
if (value != null)
|
||||
_consoleProxyUrlPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_URL_PORT);
|
||||
Map<String, String> configs = configDao.getConfiguration("management-server", params);
|
||||
String value = configs.get("consoleproxy.url.port");
|
||||
if (value != null)
|
||||
_consoleProxyUrlPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_URL_PORT);
|
||||
|
||||
_hostDao = locator.getDao(HostDao.class);
|
||||
if (_hostDao == null) {
|
||||
throw new ConfigurationException("Unable to get "
|
||||
+ HostDao.class.getName());
|
||||
}
|
||||
value = configs.get("consoleproxy.port");
|
||||
if (value != null)
|
||||
_consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
|
||||
|
||||
_instanceDao = locator.getDao(VMInstanceDao.class);
|
||||
if (_instanceDao == null)
|
||||
throw new ConfigurationException("Unable to get " + VMInstanceDao.class.getName());
|
||||
value = configs.get("consoleproxy.sslEnabled");
|
||||
if (value != null && value.equalsIgnoreCase("true"))
|
||||
_sslEnabled = true;
|
||||
|
||||
_userVmDao = locator.getDao(UserVmDao.class);
|
||||
if (_userVmDao == null)
|
||||
throw new ConfigurationException("Unable to get " + UserVmDao.class.getName());
|
||||
_instance = configs.get("instance.name");
|
||||
|
||||
_agentMgr = locator.getManager(AgentManager.class);
|
||||
if (_agentMgr == null)
|
||||
throw new ConfigurationException("Unable to get " + AgentManager.class.getName());
|
||||
_listener = new ConsoleProxyListener(this);
|
||||
_agentMgr.registerForHostEvents(_listener, true, true, false);
|
||||
|
||||
value = configs.get("consoleproxy.sslEnabled");
|
||||
if(value != null && value.equalsIgnoreCase("true"))
|
||||
_sslEnabled = true;
|
||||
HighAvailabilityManager haMgr = locator.getManager(HighAvailabilityManager.class);
|
||||
haMgr.registerHandler(Type.ConsoleProxy, this);
|
||||
|
||||
_instance = configs.get("instance.name");
|
||||
|
||||
_listener = new ConsoleProxyListener(this);
|
||||
_agentMgr.registerForHostEvents(_listener, true, true, false);
|
||||
|
||||
HighAvailabilityManager haMgr = locator.getManager(HighAvailabilityManager.class);
|
||||
haMgr.registerHandler(Type.ConsoleProxy, this);
|
||||
|
||||
if(s_logger.isInfoEnabled())
|
||||
s_logger.info("AgentBasedConsoleProxyManager has been configured. SSL enabled: " + _sslEnabled);
|
||||
if (s_logger.isInfoEnabled())
|
||||
s_logger.info("AgentBasedConsoleProxyManager has been configured. SSL enabled: " + _sslEnabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -149,124 +140,90 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
return _hostDao.findById(vm.getHostId());
|
||||
}
|
||||
|
||||
protected ConsoleProxyVO allocateProxy(HostVO host, long dataCenterId) {
|
||||
// only private IP, public IP, host id have meaningful values, rest of all are place-holder values
|
||||
String publicIp = host.getPublicIpAddress();
|
||||
if(publicIp == null) {
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Host " + host.getName() + "/" + host.getPrivateIpAddress() +
|
||||
" does not have public interface, we will return its private IP for cosole proxy.");
|
||||
publicIp = host.getPrivateIpAddress();
|
||||
@Override
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
|
||||
UserVmVO userVm = _userVmDao.findById(userVmId);
|
||||
if (userVm == null) {
|
||||
s_logger.warn("User VM " + userVmId + " no longer exists, return a null proxy for user vm:" + userVmId);
|
||||
return null;
|
||||
}
|
||||
|
||||
// FIXME: Removed State.Running does this affect the console proxy?
|
||||
return new ConsoleProxyVO(1l, "EmbeddedProxy", null, null, null,
|
||||
"02:02:02:02:02:02",
|
||||
host.getPrivateIpAddress(),
|
||||
"255.255.255.0",
|
||||
1l,
|
||||
1l,
|
||||
"03:03:03:03:03:03",
|
||||
publicIp,
|
||||
"255.255.255.0",
|
||||
null,
|
||||
"untagged",
|
||||
1l,
|
||||
dataCenterId,
|
||||
"0.0.0.0",
|
||||
host.getId(),
|
||||
"dns1",
|
||||
"dn2",
|
||||
"domain",
|
||||
0,
|
||||
0);
|
||||
HostVO host = findHost(userVm);
|
||||
if (host != null) {
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Assign embedded console proxy running at " + host.getName() + " to user vm " + userVmId + " with public IP "
|
||||
+ host.getPublicIpAddress());
|
||||
|
||||
// only private IP, public IP, host id have meaningful values, rest
|
||||
// of all are place-holder values
|
||||
String publicIp = host.getPublicIpAddress();
|
||||
if (publicIp == null) {
|
||||
if (s_logger.isDebugEnabled())
|
||||
s_logger.debug("Host " + host.getName() + "/" + host.getPrivateIpAddress()
|
||||
+ " does not have public interface, we will return its private IP for cosole proxy.");
|
||||
publicIp = host.getPrivateIpAddress();
|
||||
}
|
||||
|
||||
int urlPort = _consoleProxyUrlPort;
|
||||
|
||||
if (host.getProxyPort() != null && host.getProxyPort().intValue() > 0)
|
||||
urlPort = host.getProxyPort().intValue();
|
||||
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort);
|
||||
} else {
|
||||
s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO assignProxy(long dataCenterId, long userVmId) {
|
||||
UserVmVO userVm = _userVmDao.findById(userVmId);
|
||||
if (userVm == null) {
|
||||
s_logger.warn("User VM " + userVmId
|
||||
+ " no longer exists, return a null proxy for user vm:"
|
||||
+ userVmId);
|
||||
return null;
|
||||
}
|
||||
|
||||
HostVO host = findHost(userVm);
|
||||
if(host != null) {
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Assign embedded console proxy running at " + host.getName() + " to user vm " + userVmId + " with public IP " + host.getPublicIpAddress());
|
||||
|
||||
// only private IP, public IP, host id have meaningful values, rest of all are place-holder values
|
||||
String publicIp = host.getPublicIpAddress();
|
||||
if(publicIp == null) {
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Host " + host.getName() + "/" + host.getPrivateIpAddress() +
|
||||
" does not have public interface, we will return its private IP for cosole proxy.");
|
||||
publicIp = host.getPrivateIpAddress();
|
||||
}
|
||||
|
||||
ConsoleProxyVO proxy = allocateProxy(host, dataCenterId);
|
||||
|
||||
if(host.getProxyPort() != null && host.getProxyPort().intValue() > 0)
|
||||
proxy.setPort(host.getProxyPort().intValue());
|
||||
else
|
||||
proxy.setPort(_consoleProxyUrlPort);
|
||||
|
||||
proxy.setSslEnabled(_sslEnabled);
|
||||
return proxy;
|
||||
} else {
|
||||
s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
|
||||
}
|
||||
return null;
|
||||
public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadReport(ConsoleProxyLoadReportCommand cmd) {
|
||||
}
|
||||
public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd) {
|
||||
long vmId = 0;
|
||||
|
||||
@Override
|
||||
public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd) {
|
||||
long vmId = 0;
|
||||
if (cmd.getVmId() != null && cmd.getVmId().isEmpty()) {
|
||||
if (s_logger.isTraceEnabled())
|
||||
s_logger.trace("Invalid vm id sent from proxy(happens when proxy session has terminated)");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
if(cmd.getVmId() != null && cmd.getVmId().isEmpty()) {
|
||||
if(s_logger.isTraceEnabled())
|
||||
s_logger.trace("Invalid vm id sent from proxy(happens when proxy session has terminated)");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
try {
|
||||
vmId = Long.parseLong(cmd.getVmId());
|
||||
} catch (NumberFormatException e) {
|
||||
s_logger.error("Invalid vm id " + cmd.getVmId() + " sent from console access authentication", e);
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
try {
|
||||
vmId = Long.parseLong(cmd.getVmId());
|
||||
} catch(NumberFormatException e) {
|
||||
s_logger.error("Invalid vm id " + cmd.getVmId() + " sent from console access authentication", e);
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
// TODO authentication channel between console proxy VM and management
|
||||
// server needs to be secured,
|
||||
// the data is now being sent through private network, but this is
|
||||
// apparently not enough
|
||||
VMInstanceVO vm = _instanceDao.findById(vmId);
|
||||
if (vm == null) {
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
// TODO authentication channel between console proxy VM and management server needs to be secured,
|
||||
// the data is now being sent through private network, but this is apparently not enough
|
||||
VMInstanceVO vm = _instanceDao.findById(vmId);
|
||||
if(vm == null) {
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
if (vm.getHostId() == null) {
|
||||
s_logger.warn("VM " + vmId + " lost host info, failed authentication request");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
if(vm.getHostId() == null) {
|
||||
s_logger.warn("VM " + vmId + " lost host info, failed authentication request");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
HostVO host = _hostDao.findById(vm.getHostId());
|
||||
if (host == null) {
|
||||
s_logger.warn("VM " + vmId + "'s host does not exist, fail authentication request");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
HostVO host = _hostDao.findById(vm.getHostId());
|
||||
if(host == null) {
|
||||
s_logger.warn("VM " + vmId + "'s host does not exist, fail authentication request");
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
String sid = cmd.getSid();
|
||||
if (sid == null || !sid.equals(vm.getVncPassword())) {
|
||||
s_logger.warn("sid " + sid + " in url does not match stored sid " + vm.getVncPassword());
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
String sid = cmd.getSid();
|
||||
if(sid == null || !sid.equals(vm.getVncPassword())) {
|
||||
s_logger.warn("sid " + sid + " in url does not match stored sid " + vm.getVncPassword());
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, false);
|
||||
}
|
||||
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, true);
|
||||
return new ConsoleAccessAuthenticationAnswer(cmd, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -274,7 +231,7 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAgentDisconnect(long agentId, Status state) {
|
||||
public void onAgentDisconnect(long agentId, Status state) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -282,25 +239,25 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean destroyProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean destroyProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rebootProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean rebootProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean stopProxy(long proxyVmId, long startEventId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return _name;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return _name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Command cleanup(ConsoleProxyVO vm, String vmName) {
|
||||
@ -349,7 +306,8 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO start(long vmId, long startEventId) throws InsufficientCapacityException, StorageUnavailableException, ConcurrentOperationException {
|
||||
public ConsoleProxyVO start(long vmId, long startEventId) throws InsufficientCapacityException, StorageUnavailableException,
|
||||
ConcurrentOperationException {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
import com.cloud.vm.UserVmVO;
|
||||
|
||||
@Local(value={ConsoleProxyManager.class})
|
||||
@ -35,7 +35,7 @@ AgentBasedConsoleProxyManager {
|
||||
private static final Logger s_logger = Logger.getLogger(AgentBasedStandaloneConsoleProxyManager.class);
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO assignProxy(long dataCenterId, long userVmId) {
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
|
||||
UserVmVO userVm = _userVmDao.findById(userVmId);
|
||||
if (userVm == null) {
|
||||
s_logger.warn("User VM " + userVmId
|
||||
@ -81,15 +81,11 @@ AgentBasedConsoleProxyManager {
|
||||
publicIp = allocatedHost.getPrivateIpAddress();
|
||||
}
|
||||
|
||||
ConsoleProxyVO proxy = allocateProxy(allocatedHost, dataCenterId);
|
||||
int urlPort = _consoleProxyUrlPort;
|
||||
if(allocatedHost.getProxyPort() != null && allocatedHost.getProxyPort().intValue() > 0)
|
||||
urlPort = allocatedHost.getProxyPort().intValue();
|
||||
|
||||
if(allocatedHost.getProxyPort() != null && allocatedHost.getProxyPort().intValue() > 0)
|
||||
proxy.setPort(allocatedHost.getProxyPort().intValue());
|
||||
else
|
||||
proxy.setPort(_consoleProxyUrlPort);
|
||||
|
||||
proxy.setSslEnabled(_sslEnabled);
|
||||
return proxy;
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort);
|
||||
} else {
|
||||
s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
|
||||
}
|
||||
|
||||
19
server/src/com/cloud/consoleproxy/AgentHook.java
Normal file
19
server/src/com/cloud/consoleproxy/AgentHook.java
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.cloud.consoleproxy;
|
||||
|
||||
import com.cloud.agent.api.AgentControlAnswer;
|
||||
import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
|
||||
import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
|
||||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
|
||||
public interface AgentHook {
|
||||
void onLoadReport(ConsoleProxyLoadReportCommand cmd);
|
||||
AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd);
|
||||
void onAgentConnect(HostVO host, StartupCommand cmd);
|
||||
|
||||
public void onAgentDisconnect(long agentId, Status state);
|
||||
}
|
||||
@ -17,7 +17,6 @@
|
||||
*/
|
||||
package com.cloud.consoleproxy;
|
||||
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.agent.Listener;
|
||||
@ -34,9 +33,9 @@ import com.cloud.host.Status;
|
||||
public class ConsoleProxyListener implements Listener {
|
||||
private final static Logger s_logger = Logger.getLogger(ConsoleProxyListener.class);
|
||||
|
||||
ConsoleProxyManager _proxyMgr = null;
|
||||
AgentHook _proxyMgr = null;
|
||||
|
||||
public ConsoleProxyListener(ConsoleProxyManager proxyMgr) {
|
||||
public ConsoleProxyListener(AgentHook proxyMgr) {
|
||||
_proxyMgr = proxyMgr;
|
||||
}
|
||||
|
||||
@ -47,7 +46,7 @@ public class ConsoleProxyListener implements Listener {
|
||||
|
||||
@Override
|
||||
public boolean processAnswer(long agentId, long seq, Answer[] answers) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,36 +56,36 @@ public class ConsoleProxyListener implements Listener {
|
||||
|
||||
@Override
|
||||
public AgentControlAnswer processControlCommand(long agentId, AgentControlCommand cmd) {
|
||||
if(cmd instanceof ConsoleProxyLoadReportCommand) {
|
||||
_proxyMgr.onLoadReport((ConsoleProxyLoadReportCommand)cmd);
|
||||
if (cmd instanceof ConsoleProxyLoadReportCommand) {
|
||||
_proxyMgr.onLoadReport((ConsoleProxyLoadReportCommand) cmd);
|
||||
|
||||
// return dummy answer
|
||||
return new AgentControlAnswer(cmd);
|
||||
} else if(cmd instanceof ConsoleAccessAuthenticationCommand) {
|
||||
return _proxyMgr.onConsoleAccessAuthentication((ConsoleAccessAuthenticationCommand)cmd);
|
||||
}
|
||||
return null;
|
||||
// return dummy answer
|
||||
return new AgentControlAnswer(cmd);
|
||||
} else if (cmd instanceof ConsoleAccessAuthenticationCommand) {
|
||||
return _proxyMgr.onConsoleAccessAuthentication((ConsoleAccessAuthenticationCommand) cmd);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processConnect(HostVO host, StartupCommand cmd) {
|
||||
_proxyMgr.onAgentConnect(host, cmd);
|
||||
_proxyMgr.onAgentConnect(host, cmd);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processDisconnect(long agentId, Status state) {
|
||||
_proxyMgr.onAgentDisconnect(agentId, state);
|
||||
_proxyMgr.onAgentDisconnect(agentId, state);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processTimeout(long agentId, long seq) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTimeout() {
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
46
server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
Normal file
46
server/src/com/cloud/consoleproxy/ConsoleProxyManager.java
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the GNU General Public License v3 or later.
|
||||
*
|
||||
* It is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.cloud.consoleproxy;
|
||||
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
|
||||
public interface ConsoleProxyManager extends Manager {
|
||||
public static final int DEFAULT_PROXY_CAPACITY = 50;
|
||||
public static final int DEFAULT_STANDBY_CAPACITY = 10;
|
||||
public static final int DEFAULT_PROXY_VM_RAMSIZE = 1024; // 1G
|
||||
|
||||
public static final int DEFAULT_PROXY_CMD_PORT = 8001;
|
||||
public static final int DEFAULT_PROXY_VNC_PORT = 0;
|
||||
public static final int DEFAULT_PROXY_URL_PORT = 80;
|
||||
public static final int DEFAULT_PROXY_SESSION_TIMEOUT = 300000; // 5 minutes
|
||||
|
||||
public static final String ALERT_SUBJECT = "proxy-alert";
|
||||
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId);
|
||||
|
||||
public ConsoleProxyVO startProxy(long proxyVmId, long startEventId);
|
||||
|
||||
public boolean stopProxy(long proxyVmId, long startEventId);
|
||||
|
||||
public boolean rebootProxy(long proxyVmId, long startEventId);
|
||||
|
||||
public boolean destroyProxy(long proxyVmId, long startEventId);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -24,8 +24,9 @@ import javax.ejb.Local;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.configuration.dao.ConfigurationDao;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
import com.cloud.utils.component.ComponentLocator;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
@ -46,31 +47,8 @@ public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO assignProxy(long dataCenterId, long userVmId) {
|
||||
ConsoleProxyVO proxy = new ConsoleProxyVO(1l, "EmbeddedProxy", null, null, null,
|
||||
"02:02:02:02:02:02",
|
||||
"127.0.0.1",
|
||||
"255.255.255.0",
|
||||
1l,
|
||||
1l,
|
||||
"03:03:03:03:03:03",
|
||||
_ip,
|
||||
"255.255.255.0",
|
||||
null,
|
||||
"untagged",
|
||||
1l,
|
||||
dataCenterId,
|
||||
"0.0.0.0",
|
||||
0L,
|
||||
"dns1",
|
||||
"dn2",
|
||||
"domain",
|
||||
0,
|
||||
0);
|
||||
|
||||
proxy.setPort(_consoleProxyUrlPort);
|
||||
proxy.setSslEnabled(false);
|
||||
return proxy;
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
|
||||
return new ConsoleProxyInfo(false, _ip, _consoleProxyPort, _consoleProxyUrlPort);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -351,9 +351,6 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
private final Map<String, String> _configs;
|
||||
|
||||
private String _domain;
|
||||
private int _consoleProxyPort = ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT;
|
||||
// private int _consoleProxyUrlPort =
|
||||
// ConsoleProxyManager.DEFAULT_PROXY_URL_PORT;
|
||||
|
||||
private final int _routerRamSize;
|
||||
private final int _proxyRamSize;
|
||||
@ -447,16 +444,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
_domain = "." + _domain;
|
||||
}
|
||||
|
||||
String value = _configs.get("consoleproxy.port");
|
||||
if (value != null)
|
||||
_consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
|
||||
|
||||
// value = _configs.get("consoleproxy.url.port");
|
||||
// if(value != null)
|
||||
// _consoleProxyUrlPort = NumbersUtil.parseInt(value,
|
||||
// ConsoleProxyManager.DEFAULT_PROXY_URL_PORT);
|
||||
|
||||
value = _configs.get("account.cleanup.interval");
|
||||
String value = _configs.get("account.cleanup.interval");
|
||||
int cleanup = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 hour.
|
||||
|
||||
// Parse the max number of UserVMs and public IPs from server-setup.xml,
|
||||
@ -771,6 +759,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public User getUser(long userId, boolean active) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Retrieiving user with id: " + userId + " and active = " + active);
|
||||
@ -1240,6 +1229,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
/*
|
||||
* Save event after starting execution of an async job
|
||||
*/
|
||||
@Override
|
||||
public Long saveStartedEvent(Long userId, Long accountId, String type, String description, long startEventId) {
|
||||
EventVO event = new EventVO();
|
||||
event.setUserId(userId);
|
||||
@ -2874,6 +2864,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _hostDao.findById(hostId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHost(long hostId, long guestOSCategoryId) throws InvalidParameterValueException {
|
||||
// Verify that the guest OS Category exists
|
||||
if (guestOSCategoryId > 0) {
|
||||
@ -2885,6 +2876,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
_agentMgr.updateHost(hostId, guestOSCategoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteHost(long hostId) {
|
||||
return _agentMgr.deleteHost(hostId);
|
||||
}
|
||||
@ -5950,6 +5942,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRule(long ruleId, long userId, long accountId) throws InvalidParameterValueException, PermissionDeniedException, InternalErrorException {
|
||||
Exception e = null;
|
||||
try {
|
||||
@ -6006,6 +5999,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long deleteRuleAsync(long id, long userId, long accountId) {
|
||||
DeleteRuleParam param = new DeleteRuleParam(id, userId, accountId);
|
||||
Gson gson = GsonHelper.getBuilder().create();
|
||||
@ -6019,10 +6013,12 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> listAllTemplates() {
|
||||
return _templateDao.listAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GuestOSVO> listGuestOSByCriteria(Criteria c)
|
||||
{
|
||||
|
||||
@ -6047,6 +6043,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _guestOSDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GuestOSCategoryVO> listGuestOSCategoriesByCriteria(Criteria c)
|
||||
{
|
||||
Filter searchFilter = new Filter(GuestOSCategoryVO.class, c.getOrderBy(), c.getAscending(), c.getOffset(), c.getLimit());
|
||||
@ -6064,34 +6061,37 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _guestOSCategoryDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigurationValue(String name) {
|
||||
return _configDao.getValue(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyInfo getConsoleProxy(long dataCenterId, long userVmId) {
|
||||
ConsoleProxyVO proxy = _consoleProxyMgr.assignProxy(dataCenterId, userVmId);
|
||||
if (proxy == null)
|
||||
return null;
|
||||
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), proxy.getPublicIpAddress(), _consoleProxyPort, proxy.getPort());
|
||||
return _consoleProxyMgr.assignProxy(dataCenterId, userVmId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO startConsoleProxy(long instanceId, long startEventId) throws InternalErrorException {
|
||||
return _consoleProxyMgr.startProxy(instanceId, startEventId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopConsoleProxy(long instanceId, long startEventId) {
|
||||
return _consoleProxyMgr.stopProxy(instanceId, startEventId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rebootConsoleProxy(long instanceId, long startEventId) {
|
||||
return _consoleProxyMgr.rebootProxy(instanceId, startEventId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean destroyConsoleProxy(long instanceId, long startEventId) {
|
||||
return _consoleProxyMgr.destroyProxy(instanceId, startEventId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long startConsoleProxyAsync(long instanceId) {
|
||||
long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_PROXY_START, "starting console proxy with Id: "+instanceId);
|
||||
VMOperationParam param = new VMOperationParam(0, instanceId, null, eventId);
|
||||
@ -6106,6 +6106,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long stopConsoleProxyAsync(long instanceId) {
|
||||
long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_PROXY_STOP, "stopping console proxy with Id: "+instanceId);
|
||||
VMOperationParam param = new VMOperationParam(0, instanceId, null, eventId);
|
||||
@ -6122,6 +6123,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long rebootConsoleProxyAsync(long instanceId) {
|
||||
long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_PROXY_REBOOT, "rebooting console proxy with Id: "+instanceId);
|
||||
VMOperationParam param = new VMOperationParam(0, instanceId, null, eventId);
|
||||
@ -6138,6 +6140,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long destroyConsoleProxyAsync(long instanceId) {
|
||||
long eventId = saveScheduledEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, EventTypes.EVENT_PROXY_DESTROY, "destroying console proxy with Id: "+instanceId);
|
||||
VMOperationParam param = new VMOperationParam(0, instanceId, null, eventId);
|
||||
@ -6152,6 +6155,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _asyncMgr.submitAsyncJob(job);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConsoleAccessUrlRoot(long vmId) {
|
||||
VMInstanceVO vm = this.findVMInstanceById(vmId);
|
||||
if (vm != null) {
|
||||
@ -6162,6 +6166,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVncPort(VirtualMachine vm) {
|
||||
if (vm.getHostId() == null) {
|
||||
s_logger.warn("VM " + vm.getName() + " does not have host, return -1 for its VNC port");
|
||||
@ -6180,10 +6185,12 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return port;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsoleProxyVO findConsoleProxyById(long instanceId) {
|
||||
return _consoleProxyDao.findById(instanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Domain> searchForDomains(Criteria c) {
|
||||
Filter searchFilter = new Filter(DomainVO.class, c.getOrderBy(), c.getAscending(), c.getOffset(), c.getLimit());
|
||||
Long domainId = (Long) c.getCriteria(Criteria.ID);
|
||||
@ -6223,6 +6230,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _domainDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Domain> searchForDomainChildren(Criteria c) {
|
||||
Filter searchFilter = new Filter(DomainVO.class, c.getOrderBy(), c.getAscending(), c.getOffset(), c.getLimit());
|
||||
Long domainId = (Long) c.getCriteria(Criteria.ID);
|
||||
@ -6354,6 +6362,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return success && deleteDomainSuccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDomain(Long domainId, String domainName) {
|
||||
SearchCriteria<DomainVO> sc = _domainDao.createSearchCriteria();
|
||||
sc.addAnd("name", SearchCriteria.Op.EQ, domainName);
|
||||
@ -6368,6 +6377,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long findDomainIdByAccountId(Long accountId) {
|
||||
if (accountId == null) {
|
||||
return null;
|
||||
@ -6381,6 +6391,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DomainVO findDomainIdById(Long domainId) {
|
||||
return _domainDao.findById(domainId);
|
||||
}
|
||||
@ -6447,6 +6458,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _capacityDao.search(sc, searchFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMemoryUsagebyHost(Long hostId) {
|
||||
long mem = 0;
|
||||
List<VMInstanceVO> vms = _vmInstanceDao.listUpByHostIdTypes(hostId, VirtualMachine.Type.DomainRouter);
|
||||
@ -8266,6 +8278,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getCloudIdentifierResponse(long userId)
|
||||
{
|
||||
Criteria c = new Criteria ();
|
||||
@ -8477,12 +8490,14 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
return _configMgr.addConfig(category, instance, component, name, value, description);
|
||||
}
|
||||
|
||||
public boolean preparePrimaryStorageForMaintenance(long primaryStorageId, long userId) {
|
||||
@Override
|
||||
public boolean preparePrimaryStorageForMaintenance(long primaryStorageId, long userId) {
|
||||
return _storageMgr.preparePrimaryStorageForMaintenance(primaryStorageId, userId);
|
||||
|
||||
}
|
||||
|
||||
public long preparePrimaryStorageForMaintenanceAsync(long primaryStorageId) throws InvalidParameterValueException
|
||||
@Override
|
||||
public long preparePrimaryStorageForMaintenanceAsync(long primaryStorageId) throws InvalidParameterValueException
|
||||
{
|
||||
StoragePoolVO primaryStorage = _poolDao.findById(primaryStorageId);
|
||||
|
||||
@ -8512,12 +8527,14 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cancelPrimaryStorageMaintenance(long primaryStorageId, long userId)
|
||||
{
|
||||
return _storageMgr.cancelPrimaryStorageForMaintenance(primaryStorageId, userId);
|
||||
}
|
||||
|
||||
public long cancelPrimaryStorageMaintenanceAsync(long primaryStorageId) throws InvalidParameterValueException
|
||||
@Override
|
||||
public long cancelPrimaryStorageMaintenanceAsync(long primaryStorageId) throws InvalidParameterValueException
|
||||
{
|
||||
StoragePoolVO primaryStorage = _poolDao.findById(primaryStorageId);
|
||||
|
||||
|
||||
@ -32,12 +32,12 @@ import com.cloud.user.AccountVO;
|
||||
public interface VmManager {
|
||||
|
||||
VMInstanceVO allocate(VMInstanceVO vm,
|
||||
ServiceOfferingVO serviceOffering,
|
||||
Long rootSize,
|
||||
List<NetworkOfferingVO> networkOfferings,
|
||||
Map<DiskOfferingVO, Long> diskOfferings,
|
||||
DataCenterVO dc,
|
||||
AccountVO owner);
|
||||
ServiceOfferingVO serviceOffering,
|
||||
Long rootSize,
|
||||
List<NetworkOfferingVO> networkOfferings,
|
||||
Map<DiskOfferingVO, Long> diskOfferings,
|
||||
DataCenterVO dc,
|
||||
AccountVO owner);
|
||||
|
||||
VMInstanceVO allocate(VMInstanceVO vm,
|
||||
ServiceOfferingVO serviceOffering,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user