Search in sources :

Example 1 with ExtendStorageDomainVDSCommandParameters

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

the class ExtendSANStorageDomainCommand method executeCommand.

@Override
protected void executeCommand() {
    executeInNewTransaction(() -> {
        setStorageDomainStatus(StorageDomainStatus.Locked, getCompensationContext());
        getCompensationContext().stateChanged();
        return null;
    });
    runVdsCommand(VDSCommandType.ExtendStorageDomain, new ExtendStorageDomainVDSCommandParameters(getStoragePoolId(), getStorageDomain().getId(), getParameters().getLunIds(), getParameters().isForce()));
    updateLunsList();
    executeInNewTransaction(() -> {
        for (LUNs lun : getParameters().getLunsList()) {
            lunHelper.proceedLUNInDb(lun, getStorageDomain().getStorageType(), getStorageDomain().getStorage());
        }
        setStorageDomainStatus(StorageDomainStatus.Active, null);
        getCompensationContext().cleanupCompensationDataAfterSuccessfulCommand();
        return null;
    });
    setSucceeded(true);
}
Also used : LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) ExtendStorageDomainVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.ExtendStorageDomainVDSCommandParameters)

Aggregations

LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)1 ExtendStorageDomainVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.ExtendStorageDomainVDSCommandParameters)1