@Override public StartupCommand[] initialize() { try { StartupRoutingCommand cmd = new StartupRoutingCommand(); fillHostInfo(cmd); cmd.setCaps("hvm"); return new StartupCommand[] {cmd}; } catch (Exception e) { s_logger.debug("Ovm resource initializes failed", e); return null; } }
@Override public StartupCommand[] initialize() { LOGGER.debug("Ovm3 resource intializing"); try { StartupRoutingCommand srCmd = new StartupRoutingCommand(); StartupStorageCommand ssCmd = new StartupStorageCommand(); /* here stuff gets completed, but where should state live ? */ hypervisorsupport.fillHostInfo(srCmd); hypervisorsupport.vmStateMapClear(); LOGGER.debug("Ovm3 pool " + ssCmd + " " + srCmd); return new StartupCommand[] {srCmd, ssCmd}; } catch (Exception e) { LOGGER.debug("Ovm3 resource initializes failed", e); return new StartupCommand[] {}; } }
@Override public StartupCommand[] initialize() { StartupRoutingCommand cmd = new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.HypervisorType.KVM, new HashMap<String, String>()); cmd.setDataCenter(_zoneId); cmd.setPod(_podId); cmd.setCluster(_clusterId); cmd.setGuid(_guid); cmd.setName(_agentIp); cmd.setPrivateIpAddress(_agentIp); cmd.setStorageIpAddress(_agentIp); cmd.setVersion(KvmDummyResourceBase.class.getPackage().getImplementationVersion()); return new StartupCommand[] {cmd}; }
@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 StartupCommand[] initialize() { StartupRoutingCommand cmd = new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.HypervisorType.BareMetal, new HashMap<String, String>()); cmd.setDataCenter(_zone); cmd.setPod(_pod); cmd.setCluster(_cluster); cmd.setGuid(_uuid); cmd.setName(_ip); cmd.setPrivateIpAddress(_ip); cmd.setStorageIpAddress(_ip); cmd.setVersion(BareMetalResourceBase.class.getPackage().getImplementationVersion()); cmd.setCpus((int) _cpuNum); cmd.setSpeed(_cpuCapacity); cmd.setMemory(_memCapacity); cmd.setPrivateMacAddress(_mac); cmd.setPublicMacAddress(_mac); return new StartupCommand[] { cmd }; }
new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.HypervisorType.Hyperv, RouterPrivateIpStrategy.HostLocal);
@Override public StartupCommand[] initialize() throws IllegalArgumentException { final Connection conn = getConnection(); if (!getHostInfo(conn)) { s_logger.warn("Unable to get host information for " + _host.getIp()); return null; } final StartupRoutingCommand cmd = new StartupRoutingCommand(); fillHostInfo(conn, cmd); cmd.setHypervisorType(HypervisorType.XenServer); cmd.setCluster(_cluster); cmd.setPoolSync(false); try { final Pool pool = Pool.getByUuid(conn, _host.getPool()); final Pool.Record poolr = pool.getRecord(conn); poolr.master.getRecord(conn); } catch (final Throwable e) { s_logger.warn("Check for master failed, failing the FULL Cluster sync command"); } List<StartupStorageCommand> startUpLocalStorageCommands = null; try { startUpLocalStorageCommands = initializeLocalSrs(conn); } catch (XenAPIException | XmlRpcException e) { s_logger.warn("Could not initialize local SRs on host: " + _host.getUuid(), e); } if (CollectionUtils.isEmpty(startUpLocalStorageCommands)) { return new StartupCommand[] {cmd}; } return createStartupCommandsArray(cmd, startUpLocalStorageCommands); }
public final void testStartupCommand() { StartupRoutingCommand defaultStartRoutCmd = new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.HypervisorType.Hyperv, RouterPrivateIpStrategy.HostLocal); // Identity within the data centre is decided by CloudStack kernel, // and passed via ServerResource.configure() defaultStartRoutCmd.setDataCenter("1"); defaultStartRoutCmd.setPod("1"); defaultStartRoutCmd.setCluster("1"); defaultStartRoutCmd.setGuid("1"); defaultStartRoutCmd.setName("1"); defaultStartRoutCmd.setPrivateIpAddress("1"); defaultStartRoutCmd.setStorageIpAddress("1"); defaultStartRoutCmd.setCpus(12); // TODO: does version need to be hard coded. defaultStartRoutCmd.setVersion("4.2.0"); StartupCommand scmd = defaultStartRoutCmd; Command[] cmds = {scmd}; String cmdsStr = s_gson.toJson(cmds); s_logger.debug("Commands[] toJson is " + cmdsStr); Command[] result = s_gson.fromJson(cmdsStr, Command[].class); s_logger.debug("Commands[] fromJson is " + s_gson.toJson(result)); s_logger.debug("Commands[] first element has type" + result[0].toString()); }
new StartupRoutingCommand(info.getCpus(), info.getCpuSpeed(), info.getTotalMemory(), info.getReservedMemory(), capabilities, _hypervisorType, RouterPrivateIpStrategy.HostLocal); cmd.setCpuSockets(info.getCpuSockets());
@Override public StartupCommand[] initialize() { StartupRoutingCommand cmd = new StartupRoutingCommand(); cmd.setCpus(1); cmd.setSpeed(1000L); cmd.setMemory(1000000L); cmd.setDom0MinMemory(256L); cmd.setCaps("hvm"); cmd.setGuid(_guid); cmd.setDataCenter(_zone); cmd.setPod(_pod); cmd.setHypervisorType(HypervisorType.None); cmd.setAgentTag("vmops-simulator"); cmd.setName(_url); cmd.setPrivateIpAddress(this.getHostPrivateIp()); cmd.setPrivateMacAddress(this.getHostMacAddress().toString()); cmd.setPrivateNetmask("255.255.0.0"); cmd.setIqn("iqn:" + _url); cmd.setStorageIpAddress(getHostStoragePrivateIp()); cmd.setStorageMacAddress(getHostStorageMacAddress().toString()); cmd.setStorageIpAddressDeux(getHostStoragePrivateIp2()); cmd.setStorageMacAddressDeux(getHostStorageMacAddress2().toString()); cmd.setPublicIpAddress(getHostStoragePrivateIp()); cmd.setPublicMacAddress(getHostStorageMacAddress().toString()); cmd.setPublicNetmask("255.255.0.0"); cmd.setVersion(DummyHostServerResource.class.getPackage().getImplementationVersion()); return new StartupCommand[] {cmd}; }