Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS not supporting MoveOrCopy command #482

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import org.ovirt.engine.core.dao.DiskImageDao;
import org.ovirt.engine.core.dao.DiskVmElementDao;
import org.ovirt.engine.core.dao.ImageStorageDomainMapDao;
import org.ovirt.engine.core.dao.SnapshotDao;
import org.ovirt.engine.core.dao.StorageDomainDao;
import org.ovirt.engine.core.dao.UnregisteredDisksDao;
import org.ovirt.engine.core.dao.VmDao;
Expand Down Expand Up @@ -101,8 +100,6 @@ public class MoveOrCopyDiskCommand<T extends MoveOrCopyImageGroupParameters> ext
@Inject
private VmDao vmDao;
@Inject
private SnapshotDao snapshotDao;
@Inject
@Typed(ConcurrentChildCommandsExecutionCallback.class)
private Instance<ConcurrentChildCommandsExecutionCallback> callbackProvider;

Expand Down Expand Up @@ -173,7 +170,21 @@ && checkCanBeMoveInVm()
&& checkIfNeedToBeOverride()
&& setAndValidateDiskProfiles()
&& setAndValidateQuota()
&& validatePassDiscardSupportedForDestinationStorageDomain();
&& validatePassDiscardSupportedForDestinationStorageDomain()
&& noCopyBetweenLocalAndManagedBlockStorages();
}

protected boolean noCopyBetweenLocalAndManagedBlockStorages() {
Guid sourceDomainId = getParameters().getSourceDomainId();
StorageDomain sourceStorageDomain = storageDomainDao.getForStoragePool(sourceDomainId, getImage().getStoragePoolId());

if (getStorageDomain().getStorageType() == StorageType.MANAGED_BLOCK_STORAGE
&& sourceStorageDomain.getStorageType() == StorageType.LOCALFS || getStorageDomain().getStorageType() == StorageType.LOCALFS
&& sourceStorageDomain.getStorageType() == StorageType.MANAGED_BLOCK_STORAGE) {
return failValidation(EngineMessage.ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_BETWEEN_MANAGED_BLOCK_STORAGE_TYPE_AND_LOCAL_STORAGE);
}

return true;
}

protected boolean isSourceAndDestTheSame() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ public enum EngineMessage {
ACTION_TYPE_FAILED_STORAGE_DOMAIN_AND_CLUSTER_IN_DIFFERENT_POOL(ErrorType.BAD_PARAMETERS),
ACTION_TYPE_FAILED_VDS_NOT_IN_DEST_STORAGE_POOL(ErrorType.BAD_PARAMETERS),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST(ErrorType.BAD_PARAMETERS),
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_BETWEEN_MANAGED_BLOCK_STORAGE_TYPE_AND_LOCAL_STORAGE(ErrorType.NOT_SUPPORTED),
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FOR_MANAGED_BLOCK_STORAGE_TYPE(ErrorType.NOT_SUPPORTED),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST(ErrorType.BAD_PARAMETERS),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS(ErrorType.CONFLICT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ public interface AppErrors extends ConstantsWithLookup {

String ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FOR_MANAGED_BLOCK_STORAGE_TYPE();

String ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_BETWEEN_MANAGED_BLOCK_STORAGE_TYPE_AND_LOCAL_STORAGE();

String ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST();

String ACTION_TYPE_FAILED_NO_SUITABLE_DOMAIN_FOUND();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS=Cannot ${action}
ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST=Cannot ${action} ${type}. Storage connection is not attached to the specified domain.
ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY=Cannot ${action} ${type}. Storage connection id is empty.
ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST=Cannot ${action} ${type}. Storage connection doesn't exist.
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_BETWEEN_MANAGED_BLOCK_STORAGE_TYPE_AND_LOCAL_STORAGE=Cannot ${action} ${type}. Copying data between Local Storage and Managed Block Storage is not supported.
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FOR_MANAGED_BLOCK_STORAGE_TYPE=Cannot ${action} ${type}. Managed Block Storage does not support this operation.
ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_RUNNING_VMS=Cannot ${action} ${type}. VMs ${vmNames} should be down.
ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_RUNNING_VMS_AND_DOMAINS_STATUS=Cannot ${action} ${type}. The data domains ${domainNames} should be in maintenance or unattached, and VMs ${vmNames} should be down.
Expand Down