Search in sources :

Example 6 with HSMGetStorageDomainInfoVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters in project ovirt-engine by oVirt.

the class BlockStorageDomainHelper method fillMetadataDevicesInfo.

public void fillMetadataDevicesInfo(StorageDomainStatic storageDomainStatic, Guid vdsId) {
    try {
        @SuppressWarnings("unchecked") StorageDomainStatic domainFromIrs = ((Pair<StorageDomainStatic, Guid>) resourceManager.runVdsCommand(VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(vdsId, storageDomainStatic.getId())).getReturnValue()).getFirst();
        storageDomainStatic.setFirstMetadataDevice(domainFromIrs.getFirstMetadataDevice());
        storageDomainStatic.setVgMetadataDevice(domainFromIrs.getVgMetadataDevice());
    } catch (Exception e) {
        storageDomainStatic.setFirstMetadataDevice(null);
        storageDomainStatic.setVgMetadataDevice(null);
        log.info("Failed to get the domain info");
    }
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) HSMGetStorageDomainInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters) Pair(org.ovirt.engine.core.common.utils.Pair)

Example 7 with HSMGetStorageDomainInfoVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters in project ovirt-engine by oVirt.

the class AddStoragePoolWithStoragesCommand method isStorageDomainAttachedToStoragePool.

private boolean isStorageDomainAttachedToStoragePool(StorageDomain storageDomain) {
    try {
        VDSReturnValue vdsReturnValue = runVdsCommand(VDSCommandType.HSMGetStorageDomainInfo, new HSMGetStorageDomainInfoVDSCommandParameters(getVdsId(), storageDomain.getId()));
        if (!vdsReturnValue.getSucceeded()) {
            logErrorMessage(storageDomain);
        }
        Pair<StorageDomainStatic, Guid> domainFromIrs = (Pair<StorageDomainStatic, Guid>) vdsReturnValue.getReturnValue();
        if (domainFromIrs.getSecond() != null) {
            return true;
        }
    } catch (RuntimeException e) {
        logErrorMessage(storageDomain);
    }
    return false;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) HSMGetStorageDomainInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters) Guid(org.ovirt.engine.core.compat.Guid) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue) Pair(org.ovirt.engine.core.common.utils.Pair)

Aggregations

StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)7 HSMGetStorageDomainInfoVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters)7 Pair (org.ovirt.engine.core.common.utils.Pair)6 Guid (org.ovirt.engine.core.compat.Guid)5 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)4 ArrayList (java.util.ArrayList)3 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)3 HashSet (java.util.HashSet)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 StoragePoolWithStoragesParameter (org.ovirt.engine.core.common.action.StoragePoolWithStoragesParameter)1 OvfEntityData (org.ovirt.engine.core.common.businessentities.OvfEntityData)1 SANState (org.ovirt.engine.core.common.businessentities.SANState)1 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)1 StoragePoolIsoMap (org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap)1 StoragePoolIsoMapId (org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId)1 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 AttachStorageDomainVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.AttachStorageDomainVDSCommandParameters)1 DetachStorageDomainVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.DetachStorageDomainVDSCommandParameters)1 HSMGetStorageDomainsListVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainsListVDSCommandParameters)1