Maor Lipchuk has uploaded a new change for review. Change subject: core: Force detach a storage domain ......................................................................
core: Force detach a storage domain Adding call for force detach Storage Domain before attaching the storage domain, so the SP_UUID in the storage domain meta data will before attaching it. Change-Id: Ie75293678ab08616208128ac157426d3d98c1b77 Signed-off-by: Maor Lipchuk <mlipc...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommand.java 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/29021/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommand.java index 6994972..9fa7ce5 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommand.java @@ -4,7 +4,6 @@ import java.util.List; import org.apache.commons.lang.StringUtils; - import org.ovirt.engine.core.bll.Backend; import org.ovirt.engine.core.common.FeatureSupported; import org.ovirt.engine.core.common.action.StorageDomainManagementParameter; @@ -15,9 +14,11 @@ import org.ovirt.engine.core.common.businessentities.StorageDomainType; import org.ovirt.engine.core.common.errors.VdcBllMessages; import org.ovirt.engine.core.common.utils.Pair; +import org.ovirt.engine.core.common.vdscommands.DetachStorageDomainVDSCommandParameters; import org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters; import org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainsListVDSCommandParameters; import org.ovirt.engine.core.common.vdscommands.VDSCommandType; +import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.dbbroker.DbFacade; @@ -44,6 +45,11 @@ @Override protected void executeCommand() { + // Master domain version is not relevant since force remove at DetachStorageDomainVdsCommand does not use it. + // Storage pool id can be empty + DetachStorageDomainVDSCommandParameters detachParams = new DetachStorageDomainVDSCommandParameters(getVds().getStoragePoolId(), getParameters().getStorageDomainId(), Guid.Empty, 0); + detachParams.setForce(true); + VDSReturnValue returnValue = runVdsCommand(VDSCommandType.DetachStorageDomain, detachParams); if (StringUtils.isEmpty(getStorageDomain().getStorage())) { getStorageDomain().setStorage( (String) Backend -- To view, visit http://gerrit.ovirt.org/29021 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie75293678ab08616208128ac157426d3d98c1b77 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches