Search in sources :

Example 26 with VdsStatic

use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.

the class NetworkImplementationDetailsUtils method getCluster.

private Cluster getCluster(Guid vdsId) {
    VdsStatic vdsStatic = vdsStaticDao.get(vdsId);
    Guid clusterId = vdsStatic.getClusterId();
    return clusterDao.get(clusterId);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) Guid(org.ovirt.engine.core.compat.Guid)

Example 27 with VdsStatic

use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.

the class HostUpgradeCallback method getHostName.

private String getHostName(Guid hostId) {
    if (hostName == null) {
        VdsStatic host = DbFacade.getInstance().getVdsStaticDao().get(hostId);
        hostName = host == null ? null : host.getName();
    }
    return hostName;
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic)

Example 28 with VdsStatic

use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.

the class RegisterVdsQuery method registerNewHost.

private boolean registerNewHost(Guid clusterId, boolean pending) {
    boolean returnValue = true;
    VdsStatic vds = new VdsStatic(getParameters().getVdsHostName(), getStrippedVdsUniqueId(), getParameters().getVdsPort(), getParameters().getSSHPort(), getParameters().getSSHUser(), clusterId, Guid.Empty, getParameters().getVdsName(), Config.<Boolean>getValue(ConfigValues.SSLEnabled), VDSType.VDS, null);
    vds.setSshKeyFingerprint(getParameters().getSSHFingerprint());
    log.debug("RegisterVdsQuery::register - Will try now to add VDS from scratch; Name: '{}', Hostname: '{}', Unique: '{}', VdsPort: '{}',Subnet mask: '{}', isPending: '{}' with force synchronize", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId(), getParameters().getVdsPort(), pending);
    AddVdsActionParameters p = new AddVdsActionParameters(vds, "");
    p.setPending(pending);
    ActionReturnValue ret = Backend.getInstance().runInternalAction(ActionType.AddVds, p);
    if (!ret.getSucceeded()) {
        log.error("RegisterVdsQuery::register - Registration failed for VDS - Name: '{}', Hostname: '{}', UniqueID: '{}', Subnet mask: '{}'", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId());
        captureCommandErrorsToLogger(ret, "RegisterVdsQuery::register");
        error = AuditLogType.VDS_REGISTER_FAILED;
        returnValue = false;
    } else {
        log.info("RegisterVdsQuery::register - Registered a new VDS '{}' - Name: '{}', Hostname: '{}', UniqueID: '{}'", pending ? "pending approval" : "automatically approved", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId());
    }
    return returnValue;
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)

Example 29 with VdsStatic

use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.

the class GetGlusterServersForImportQueryTest method getVdsStatic.

private VdsStatic getVdsStatic() {
    VdsStatic vds = new VdsStatic();
    vds.setId(Guid.newGuid());
    vds.setHostName(NEW_SERVER);
    return vds;
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic)

Example 30 with VdsStatic

use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.

the class ReplaceGlusterVolumeBrickCommandTest method getVdsStatic.

private VdsStatic getVdsStatic() {
    VdsStatic vds = new VdsStatic();
    vds.setClusterId(clusterId);
    vds.setHostName(serverName);
    return vds;
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic)

Aggregations

VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)49 Test (org.junit.Test)10 Guid (org.ovirt.engine.core.compat.Guid)8 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 Map (java.util.Map)3 Objects (java.util.Objects)3 Before (org.junit.Before)3 HostProviderProxy (org.ovirt.engine.core.bll.host.provider.HostProviderProxy)3 VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)3 GlusterVolumeEntity (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity)3 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Inject (javax.inject.Inject)2 StringUtils (org.apache.commons.lang.StringUtils)2 Host (org.ovirt.engine.api.model.Host)2