Search in sources :

Example 1 with SyncLunsParameters

use of org.ovirt.engine.core.common.action.SyncLunsParameters in project ovirt-engine by oVirt.

the class SyncAllUsedLunsCommand method syncStorageDomainsLuns.

private void syncStorageDomainsLuns(List<LUNs> deviceList) {
    SyncLunsParameters parameters = new SyncLunsParameters(getParameters().getStoragePoolId(), deviceList);
    runInternalAction(ActionType.SyncAllStorageDomainsLuns, parameters);
}
Also used : SyncLunsParameters(org.ovirt.engine.core.common.action.SyncLunsParameters)

Example 2 with SyncLunsParameters

use of org.ovirt.engine.core.common.action.SyncLunsParameters in project ovirt-engine by oVirt.

the class UpdateStoragePoolCommand method syncAllUsedLunsInStoragePool.

/**
 * Synchronizes all the direct luns that are attached to a vm in the storage pool,
 * and all the active block storage domains' luns.
 */
private void syncAllUsedLunsInStoragePool() {
    if (discardInformationWasIntroduced() || reduceDeviceFromStorageDomainWasIntroduced()) {
        if (getOldStoragePool().getStatus() == StoragePoolStatus.Up) {
            /*
                - We don't want to fail the whole storage pool upgrade because some of the
                  luns could not be synced, so SyncAllUsedLuns only logs errors on such cases.
                 */
            runInternalAction(ActionType.SyncAllUsedLuns, new SyncLunsParameters(getStoragePoolId()));
        } else {
            List<DiskLunMap> diskLunMapsForVmsInPool = diskLunMapDao.getDiskLunMapsForVmsInPool(getStoragePoolId());
            if (!diskLunMapsForVmsInPool.isEmpty()) {
                addCustomValue("DirectLunDisksIds", diskLunMapsForVmsInPool.stream().map(DiskLunMap::getDiskId).map(Guid::toString).collect(Collectors.joining(", ")));
                auditLogDirector.log(this, AuditLogType.DIRECT_LUNS_COULD_NOT_BE_SYNCED);
            }
        }
    }
}
Also used : SyncLunsParameters(org.ovirt.engine.core.common.action.SyncLunsParameters) Guid(org.ovirt.engine.core.compat.Guid) DiskLunMap(org.ovirt.engine.core.common.businessentities.storage.DiskLunMap)

Aggregations

SyncLunsParameters (org.ovirt.engine.core.common.action.SyncLunsParameters)2 DiskLunMap (org.ovirt.engine.core.common.businessentities.storage.DiskLunMap)1 Guid (org.ovirt.engine.core.compat.Guid)1