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.
-------------------------------------- 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!