use of com.cloud.agent.api.StartupCommand in project CloudStack-archive by CloudStack-extras.
the class LibvirtComputingResource method initialize.
@Override
public StartupCommand[] initialize() {
Map<String, State> changes = null;
synchronized (_vms) {
_vms.clear();
changes = sync();
}
final List<Object> info = getHostInfo();
final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), (Long) info.get(4), (String) info.get(3), HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal);
cmd.setStateChanges(changes);
fillNetworkInformation(cmd);
_privateIp = cmd.getPrivateIpAddress();
cmd.getHostDetails().putAll(getVersionStrings());
cmd.setPool(_pool);
cmd.setCluster(_clusterId);
cmd.setGatewayIpAddress(_localGateway);
StartupStorageCommand sscmd = null;
try {
KVMStoragePool localStoragePool = _storagePoolMgr.createStoragePool(_localStorageUUID, "localhost", _localStoragePath, StoragePoolType.Filesystem);
com.cloud.agent.api.StoragePoolInfo pi = new com.cloud.agent.api.StoragePoolInfo(localStoragePool.getUuid(), cmd.getPrivateIpAddress(), _localStoragePath, _localStoragePath, StoragePoolType.Filesystem, localStoragePool.getCapacity(), localStoragePool.getUsed());
sscmd = new StartupStorageCommand();
sscmd.setPoolInfo(pi);
sscmd.setGuid(pi.getUuid());
sscmd.setDataCenter(_dcId);
sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
} catch (CloudRuntimeException e) {
}
if (sscmd != null) {
return new StartupCommand[] { cmd, sscmd };
} else {
return new StartupCommand[] { cmd };
}
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class NuageVspResource method initialize.
@Override
public StartupCommand[] initialize() {
StartupVspCommand sc = new StartupVspCommand();
sc.setGuid(_guid);
sc.setName(_name);
sc.setDataCenter(_zoneId);
sc.setPod("");
sc.setPrivateIpAddress("");
sc.setStorageIpAddress("");
sc.setVersion(NuageVspResource.class.getPackage().getImplementationVersion());
return new StartupCommand[] { sc };
}
use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.
the class OpenDaylightControllerResource method initialize.
@Override
public StartupCommand[] initialize() {
StartupOpenDaylightControllerCommand sc = new StartupOpenDaylightControllerCommand();
sc.setGuid((String) configuration.get("guid"));
sc.setName(getName());
sc.setDataCenter((String) configuration.get("zoneId"));
sc.setPod("");
sc.setPrivateIpAddress("");
sc.setStorageIpAddress("");
sc.setVersion(OpenDaylightControllerResource.class.getPackage().getImplementationVersion());
return new StartupCommand[] { sc };
}
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);
}
}
Aggregations