Bug 1957830

Summary: Creating thin disk from VM Portal on block storage fails
Product: Red Hat Enterprise Virtualization Manager Reporter: amashah
Component: ovirt-web-uiAssignee: Scott Dickerson <sdickers>
Status: CLOSED ERRATA QA Contact: Pavel Novotny <pnovotny>
Severity: high Docs Contact:
Priority: high    
Version: 4.4.5CC: aromito, emarcus, lsvaty, mavital, michal.skrivanek, pnovotny, sgratch
Target Milestone: ovirt-4.4.9Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-web-ui-1.7.2-1 Doc Type: Enhancement
Doc Text:
In this release, the VM Portal now allows creating preallocated or thin provisioned disk images on various types of storage domains.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:46:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: UX RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description amashah 2021-05-06 14:58:22 UTC
Description of problem:

Creating a thin-provision disk from VM Portal fails with the following error:

~~~
CREATE_DISK_FOR_VM failed [Cannot add Virtual Disk. Disk configuration (RAW Sparse backup-None) is incompatible with the storage domain type.]
~~~




In engine.log the following error is logged:

~~~
2021-05-06 10:45:22,334-04 WARN  [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (default task-17) [108bff7d-adac-4c3d-a5e6-80707bc4fec5] Validation of action 'AddDisk' failed for user admin@internal-authz. Reasons: VAR__ACTION__ADD,VAR__TYPE__DISK,ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED,$volumeFormat RAW,$volumeType Sparse,$backup None
2021-05-06 10:45:22,335-04 INFO  [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (default task-17) [108bff7d-adac-4c3d-a5e6-80707bc4fec5] Lock freed to object 'EngineLock:{exclusiveLocks='', sharedLocks='[7d7fd19f-d16c-45da-a41f-1c9f19d78f57=VM]'}'
2021-05-06 10:45:22,350-04 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-17) [] Operation Failed: [Cannot add Virtual Disk. Disk configuration (RAW Sparse backup-None) is incompatible with the storage domain type.]
~~~



When creating a thin provision disk from the Admin Portal, it works and creates a sparse COW as expected:

~~~
2021-05-06 10:49:20,390-04 INFO  [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (default task-23) [1718a91b-63d0-4e8c-977d-6939453f678e] Running command: AddDiskCommand internal: false. Entities affected :  ID: 04ccf3fb-dae9-40f6-b06a-f3f606ce804a Type: StorageAction group CREATE_DISK with role type USER
2021-05-06 10:49:20,452-04 INFO  [org.ovirt.engine.core.bll.storage.disk.image.AddImageFromScratchCommand] (default task-23) [1718a91b-63d0-4e8c-977d-6939453f678e] Running command: AddImageFromScratchCommand internal: true. Entities affected :  ID: 04ccf3fb-dae9-40f6-b06a-f3f606ce804a Type: Storage
2021-05-06 10:49:20,506-04 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.CreateVolumeVDSCommand] (default task-23) [1718a91b-63d0-4e8c-977d-6939453f678e] START, CreateVolumeVDSCommand( CreateVolumeVDSCommandParameters:{storagePoolId='9f57b888-d821-11ea-b14c-00163e13fb40', ignoreFailoverLimit='false', storageDomainId='04ccf3fb-dae9-40f6-b06a-f3f606ce804a', imageGroupId='b263c48e-59bf-4bc9-a12f-7fbe045517de', imageSizeInBytes='1073741824', volumeFormat='COW', newImageId='363b594b-2254-456d-8856-f5faf0f50537', imageType='Sparse', newImageDescription='{"DiskAlias":"delete","DiskDescription":""}', imageInitialSizeInBytes='0', imageId='00000000-0000-0000-0000-000000000000', sourceImageGroupId='00000000-0000-0000-0000-000000000000', shouldAddBitmaps='false'}), log id: 7c3f9349
~~~


The issue appears to be that disks created from the VM Portal on block storage using thin provision attempt to create raw/sparse instead of cow/sparse.



Version-Release number of selected component (if applicable):
4.4.5

How reproducible:
100%

Steps to Reproduce:
1. Try to create thin disk on iSCSI storage from VM Portal

Actual results:
VM portal fails, because it tries to create raw/sparse


Expected results:
It works and creates qcow2/sparse like Admin Portal does.

Additional info:

Comment 1 Lukas Svaty 2021-05-07 08:29:21 UTC
Lowering severity, as there is no data loss or 0day operation problem.
WA: pre-create disks via AdminPortal/API / use pre-allocate. Raising priority as this is core functionality.

Severity urgent:
"""
catastrophic issues which severely impact the mission-critical operations of an organization. This may mean that the operational servers, development systems or customer applications are down or not functioning and no procedural workaround exists.
"""

Comment 3 Sharon Gratch 2021-06-21 13:35:22 UTC
Unfortunately we didn't get to fix that for 4.4.7, postponing to 4.4.8

Comment 6 Scott Dickerson 2021-08-27 14:44:39 UTC
With https://github.com/oVirt/ovirt-web-ui/pull/1508 VM Portal will be aware of the disk
format/sparse values that are required for each type of storage domain.  Thin and Preallocated
disks will be mapped properly based on storage domain type (the important ones for this BZ
being 'file' and 'block' types).

Comment 9 Sharon Gratch 2021-10-25 13:16:16 UTC
Pavel, are you planning to verify this?

Comment 10 Pavel Novotny 2021-10-26 23:18:17 UTC
Verified in
ovirt-engine-4.4.9.3-0.3.el8ev.noarch
ovirt-web-ui-1.7.2-1.el8ev.noarch

Creating a thin provisioned disk on an ISCSI storage domain is successful.
I also successfully created provision & preallocated disks on ISCSI and NFS storages to make sure there are no regressions.

Comment 14 errata-xmlrpc 2021-11-16 14:46:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: RHV Manager (ovirt-engine) security update [ovirt-4.4.9]), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4626