Bug 1408920 - Discard after delete should be checked when attaching a storage domain to a data center
Summary: Discard after delete should be checked when attaching a storage domain to a d...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: future
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Idan Shaby
QA Contact: Lilach Zitnitski
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-28 06:54 UTC by Idan Shaby
Modified: 2017-02-15 14:51 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-15 14:51:23 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 68701 0 master MERGED core: Validate discard after delete on attach. 2016-12-28 10:18:37 UTC
oVirt gerrit 69227 0 ovirt-engine-4.1 MERGED core: Validate discard after delete on attach. 2017-01-01 10:22:32 UTC

Description Idan Shaby 2016-12-28 06:54:45 UTC
Description of problem:
When attaching a storage domain to a data center, the value of "Discard After Delete" (DAD) is not checked.
Therefore, a scenario of attaching a storage domain with an illegal DAD to a data center may be possible.

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

How reproducible:
100%

Steps to Reproduce:
1. Have an unattached storage domain with its DAD value enabled.
3. Attach the storage domain to a dc <= 4.0.

Actual results:
Operation is not blocked.

Expected results:
Should be blocked.

Comment:
There's no conventional way to create an unattached storage domain with it's DAD value enabled and attach it to a <= 4.0 dc.
The reason for this is that when a storage domain is created, it is created with a host that belongs to a certain dc. If the host belongs to a <= 4.0 dc, even if the underlying storage of the storage domain supports discard it will save its luns in the db as luns that do not support discard because the DAD property is not supported in <= 4.0 dc. Thus, when trying to update such unattached storage domains we get an error message telling us about the underlying storage that doesn't support discard.
Regarding a 4.1 dc, one can create an unattached storage domain with its DAD value enabled but then cannot attach it to a < 4.1 dc because of the storage version.
Therefore, there is no conventional way to perform the steps to reproduce anyway but changing the db. But since we want to be on the safe side, this theoretical bug should be fixed so that if we find about such a possible scenario, it will be blocked right when attaching the storage domain to a dc.

Comment 1 Lilach Zitnitski 2017-02-08 06:44:22 UTC
--------------------------------------
Tested with the following code:
----------------------------------------

rhevm-4.1.0.3-0.1.el7.noarch
vdsm-4.19.4-1.el7ev.x86_64

Tested with the following scenario:

Steps to Reproduce:
1. create unattached storage domain and update the db to enable the discard data  
2. attach the storage domain to dc <= 4.0

Actual results:
error telling discard data is not supported in this dc version
Error while executing action: Cannot attach Storage. Discard after delete is not supported by data center version 4.0.

when trying to attach the same sd to 4.1 dc it completes.
when trying to attach sd with discard enabled and v4 version it can't be attached to dc < 4.1 

Expected results:

Moving to VERIFIED!


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