use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class BaremetalDhcpResourceBase method initialize.
@Override
public StartupCommand[] initialize() {
StartupExternalDhcpCommand cmd = new StartupExternalDhcpCommand();
cmd.setName(_name);
cmd.setDataCenter(_zoneId);
cmd.setPrivateIpAddress(_ip);
cmd.setStorageIpAddress("");
cmd.setVersion("");
cmd.setGuid(_guid);
return new StartupCommand[] { cmd };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class Ovm3HypervisorResourceTest method initializeTest.
/* gives an IOException on ssh */
@Test
public void initializeTest() throws Exception {
Ovm3Configuration config = new Ovm3Configuration(configTest.getParams());
con = support.prepConnectionResults();
hypervisor.setConnection(con);
results.basicBooleanTest(hypervisor.configure(config.getAgentName(), configTest.getParams()));
con.setIp(config.getAgentIp());
for (StartupCommand start : hypervisor.initialize()) {
assertNotNull(start);
}
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class KvmDummyResourceBase method initialize.
@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 };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class LibvirtServerDiscoverer method createHostVOForConnectedAgent.
@Override
public HostVO createHostVOForConnectedAgent(HostVO host, StartupCommand[] cmd) {
StartupCommand firstCmd = cmd[0];
if (!(firstCmd instanceof StartupRoutingCommand)) {
return null;
}
StartupRoutingCommand ssCmd = ((StartupRoutingCommand) firstCmd);
if (ssCmd.getHypervisorType() != getHypervisorType()) {
return null;
}
/* KVM requires host are the same in cluster */
ClusterVO clusterVO = _clusterDao.findById(host.getClusterId());
if (clusterVO == null) {
s_logger.debug("cannot find cluster: " + host.getClusterId());
throw new IllegalArgumentException("cannot add host, due to can't find cluster: " + host.getClusterId());
}
List<HostVO> hostsInCluster = _resourceMgr.listAllHostsInCluster(clusterVO.getId());
if (!hostsInCluster.isEmpty()) {
HostVO oneHost = hostsInCluster.get(0);
_hostDao.loadDetails(oneHost);
String hostOsInCluster = oneHost.getDetail("Host.OS");
String hostOs = ssCmd.getHostDetails().get("Host.OS");
if (!hostOsInCluster.equalsIgnoreCase(hostOs)) {
throw new IllegalArgumentException("Can't add host: " + firstCmd.getPrivateIpAddress() + " with hostOS: " + hostOs + " into a cluster," + "in which there are " + hostOsInCluster + " hosts added");
}
}
_hostDao.loadDetails(host);
return _resourceMgr.fillRoutingHostVO(host, ssCmd, getHypervisorType(), host.getDetails(), null);
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class LocalSecondaryStorageResource method initialize.
@Override
public StartupCommand[] initialize() {
final StartupStorageCommand cmd = new StartupStorageCommand(_parent, StoragePoolType.Filesystem, 1024l * 1024l * 1024l * 1024l, _dlMgr.gatherTemplateInfo(_parent));
cmd.setResourceType(Storage.StorageResourceType.LOCAL_SECONDARY_STORAGE);
cmd.setIqn("local://");
fillNetworkInformation(cmd);
cmd.setDataCenter(_dc);
cmd.setPod(_pod);
cmd.setGuid(_guid);
cmd.setName(_guid);
cmd.setVersion(LocalSecondaryStorageResource.class.getPackage().getImplementationVersion());
return new StartupCommand[] { cmd };
}
Aggregations