Search in sources :

Example 1 with VdsStatic

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

the class JsonObjectSerializationEntitiesTest method data.

@Parameterized.Parameters
public static Object[] data() {
    RandomUtils random = RandomUtils.instance();
    VdsStatic vdsStatic = new VdsStatic(random.nextString(10), random.nextString(10), random.nextInt(), random.nextInt(), random.nextString(10), Guid.newGuid(), Guid.newGuid(), random.nextString(10), random.nextBoolean(), random.nextEnum(VDSType.class), Guid.newGuid());
    return new Object[] { vdsStatic, randomVdsDynamic(), randomVdsStatistics(), new VdsSpmIdMap(Guid.newGuid(), Guid.newGuid(), random.nextInt()), randomStorageDomainStatic(), new StorageDomainDynamic(random.nextInt(), Guid.newGuid(), random.nextInt()), randomStoragePool(), new StoragePoolIsoMap(Guid.newGuid(), Guid.newGuid(), random.nextEnum(StorageDomainStatus.class)), randomRole(), new IdContainerClass<>(new VdsSpmIdMap(Guid.newGuid(), Guid.newGuid(), random.nextInt())), new IdContainerClass<>(Guid.newGuid()) };
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) RandomUtils(org.ovirt.engine.core.utils.RandomUtils) VDSType(org.ovirt.engine.core.common.businessentities.VDSType) StoragePoolIsoMap(org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap) VdsSpmIdMap(org.ovirt.engine.core.common.businessentities.VdsSpmIdMap) StorageDomainDynamic(org.ovirt.engine.core.common.businessentities.StorageDomainDynamic) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus)

Example 2 with VdsStatic

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

the class BaseNetworkImplementationDetailsUtilsTest method setUpBefore.

@Before
public void setUpBefore() throws Exception {
    qosA = createAndMockQos(30, 30, 30);
    qosB = createAndMockQos(60, 60, 60);
    unlimitedHostNetworkQos = createQos(null, null, null);
    VdsStatic vdsStatic = new VdsStatic();
    vdsStatic.setId(VDS_ID);
    vdsStatic.setClusterId(CLUSTER_ID);
    VdsDynamic vdsDynamic = new VdsDynamic();
    cluster = new Cluster();
    cluster.setCompatibilityVersion(Version.v4_2);
    cluster.setId(CLUSTER_ID);
    when(vdsStaticDaoMock.get(eq(VDS_ID))).thenReturn(vdsStatic);
    when(vdsDynamicDaoMock.get(eq(VDS_ID))).thenReturn(vdsDynamic);
    when(clusterDaoMock.get(eq(CLUSTER_ID))).thenReturn(cluster);
    EffectiveHostNetworkQos effectiveHostNetworkQos = new EffectiveHostNetworkQos(hostNetworkQosDaoMock);
    networkImplementationDetailsUtils = new NetworkImplementationDetailsUtils(effectiveHostNetworkQos, networkAttachmentDaoMock, vdsStaticDaoMock, vdsDynamicDaoMock, clusterDaoMock, calculateBaseNic, this.defaultRouteUtil);
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Before(org.junit.Before)

Example 3 with VdsStatic

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

the class GetErrataCountsForHostQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    VdsStatic host = vdsStaticDao.get(getParameters().getId());
    if (host == null) {
        failWith(EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST);
        return;
    }
    Provider<?> provider = getHostProvider(host);
    if (provider == null) {
        failWith(EngineMessage.NO_FOREMAN_PROVIDER_FOR_HOST);
        return;
    }
    HostProviderProxy proxy = getHostProviderProxy(provider);
    ErrataData errataForHost = proxy.getErrataForHost(host.getHostName(), getParameters().getErrataFilter());
    setReturnValue(errataForHost.getErrataCounts());
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) ErrataData(org.ovirt.engine.core.common.businessentities.ErrataData) HostProviderProxy(org.ovirt.engine.core.bll.host.provider.HostProviderProxy)

Example 4 with VdsStatic

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

the class UpdateClusterCommand method updateDefaultNetworkProvider.

