Bug 1258547 - If block disk alias or description is too long, disk metadata will be truncated, causing various failures
Summary: If block disk alias or description is too long, disk metadata will be truncat...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Idan Shaby
QA Contact: Eyal Shenitzky
URL:
Whiteboard: storage
Depends On: 1258097
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-31 15:31 UTC by Idan Shaby
Modified: 2016-03-10 15:18 UTC (History)
13 users (show)

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.
Clone Of: 1258097
Environment:
Last Closed: 2015-11-27 07:53:48 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-3.6.0+
ylavi: planning_ack+
rule-engine: devel_ack+
rule-engine: testing_ack+


Attachments (Terms of Use)


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

Description Idan Shaby 2015-08-31 15:31:05 UTC
+++ 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):
Any

How reproducible:
Always

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 12:47:21 UTC
Tal, are we still waiting for anything for the 3.6 patch?

Comment 2 Tal Nisan 2015-09-30 14:14:23 UTC
Nope, all is merged 3.6 as well as 3.5.z

Comment 3 Idan Shaby 2015-11-11 15:24:00 UTC
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.:
DiskDescription={...}

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 14:54:35 UTC
both test passed.
checked on engine version: 3.6.0.3-0.1.el6

Comment 5 Sandro Bonazzola 2015-11-27 07:53:48 UTC
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.