Search in sources :

Example 1 with StartupCommand

use of com.cloud.agent.api.StartupCommand in project CloudStack-archive by CloudStack-extras.

the class ConsoleProxyResource method initialize.

@Override
public synchronized StartupCommand[] initialize() {
    final StartupProxyCommand cmd = new StartupProxyCommand();
    fillNetworkInformation(cmd);
    cmd.setProxyPort(_proxyPort);
    cmd.setProxyVmId(_proxyVmId);
    if (_pubIp != null)
        cmd.setPublicIpAddress(_pubIp);
    return new StartupCommand[] { cmd };
}
Also used : StartupProxyCommand(com.cloud.agent.api.StartupProxyCommand) StartupCommand(com.cloud.agent.api.StartupCommand)

Example 2 with StartupCommand

use of com.cloud.agent.api.StartupCommand in project CloudStack-archive by CloudStack-extras.

the class DummyResource method initialize.

@Override
public StartupCommand[] initialize() {
    Map<String, VmState> changes = null;
    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, changes);
    fillNetworkInformation(cmd);
    cmd.getHostDetails().putAll(getVersionStrings());
    cmd.setCluster(getConfiguredProperty("cluster", "1"));
    StoragePoolInfo pi = initializeLocalStorage();
    StartupStorageCommand sscmd = new StartupStorageCommand();
    sscmd.setPoolInfo(pi);
    sscmd.setGuid(pi.getUuid());
    sscmd.setDataCenter((String) _params.get("zone"));
    sscmd.setResourceType(Storage.StorageResourceType.STORAGE_POOL);
    return new StartupCommand[] { cmd, sscmd };
}
Also used : StartupCommand(com.cloud.agent.api.StartupCommand) VmState(com.cloud.agent.api.StartupRoutingCommand.VmState) StartupStorageCommand(com.cloud.agent.api.StartupStorageCommand) StoragePoolInfo(com.cloud.agent.api.StoragePoolInfo) StartupRoutingCommand(com.cloud.agent.api.StartupRoutingCommand)

Example 3 with StartupCommand

use of com.cloud.agent.api.StartupCommand in project CloudStack-archive by CloudStack-extras.

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);
}
Also used : StartupCommand(com.cloud.agent.api.StartupCommand) StartupRoutingCommand(com.cloud.agent.api.StartupRoutingCommand)

Example 4 with StartupCommand

use of com.cloud.agent.api.StartupCommand in project CloudStack-archive by CloudStack-extras.

the class SimulatorSecondaryDiscoverer method createHostVOForDirectConnectAgent.

@Override
public HostVO createHostVOForDirectConnectAgent(HostVO host, StartupCommand[] startup, ServerResource resource, Map<String, String> details, List<String> hostTags) {
    //for detecting SSVM dispatch
    StartupCommand firstCmd = startup[0];
    if (!(firstCmd instanceof StartupSecondaryStorageCommand)) {
        return null;
    }
    host.setType(com.cloud.host.Host.Type.SecondaryStorageVM);
    return host;
}
Also used : StartupCommand(com.cloud.agent.api.StartupCommand) StartupSecondaryStorageCommand(com.cloud.agent.api.StartupSecondaryStorageCommand)

Example 5 with StartupCommand

use of com.cloud.agent.api.StartupCommand in project cloudstack by apache.

the class OvmResourceBase method initialize.

@Override
public StartupCommand[] initialize() {
    try {
        StartupRoutingCommand cmd = new StartupRoutingCommand();
        fillHostInfo(cmd);
        cmd.setCaps("hvm");
        return new StartupCommand[] { cmd };
    } catch (Exception e) {
        s_logger.debug("Ovm resource initializes failed", e);
        return null;
    }
}
Also used : StartupCommand(com.cloud.agent.api.StartupCommand) StartupRoutingCommand(com.cloud.agent.api.StartupRoutingCommand) XmlRpcException(org.apache.xmlrpc.XmlRpcException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) IOException(java.io.IOException) URISyntaxException(java.net.URISyntaxException) ConfigurationException(javax.naming.ConfigurationException)

Aggregations

StartupCommand (com.cloud.agent.api.StartupCommand)60 StartupRoutingCommand (com.cloud.agent.api.StartupRoutingCommand)28 StartupStorageCommand (com.cloud.agent.api.StartupStorageCommand)16 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)9 ConfigurationException (javax.naming.ConfigurationException)7 Command (com.cloud.agent.api.Command)6 StartupSecondaryStorageCommand (com.cloud.agent.api.StartupSecondaryStorageCommand)6 PingCommand (com.cloud.agent.api.PingCommand)5 HostVO (com.cloud.host.HostVO)5 URISyntaxException (java.net.URISyntaxException)5 Request (com.cloud.agent.transport.Request)4 AgentControlCommand (com.cloud.agent.api.AgentControlCommand)3 PingRoutingCommand (com.cloud.agent.api.PingRoutingCommand)3 ShutdownCommand (com.cloud.agent.api.ShutdownCommand)3 StartCommand (com.cloud.agent.api.StartCommand)3 StartupProxyCommand (com.cloud.agent.api.StartupProxyCommand)3 StoragePoolHostVO (com.cloud.storage.StoragePoolHostVO)3 CheckRouterCommand (com.cloud.agent.api.CheckRouterCommand)2 CheckS2SVpnConnectionsCommand (com.cloud.agent.api.CheckS2SVpnConnectionsCommand)2 CronCommand (com.cloud.agent.api.CronCommand)2