@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 }; }
cmd.setCpus(hostDetails.cpuNum); cmd.setMemory(hostDetails.freeMemory); cmd.setDom0MinMemory(hostDetails.dom0Memory);
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()); }
cmd.setCpus(_host.getCpus());
cmd.setCpus(host.getTotalThreads()); cmd.setCpuSockets(host.getCpuSockets()); cmd.setMemory(host.getMemory().longValue());
@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}; }