use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class ConsoleProxyResource method initialize.
@Override
public synchronized StartupCommand[] initialize() {
final StartupProxyCommand cmd = new StartupProxyCommand();
fillNetworkInformation(cmd);
cmd.setProxyPort(this._proxyPort);
cmd.setProxyVmId(this._proxyVmId);
cmd.setVersion(ConsoleProxyResource.class.getPackage().getImplementationVersion());
if (this._pubIp != null) {
cmd.setPublicIpAddress(this._pubIp);
}
return new StartupCommand[] { cmd };
}
use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class NfsSecondaryStorageResource method initialize.
@Override
public StartupCommand[] initialize() {
final StartupSecondaryStorageCommand cmd = new StartupSecondaryStorageCommand();
fillNetworkInformation(cmd);
cmd.setVersion(NfsSecondaryStorageResource.class.getPackage().getImplementationVersion());
if (this._publicIp != null) {
cmd.setPublicIpAddress(this._publicIp);
}
if (this._inSystemVM) {
final Script command = new Script("/bin/bash", s_logger);
command.add("-c");
command.add("ln -sf " + this._parent + " /var/www/html/copy");
final String result = command.execute();
if (result != null) {
s_logger.warn("Error in linking err=" + result);
return null;
}
}
return new StartupCommand[] { cmd };
}
use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class StorageCapacityListener method processConnect.
@Override
public void processConnect(final Host server, final StartupCommand[] startupCommands, final boolean forRebalance) {
for (final StartupCommand startupCommand : startupCommands) {
if (!(startupCommand instanceof StartupStorageCommand)) {
return;
}
final StartupStorageCommand ssCmd = (StartupStorageCommand) startupCommand;
if (ssCmd.getResourceType() == StorageResourceType.STORAGE_HOST) {
final BigDecimal overProvFactor = BigDecimal.valueOf(CapacityManager.StorageOverprovisioningFactor.value());
final CapacityVO capacity = new CapacityVO(server.getId(), server.getDataCenterId(), server.getPodId(), server.getClusterId(), 0L, (overProvFactor.multiply(new BigDecimal(server.getTotalSize()))).longValue(), Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED);
_capacityDao.persist(capacity);
}
}
}
use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class KvmDummyResourceBase method initialize.
@Override
public StartupCommand[] initialize() {
final StartupRoutingCommand cmd = new StartupRoutingCommand(0, 0, 0, null, HypervisorType.KVM, new HashMap<>());
cmd.setDataCenter(this._zoneId);
cmd.setPod(this._podId);
cmd.setCluster(this._clusterId);
cmd.setGuid(this._guid);
cmd.setName(this._agentIp);
cmd.setPrivateIpAddress(this._agentIp);
cmd.setStorageIpAddress(this._agentIp);
cmd.setVersion(KvmDummyResourceBase.class.getPackage().getImplementationVersion());
return new StartupCommand[] { cmd };
}
use of com.cloud.legacymodel.communication.command.startup.StartupCommand in project cosmic by MissionCriticalCloud.
the class LibvirtServerDiscoverer method createHostVOForConnectedAgent.
@Override
public HostVO createHostVOForConnectedAgent(final HostVO host, final StartupCommand[] cmd) {
final StartupCommand firstCmd = cmd[0];
if (!(firstCmd instanceof StartupRoutingCommand)) {
return null;
}
final StartupRoutingCommand ssCmd = ((StartupRoutingCommand) firstCmd);
if (ssCmd.getHypervisorType() != getHypervisorType()) {
return null;
}
/* KVM requires host are the same in cluster */
final ClusterVO clusterVO = this._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());
}
this._hostDao.loadDetails(host);
return this._resourceMgr.fillRoutingHostVO(host, ssCmd, getHypervisorType(), host.getDetails(), null);
}
Aggregations