public StartupRoutingCommand(int cpus, long speed, long memory, long dom0MinMemory, String caps, HypervisorType hypervisorType, RouterPrivateIpStrategy privIpStrategy) { this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType); getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStrategy.toString()); }
public StartupRoutingCommand() { super(Host.Type.Routing); hostDetails = new HashMap<String, String>(); getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString()); }
@Override protected void fillHostInfo(final Connection conn, final StartupRoutingCommand cmd) { super.fillHostInfo(conn, cmd); final Map<String, String> details = cmd.getHostDetails(); final Boolean hotFix62ESP1004 = hostHasHotFix(conn, XenserverConfigs.XSHotFix62ESP1004); if( hotFix62ESP1004 != null && hotFix62ESP1004 ) { details.put(XenserverConfigs.XS620HotFix , XenserverConfigs.XSHotFix62ESP1004); } else { final Boolean hotFix62ESP1 = hostHasHotFix(conn, XenserverConfigs.XSHotFix62ESP1); if( hotFix62ESP1 != null && hotFix62ESP1 ) { details.put(XenserverConfigs.XS620HotFix , XenserverConfigs.XSHotFix62ESP1); } } cmd.setHostDetails(details); } }
@Override public StartupCommand[] initialize() { final List<Object> info = getHostInfo(); final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal); fillNetworkInformation(cmd); cmd.getHostDetails().putAll(getVersionStrings()); cmd.setCluster(getConfiguredProperty("cluster", "1")); StoragePoolInfo pi = initializeLocalStorage(); StartupStorageCommand sscmd = new StartupStorageCommand(); sscmd.setPoolInfo(pi); sscmd.setGuid(pi.getUuid()); sscmd.setDataCenter((String)_params.get("zone")); sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL); return new StartupCommand[] {cmd, sscmd}; }
@Override public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) { StartupCommand firstCmd = cmd[0]; if (!(firstCmd instanceof StartupRoutingCommand)) { return null; } StartupRoutingCommand ssCmd = ((StartupRoutingCommand)firstCmd); if (ssCmd.getHypervisorType() != getHypervisorType()) { return null; } /* KVM requires host are the same in cluster */ ClusterVO clusterVO = _clusterDao.findById(host.getClusterId()); if (clusterVO == null) { s_logger.debug("cannot find cluster: " + host.getClusterId()); throw new IllegalArgumentException("cannot add host, due to can't find cluster: " + host.getClusterId()); } List<HostVO> hostsInCluster = _resourceMgr.listAllHostsInCluster(clusterVO.getId()); if (!hostsInCluster.isEmpty()) { HostVO oneHost = hostsInCluster.get(0); _hostDao.loadDetails(oneHost); String hostOsInCluster = oneHost.getDetail("Host.OS"); String hostOs = ssCmd.getHostDetails().get("Host.OS"); if (!hostOsInCluster.equalsIgnoreCase(hostOs)) { throw new IllegalArgumentException("Can't add host: " + firstCmd.getPrivateIpAddress() + " with hostOS: " + hostOs + " into a cluster," + "in which there are " + hostOsInCluster + " hosts added"); } } _hostDao.loadDetails(host); return _resourceMgr.fillRoutingHostVO(host, ssCmd, getHypervisorType(), host.getDetails(), null); }
_guestNetworkName = _privateNetworkName; Map<String, String> d = cmd.getHostDetails(); d.put("public.network.device", _publicNetworkName); d.put("private.network.device", _privateNetworkName);
fillNetworkInformation(cmd); _privateIp = cmd.getPrivateIpAddress(); cmd.getHostDetails().putAll(getVersionStrings()); cmd.getHostDetails().put(KeyStoreUtils.SECURED, String.valueOf(isHostSecured()).toLowerCase()); cmd.setPool(_pool); cmd.setCluster(_clusterId); cmd.setIqn(getIqn()); if (cmd.getHostDetails().containsKey("Host.OS")) { _hostDistro = cmd.getHostDetails().get("Host.OS");
Map<String, String> details = startup.getHostDetails(); String prodBrand = details.get("product_brand").trim(); String prodVersion = details.get("product_version").trim();
final Host.Record hr = host.getRecord(conn); Map<String, String> details = cmd.getHostDetails(); if (details == null) { details = new HashMap<String, String>();
.getAgentPrivateNetworkName()); Map<String, String> d = cmd.getHostDetails(); d.put("public.network.device", config.getAgentPublicNetworkName()); d.put("private.network.device", config.getAgentPrivateNetworkName()); cmd.setHostDetails(d); LOGGER.debug("Add an Ovm3 host " + config.getAgentHostname() + ":" + cmd.getHostDetails()); } catch (Ovm3ResourceException e) { throw new CloudRuntimeException("Ovm3ResourceException: "
final Map<String, String> hostDetails = ssCmd.getHostDetails(); if (hostDetails != null) { if (details != null) {