Skip to content

Commit

Permalink
core: MBS not supporting MoveOrCopy command
Browse files Browse the repository at this point in the history
If User will try to move or copy a disk int to MBS (this operation is not supported yet)
he will get the error 'Cannot copy Virtual Disk. Managed Block Storage is not supported this operation'

Bug-Url: https://bugzilla.redhat.com/2077666
Signed-off-by: Artiom Divak <adivak@redhat.com>
  • Loading branch information
ArtiomDivak committed Aug 2, 2022
1 parent 995f4a0 commit 094bb91
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,21 @@ && checkCanBeMoveInVm()
&& checkIfNeedToBeOverride()
&& setAndValidateDiskProfiles()
&& setAndValidateQuota()
&& validatePassDiscardSupportedForDestinationStorageDomain();
&& validatePassDiscardSupportedForDestinationStorageDomain()
&& isCopyWithLocalDc();
}

protected boolean isCopyWithLocalDc() {
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 @@ -914,6 +914,7 @@ public enum EngineMessage {
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_FOR_MANAGED_BLOCK_STORAGE_TYPE(ErrorType.NOT_SUPPORTED),
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_BETWEEN_MANAGED_BLOCK_STORAGE_TYPE_AND_LOCAL_STORAGE(ErrorType.NOT_SUPPORTED),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST(ErrorType.BAD_PARAMETERS),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS(ErrorType.CONFLICT),
ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS(ErrorType.CONFLICT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,10 @@ public interface AppErrors extends ConstantsWithLookup {

String ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FOR_MANAGED_BLOCK_STORAGE_TYPE();

String ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FROM_MANAGED_BLOCK_STORAGE_TYPE();

String ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_TO_MANAGED_BLOCK_STORAGE_TYPE();

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 @@ -525,6 +525,7 @@ ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST=Cannot ${action} ${ty
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_FOR_MANAGED_BLOCK_STORAGE_TYPE=Cannot ${action} ${type}. Managed Block Storage does not support this operation.
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_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.
ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE_TYPE=Cannot ${action} ${type}. Storage connection parameters can be edited only for NFS, Posix, local or iSCSI data domains.
Expand Down

0 comments on commit 094bb91

Please sign in to comment.