Search in sources :

Example 16 with Ovm3Configuration

use of com.cloud.hypervisor.ovm3.resources.helpers.Ovm3Configuration in project cloudstack by apache.

the class Ovm3HypervisorSupportTest method fillHostinfoTest.

@Test
public void fillHostinfoTest() throws ConfigurationException {
    Ovm3Configuration config = new Ovm3Configuration(configTest.getParams());
    ConnectionTest con = new ConnectionTest();
    con.setIp(config.getAgentIp());
    Ovm3HypervisorSupport hypervisor = new Ovm3HypervisorSupport(con, config);
    LinuxTest linuxTest = new LinuxTest();
    NetworkTest networkTest = new NetworkTest();
    StartupRoutingCommand srCmd = new StartupRoutingCommand();
    con.setResult(results.simpleResponseWrapWrapper(linuxTest.getDiscoverHw()));
    con.addResult(results.simpleResponseWrapWrapper(linuxTest.getDiscoverserver()));
    con.addResult(results.simpleResponseWrapWrapper(networkTest.getDiscoverNetwork()));
    hypervisor.fillHostInfo(srCmd);
}
Also used : LinuxTest(com.cloud.hypervisor.ovm3.objects.LinuxTest) ConnectionTest(com.cloud.hypervisor.ovm3.objects.ConnectionTest) StartupRoutingCommand(com.cloud.agent.api.StartupRoutingCommand) NetworkTest(com.cloud.hypervisor.ovm3.objects.NetworkTest) Test(org.junit.Test) ConnectionTest(com.cloud.hypervisor.ovm3.objects.ConnectionTest) LinuxTest(com.cloud.hypervisor.ovm3.objects.LinuxTest) NetworkTest(com.cloud.hypervisor.ovm3.objects.NetworkTest) XenTest(com.cloud.hypervisor.ovm3.objects.XenTest) Ovm3SupportTest(com.cloud.hypervisor.ovm3.support.Ovm3SupportTest) XmlTestResultTest(com.cloud.hypervisor.ovm3.objects.XmlTestResultTest)

Example 17 with Ovm3Configuration

use of com.cloud.hypervisor.ovm3.resources.helpers.Ovm3Configuration in project cloudstack by apache.

the class Ovm3HypervisorResource method configure.

/**
     * Base configuration of the plugins components.
     */
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
    LOGGER.debug("configure " + name + " with params: " + params);
    /* check if we're master or not and if we can connect */
    try {
        configuration = new Ovm3Configuration(params);
        if (!configuration.getIsTest()) {
            c = new Connection(configuration.getAgentIp(), configuration.getAgentOvsAgentPort(), configuration.getAgentOvsAgentUser(), configuration.getAgentOvsAgentPassword());
            c.setHostName(configuration.getAgentHostname());
        }
        hypervisorsupport = new Ovm3HypervisorSupport(c, configuration);
        if (!configuration.getIsTest()) {
            hypervisorsupport.setupServer(configuration.getAgentSshKeyFileName());
        }
        hypervisorsupport.masterCheck();
    } catch (Exception e) {
        throw new CloudRuntimeException("Base checks failed for " + configuration.getAgentHostname(), e);
    }
    hypervisornetwork = new Ovm3HypervisorNetwork(c, configuration);
    hypervisornetwork.configureNetworking();
    virtualroutingresource = new Ovm3VirtualRoutingResource(c);
    storagepool = new Ovm3StoragePool(c, configuration);
    storagepool.prepareForPool();
    storageprocessor = new Ovm3StorageProcessor(c, configuration, storagepool);
    vmsupport = new Ovm3VmSupport(c, configuration, hypervisorsupport, storageprocessor, storagepool, hypervisornetwork);
    vrResource = new VirtualRoutingResource(virtualroutingresource);
    if (!vrResource.configure(name, params)) {
        throw new ConfigurationException("Unable to configure VirtualRoutingResource");
    }
    guesttypes = new Ovm3VmGuestTypes();
    storageHandler = new StorageSubsystemCommandHandlerBase(storageprocessor);
    virtualroutingsupport = new Ovm3VirtualRoutingSupport(c, configuration, virtualroutingresource);
    setConfigParams(params);
    return true;
}
Also used : Connection(com.cloud.hypervisor.ovm3.objects.Connection) Ovm3HypervisorSupport(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3HypervisorSupport) Ovm3VirtualRoutingSupport(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VirtualRoutingSupport) VirtualRoutingResource(com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource) StorageSubsystemCommandHandlerBase(com.cloud.storage.resource.StorageSubsystemCommandHandlerBase) ConfigurationException(javax.naming.ConfigurationException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) Ovm3ResourceException(com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException) Ovm3VmSupport(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VmSupport) ConfigurationException(javax.naming.ConfigurationException) Ovm3VmGuestTypes(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3VmGuestTypes) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) Ovm3StoragePool(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3StoragePool) Ovm3HypervisorNetwork(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3HypervisorNetwork) Ovm3Configuration(com.cloud.hypervisor.ovm3.resources.helpers.Ovm3Configuration)

Aggregations

ConnectionTest (com.cloud.hypervisor.ovm3.objects.ConnectionTest)11 XenTest (com.cloud.hypervisor.ovm3.objects.XenTest)11 XmlTestResultTest (com.cloud.hypervisor.ovm3.objects.XmlTestResultTest)11 Ovm3SupportTest (com.cloud.hypervisor.ovm3.support.Ovm3SupportTest)11 Test (org.junit.Test)11 Ovm3Configuration (com.cloud.hypervisor.ovm3.resources.helpers.Ovm3Configuration)10 NetworkTest (com.cloud.hypervisor.ovm3.objects.NetworkTest)9 CloudStackPluginTest (com.cloud.hypervisor.ovm3.objects.CloudStackPluginTest)7 Ovm3ConfigurationTest (com.cloud.hypervisor.ovm3.resources.helpers.Ovm3ConfigurationTest)5 Answer (com.cloud.agent.api.Answer)4 LinuxTest (com.cloud.hypervisor.ovm3.objects.LinuxTest)4 GetHostStatsCommand (com.cloud.agent.api.GetHostStatsCommand)2 Ovm3HypervisorResourceTest (com.cloud.hypervisor.ovm3.resources.Ovm3HypervisorResourceTest)2 GetVmStatsCommand (com.cloud.agent.api.GetVmStatsCommand)1 MigrateCommand (com.cloud.agent.api.MigrateCommand)1 StartupCommand (com.cloud.agent.api.StartupCommand)1 StartupRoutingCommand (com.cloud.agent.api.StartupRoutingCommand)1 VirtualRoutingResource (com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource)1 Connection (com.cloud.hypervisor.ovm3.objects.Connection)1 Ovm3ResourceException (com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException)1