public static long getStorageCapacitybyPool(Long poolId, short capacityType) { // TODO: This method is for the API only, but it has configuration values (ramSize for system vms) // so if this Utils class can have some kind of config rather than a static initializer (maybe from // management server instantiation?) then maybe the management server method can be moved entirely // into this utils class. return s_ms.getMemoryOrCpuCapacityByHost(poolId, capacityType); }
public static String getVersion() { return s_ms.getVersion(); }
portInfo = new Pair<>(detailAddress.getValue(), Integer.valueOf(detailPort.getValue())); } else { portInfo = _ms.getVncPort(vm); if (portInfo.second() == -9) { port = Integer.parseInt(_ms.findDetail(hostVo.getId(), "rdp.server.port").getValue()); } else { port = portInfo.second(); param.setUsername(_ms.findDetail(hostVo.getId(), "username").getValue()); param.setPassword(_ms.findDetail(hostVo.getId(), "password").getValue()); GuestOSVO guestOsVo = _ms.getGuestOs(guestOs); if (guestOsVo.getCategoryId() == 6) sb.append("&guest=windows");
HostVO host = _ms.getHostBy(vm.getHostId()); if (host == null) { s_logger.warn("VM " + vmId + "'s host does not exist, sending blank response for thumbnail request"); String rootUrl = _ms.getConsoleAccessUrlRoot(vmId); if (rootUrl == null) { sendResponse(resp, "");
Pair<String, Integer> portInfo = _ms.getVncPort(vm); Ternary<String, String, String> parsedHostInfo = parseHostInfo(portInfo.first()); if (portInfo.second() == -9) { port = Integer.parseInt(_ms.findDetail(hostVo.getId(), "rdp.server.port").getValue()); } else { port = portInfo.second(); param.setUsername(_ms.findDetail(hostVo.getId(), "username").getValue()); param.setPassword(_ms.findDetail(hostVo.getId(), "password").getValue());
@Override public boolean configure(final String name, final Map<String, Object> xmlParams) throws ConfigurationException { _serverId = _msServer.getId();
private void handleAuthRequest(HttpServletRequest req, HttpServletResponse resp, long vmId) { // 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 VirtualMachine vm = _vmMgr.findById(vmId); if (vm == null) { s_logger.warn("VM " + vmId + " does not exist, sending failed response for authentication request from console proxy"); sendResponse(resp, "failed"); return; } if (vm.getHostId() == null) { s_logger.warn("VM " + vmId + " lost host info, failed response for authentication request from console proxy"); sendResponse(resp, "failed"); return; } HostVO host = _ms.getHostBy(vm.getHostId()); if (host == null) { s_logger.warn("VM " + vmId + "'s host does not exist, sending failed response for authentication request from console proxy"); sendResponse(resp, "failed"); return; } String sid = req.getParameter("sid"); if (sid == null || !sid.equals(vm.getVncPassword())) { s_logger.warn("sid " + sid + " in url does not match stored sid."); sendResponse(resp, "failed"); return; } sendResponse(resp, "success"); }
HostVO host = _ms.getHostBy(vm.getHostId()); if (host == null) { s_logger.warn("VM " + vmId + "'s host does not exist, sending blank response for console access request"); String rootUrl = _ms.getConsoleAccessUrlRoot(vmId); if (rootUrl == null) { sendResponse(resp, "<html><body><p>Console access will be ready in a few minutes. Please try it again later.</p></body></html>");
_serverId = _msServer.getId();
StoragePoolWorkVO work = new StoragePoolWorkVO(vmInstance.getId(), pool.getId(), false, false, server.getId()); _storagePoolWorkDao.persist(work); } catch (Exception e) { work.setStartedAfterMaintenance(false); work.setStoppedForMaintenance(false); work.setManagementServerId(server.getId()); _storagePoolWorkDao.update(work.getId(), work);