use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class HypervDirectConnectResourceTest method testStartupCommand.
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());
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class VmwareServerDiscoverer method createHostVOForDirectConnectAgent.
@Override
public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource, Map<String, String> details, List<String> hostTags) {
StartupCommand firstCmd = startup[0];
if (!(firstCmd instanceof StartupRoutingCommand)) {
return null;
}
StartupRoutingCommand ssCmd = ((StartupRoutingCommand) firstCmd);
if (ssCmd.getHypervisorType() != HypervisorType.VMware) {
return null;
}
return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.VMware, details, hostTags);
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class BrocadeVcsResource method initialize.
@Override
public StartupCommand[] initialize() {
StartupBrocadeVcsCommand sc = new StartupBrocadeVcsCommand();
sc.setGuid(_guid);
sc.setName(_name);
sc.setDataCenter(_zoneId);
sc.setPrivateIpAddress("");
sc.setStorageIpAddress("");
sc.setVersion(BrocadeVcsResource.class.getPackage().getImplementationVersion());
return new StartupCommand[] { sc };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class NetscalerResource method initialize.
@Override
public StartupCommand[] initialize() {
final StartupExternalLoadBalancerCommand cmd = new StartupExternalLoadBalancerCommand();
cmd.setName(_name);
cmd.setDataCenter(_zoneId);
cmd.setPod("");
cmd.setPrivateIpAddress(_ip);
cmd.setStorageIpAddress("");
cmd.setVersion(NetscalerResource.class.getPackage().getImplementationVersion());
cmd.setGuid(_guid);
return new StartupCommand[] { cmd };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class Ovm3HypervisorResource method initialize.
/*
* configure is called before this, does setup of the connection and
* gets the params.
*
* @see com.cloud.resource.ServerResource#initialize()
*/
@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[] {};
}
}
Aggregations