use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class JuniperSrxResource method initialize.
@Override
public StartupCommand[] initialize() {
StartupExternalFirewallCommand cmd = new StartupExternalFirewallCommand();
cmd.setName(_name);
cmd.setDataCenter(_zoneId);
cmd.setPod("");
cmd.setPrivateIpAddress(_ip);
cmd.setStorageIpAddress("");
cmd.setVersion(JuniperSrxResource.class.getPackage().getImplementationVersion());
cmd.setGuid(_guid);
return new StartupCommand[] { cmd };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class VmwareResource method initialize.
@Override
public StartupCommand[] initialize() {
try {
String hostApiVersion = "4.1";
VmwareContext context = getServiceContext();
try {
VmwareHypervisorHost hyperHost = getHyperHost(context);
assert (hyperHost instanceof HostMO);
if (!((HostMO) hyperHost).isHyperHostConnected()) {
s_logger.info("Host " + hyperHost.getHyperHostName() + " is not in connected state");
return null;
}
((HostMO) hyperHost).enableVncOnHostFirewall();
AboutInfo aboutInfo = ((HostMO) hyperHost).getHostAboutInfo();
hostApiVersion = aboutInfo.getApiVersion();
} catch (Exception e) {
String msg = "VmwareResource intialize() failed due to : " + VmwareHelper.getExceptionMessage(e);
s_logger.error(msg);
invalidateServiceContext();
return null;
}
StartupRoutingCommand cmd = new StartupRoutingCommand();
fillHostInfo(cmd);
cmd.setHypervisorType(HypervisorType.VMware);
cmd.setCluster(_cluster);
cmd.setHypervisorVersion(hostApiVersion);
List<StartupStorageCommand> storageCmds = initializeLocalStorage();
StartupCommand[] answerCmds = new StartupCommand[1 + storageCmds.size()];
answerCmds[0] = cmd;
for (int i = 0; i < storageCmds.size(); i++) {
answerCmds[i + 1] = storageCmds.get(i);
}
return answerCmds;
} finally {
recycleServiceContext();
}
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class NiciraNvpResource method initialize.
@Override
public StartupCommand[] initialize() {
final StartupNiciraNvpCommand sc = new StartupNiciraNvpCommand();
sc.setGuid(guid);
sc.setName(name);
sc.setDataCenter(zoneId);
sc.setPod("");
sc.setPrivateIpAddress("");
sc.setStorageIpAddress("");
sc.setVersion(NiciraNvpResource.class.getPackage().getImplementationVersion());
return new StartupCommand[] { sc };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class AgentStorageResource method initialize.
@Override
public StartupCommand[] initialize() {
StartupSecondaryStorageCommand cmd = new StartupSecondaryStorageCommand();
cmd.setPrivateIpAddress(agentHost.getPrivateIpAddress());
cmd.setPrivateNetmask(agentHost.getPrivateNetMask());
cmd.setPrivateMacAddress(agentHost.getPrivateMacAddress());
cmd.setStorageIpAddress(agentHost.getStorageIpAddress());
cmd.setStorageNetmask(agentHost.getStorageNetMask());
cmd.setStorageMacAddress(agentHost.getStorageMacAddress());
cmd.setPublicIpAddress(agentHost.getPublicIpAddress());
cmd.setName(agentHost.getName());
cmd.setAgentTag("agent-simulator");
cmd.setVersion(agentHost.getVersion());
cmd.setDataCenter(String.valueOf(agentHost.getDataCenterId()));
cmd.setPod(String.valueOf(agentHost.getPodId()));
cmd.setGuid(agentHost.getGuid());
return new StartupCommand[] { cmd };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class SimulatorDiscoverer 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.Simulator) {
return null;
}
return _resourceMgr.fillRoutingHostVO(host, ssCmd, HypervisorType.Simulator, details, hostTags);
}
Aggregations