private void updateDefaultNetworkProvider() {
    if (getCluster().hasDefaultNetworkProviderId(getPrevCluster().getDefaultNetworkProviderId())) {
        return;
    }
    allForCluster.stream().filter(vds -> !Objects.equals(vds.getOpenstackNetworkProviderId(), getCluster().getDefaultNetworkProviderId())).forEach(vds -> {
        VdsStatic vdsStatic = vds.getStaticData();
        vdsStatic.setOpenstackNetworkProviderId(getCluster().getDefaultNetworkProviderId());
        vdsStatic.setReinstallRequired(true);
        vdsStaticDao.update(vdsStatic);
    });
}
Also used : ClusterDao(org.ovirt.engine.core.dao.ClusterDao) Arrays(java.util.Arrays) StringUtils(org.apache.commons.lang.StringUtils) UpdateEntity(org.ovirt.engine.core.common.validation.group.UpdateEntity) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) VmTemplateDao(org.ovirt.engine.core.dao.VmTemplateDao) VmStaticDao(org.ovirt.engine.core.dao.VmStaticDao) CommandContext(org.ovirt.engine.core.bll.context.CommandContext) ActionType(org.ovirt.engine.core.common.action.ActionType) MomPolicyUpdate(org.ovirt.engine.core.common.qualifiers.MomPolicyUpdate) HasRngDevice(org.ovirt.engine.core.common.action.HasRngDevice) Matcher(java.util.regex.Matcher) VdsDao(org.ovirt.engine.core.dao.VdsDao) ManagementNetworkOnClusterOperationParameters(org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters) OriginType(org.ovirt.engine.core.common.businessentities.OriginType) Map(java.util.Map) StoragePoolDao(org.ovirt.engine.core.dao.StoragePoolDao) Version(org.ovirt.engine.core.compat.Version) GlusterVolumeDao(org.ovirt.engine.core.dao.gluster.GlusterVolumeDao) DisplayType(org.ovirt.engine.core.common.businessentities.DisplayType) VdsActionParameters(org.ovirt.engine.core.common.action.VdsActionParameters) VmBase(org.ovirt.engine.core.common.businessentities.VmBase) VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate) EngineMessage(org.ovirt.engine.core.common.errors.EngineMessage) Set(java.util.Set) Collectors(java.util.stream.Collectors) VmDao(org.ovirt.engine.core.dao.VmDao) NetworkClusterValidatorBase(org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase) VdsStaticDao(org.ovirt.engine.core.dao.VdsStaticDao) GlusterVolumeEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity) Objects(java.util.Objects) List(java.util.List) MigrateOnErrorOptions(org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) VmRngDevice(org.ovirt.engine.core.common.businessentities.VmRngDevice) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) Optional(java.util.Optional) AuditLogType(org.ovirt.engine.core.common.AuditLogType) NetworkCluster(org.ovirt.engine.core.common.businessentities.network.NetworkCluster) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) Pattern(java.util.regex.Pattern) FeatureSupported(org.ovirt.engine.core.common.FeatureSupported) NetworkClusterDao(org.ovirt.engine.core.dao.network.NetworkClusterDao) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) ArchitectureType(org.ovirt.engine.core.common.businessentities.ArchitectureType) ResourceManager(org.ovirt.engine.core.vdsbroker.ResourceManager) LockProperties(org.ovirt.engine.core.common.action.LockProperties) UpdateVmTemplateParameters(org.ovirt.engine.core.common.action.UpdateVmTemplateParameters) Guid(org.ovirt.engine.core.compat.Guid) HashMap(java.util.HashMap) SupportedHostFeatureDao(org.ovirt.engine.core.dao.SupportedHostFeatureDao) DbFacade(org.ovirt.engine.core.dal.dbbroker.DbFacade) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Inject(javax.inject.Inject) CollectionUtils(org.apache.commons.collections.CollectionUtils) VmStatic(org.ovirt.engine.core.common.businessentities.VmStatic) Pair(org.ovirt.engine.core.common.utils.Pair) Config(org.ovirt.engine.core.common.config.Config) Event(javax.enterprise.event.Event) CompatibilityVersionUtils(org.ovirt.engine.core.common.utils.CompatibilityVersionUtils) LockingGroup(org.ovirt.engine.core.common.locks.LockingGroup) AuditLogDirector(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector) ConfigValues(org.ovirt.engine.core.common.config.ConfigValues) VersionSupport(org.ovirt.engine.core.bll.utils.VersionSupport) AuditLogable(org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable) SupportedAdditionalClusterFeature(org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature) VM(org.ovirt.engine.core.common.businessentities.VM) ClusterFeatureDao(org.ovirt.engine.core.dao.ClusterFeatureDao) PermissionSubject(org.ovirt.engine.core.bll.utils.PermissionSubject) ActionGroup(org.ovirt.engine.core.common.businessentities.ActionGroup) ClusterValidator(org.ovirt.engine.core.bll.validator.ClusterValidator) VmManagementParametersBase(org.ovirt.engine.core.common.action.VmManagementParametersBase) VmManager(org.ovirt.engine.core.vdsbroker.VmManager) Collections(java.util.Collections) VDS(org.ovirt.engine.core.common.businessentities.VDS) VMStatus(org.ovirt.engine.core.common.businessentities.VMStatus) RngDeviceUtils(org.ovirt.engine.core.bll.utils.RngDeviceUtils) VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic)

Example 5 with VdsStatic

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

the class BackendHostsResource method add.

@Override
public Response add(Host host) {
    validateParameters(host, "name", "address");
    VdsStatic staticHost = getMapper(Host.class, VdsStatic.class).map(host, null);
    staticHost.setClusterId(getClusterId(host));
    BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations(this, host.getExternalNetworkProviderConfigurations());
    AddVdsActionParameters addParams = new AddVdsActionParameters(staticHost, host.getRootPassword());
    if (host.isSetOverrideIptables()) {
        addParams.setOverrideFirewall(host.isOverrideIptables());
    }
    addParams.setHostedEngineDeployConfiguration(HostResourceParametersUtil.getHostedEngineDeployConfiguration(this));
    addParams = (AddVdsActionParameters) getMapper(Host.class, VdsOperationActionParameters.class).map(host, addParams);
    return performCreate(ActionType.AddVds, addParams, new QueryIdResolver<Guid>(QueryType.GetVdsByVdsId, IdQueryParameters.class));
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) Host(org.ovirt.engine.api.model.Host) VdsOperationActionParameters(org.ovirt.engine.core.common.action.VdsOperationActionParameters) Guid(org.ovirt.engine.core.compat.Guid) AddVdsActionParameters(org.ovirt.engine.core.common.action.hostdeploy.AddVdsActionParameters)

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