Bug 1258547 - If block disk alias or description is too long, disk metadata will be truncated, causing various failures
If block disk alias or description is too long, disk metadata will be truncat...
Product: ovirt-engine
Classification: oVirt
Component: General (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: ovirt-3.6.0-rc
: 3.6.0
Assigned To: Idan Shaby
Eyal Shenitzky
Depends On: 1258097
  Show dependency treegraph
Reported: 2015-08-31 11:31 EDT by Idan Shaby
Modified: 2016-03-10 10:18 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Too long disk alias and/or description used to be sent to vdsm without any check. Consequence: vdsm used to truncated them silently and caused a corruption in the volume's metadata. Fix: Too long alias and/or description are truncated in the engine side so that the maximum length of the json disk description field sent to vdsm is now limited to 210 bytes. The priority is given to the alias. That means that we read the alias first, and only if there's enough space, we take a part of/the entire description. If the alias is too long, it will be truncated and the description will not be sent to vdsm at all. Result: There's no corruption in the volume's metadata.
Story Points: ---
Clone Of: 1258097
Last Closed: 2015-11-27 02:53:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45471 master MERGED storage_exception: Show data in MetadataOverflowError Never
oVirt gerrit 45472 master MERGED blockVolume: Fail if metadata overflows Never
oVirt gerrit 45501 master MERGED volume: Support older engine or disks with long description Never
oVirt gerrit 45551 master MERGED core: limit disk alias and description for disk metadata Never
oVirt gerrit 45899 ovirt-engine-3.6 MERGED core: limit disk alias and description for disk metadata Never
oVirt gerrit 45925 ovirt-engine-3.5 MERGED core: limit disk alias and description for disk metadata Never

  None (edit)
Description Idan Shaby 2015-08-31 11:31:05 EDT
+++ This bug was initially created as a clone of Bug #1258097 +++

Description of problem:

Disk alias maximum size is 255 characters, and description is 500 characters.
These values are stored in disk metadata in the shared storage since ovirt
3.5. However, on block storage we have only about 250 bytes free.

When entering long values into these fields, the disk metadata is truncated
silently. The truncated data may become invalid, failing various operations
with the disk, and the alias and description becomes unreadable.

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

How reproducible:

Steps to Reproduce:
1. Create disk with alias or description of 250-300 ascii characters
   (Vdsm does not support non-ascii alias and description)

Actual results:
Disk is created on storage, but metadata is truncated and invalid.

Expected results:
Disk should not be created, and MetadataOverflowError should be returned to engine.

Additional info:
This porblem exists since first vdsm version, but it became a bigger problem
since ovirt 3.5 since disk alias is stored now in the disk metadata on 
the shared storage.

There is a mismatch between the ovirt-engine database size limits to the size
of disk metadata. In storage domain format 3, we cannot store the full disk
alias and description in the shared storage.

This issue should be fixed both in engine (to support older vdsm versions) and
in vdsm (to support older engines). This bug is only about the vdsm side.
The engine side bug is tracked in a separate bug.

This BZ was created for the engine side of the bug.
Comment 1 Allon Mureinik 2015-09-13 08:47:21 EDT
Tal, are we still waiting for anything for the 3.6 patch?
Comment 2 Tal Nisan 2015-09-30 10:14:23 EDT
Nope, all is merged 3.6 as well as 3.5.z
Comment 3 Idan Shaby 2015-11-11 10:24:00 EST
To verify:
1. Create a storage domain (two scenarios - file and block).
2. Create a disk on that domain with alias and description of specific length (see the doc text for the different cases). 
3. Take it down to maintenance and destroy it.
4. Import the storage domain.
5. Register the disk you previously created (http://www.ovirt.org/Features/ImportStorageDomain#Register_an_unregistered_disk).
6. Verify that the disk's alias and description are as expected, i.e. restored fully if they fit or cut if they overflow the max metadata DiskDescription length (210 bytes).

Another test can be to follow only steps 1 and 2, and then verify that the disk metadata "DiskDescription" field is a complete and legal json string, i.e.:

Note that using too long disk alias/description might fail according to BZ 1280358, so use shorter names to avoid that issue.
Comment 4 Eyal Shenitzky 2015-11-15 09:54:35 EST
both test passed.
checked on engine version:
Comment 5 Sandro Bonazzola 2015-11-27 02:53:48 EST
Since oVirt 3.6.0 has been released, moving from verified to closed current release.

Note You need to log in before you can comment on or make changes to this bug.