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 Jul 21, 2022
1 parent ba24e65 commit 469129b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,23 @@ && 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) {
return failValidation(EngineMessage.ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_FROM_MANAGED_BLOCK_STORAGE_TYPE);
}

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

return true;
}

protected boolean isSourceAndDestTheSame() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ 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_FROM_MANAGED_BLOCK_STORAGE_TYPE(ErrorType.NOT_SUPPORTED),
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_TO_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),
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 @@ -523,7 +523,9 @@ 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_FOR_MANAGED_BLOCK_STORAGE_TYPE=Cannot ${action} ${type}. Managed Block Storage is not supported this operation.
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_FROM_MANAGED_BLOCK_STORAGE_TYPE=Cannot ${action} ${type} from Managed Block Storage. Managed Block Storage does not support this operation.
ACTION_TYPE_FAILED_UNSUPPORTED_ACTION_TO_MANAGED_BLOCK_STORAGE_TYPE=Cannot ${action} ${type} to Managed Block Storage. Managed Block Storage does 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.
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 469129b

Please sign in to comment.