@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() { 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.setHypervisorType(HypervisorType.Ovm); cmd.setPrivateIpAddress(_ip); cmd.setStorageIpAddress(_ip);
defaultStartRoutCmd.setGuid(_guid); defaultStartRoutCmd.setName(_name); defaultStartRoutCmd.setPrivateIpAddress(_agentIp); defaultStartRoutCmd.setStorageIpAddress(_agentIp); defaultStartRoutCmd.setPool(_clusterGuid);
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()); }
PIF.Record pifr = pif.getRecord(conn); if (pifr.IP != null && pifr.IP.length() > 0) { cmd.setPrivateIpAddress(pifr.IP); cmd.setPrivateMacAddress(pifr.MAC); cmd.setPrivateNetmask(pifr.netmask); } else { cmd.setPrivateIpAddress(_host.getIp()); cmd.setPrivateMacAddress(pifr.MAC); cmd.setPrivateNetmask("255.255.255.0");
cmd.setHypervisorType(HypervisorType.Ovm3); cmd.setCaps(host.getCapabilities()); cmd.setPrivateIpAddress(c.getIp()); cmd.setStorageIpAddress(c.getIp()); Network net = new Network(c);
@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}; }