Description of problem: Disks with illegal Pass Discard value should be logged when: - Cloning a vm - Creating a thin vm from a template - Creating a vm from a snapshot - Importing a vm template from an export domain. - Restoring a snapshot Version-Release number of selected component (if applicable): d187d588364417cd93c81e5b7c2d5f16f9ac29fb How reproducible: 100% Steps to Reproduce: 1. Have a vm with a disk that has its Pass Discard property enabled. 2. Then try each of the cases from the description of the problem, where each time the target vm should contain a disk with an illegal Pass Discard value. Actual results: No audit log is shown. Expected results: An audit log should be showed to warn the user about this situation.
What is an illegal pass discard value exactly?
Good point - I opened this BZ and BZ 1410017 on a similar issue together and explained what it means only in the other BZ. Generally, Pass Discard is illegal in a few cases: - Unsupported interface - Unsupported disk storage type. - Storage that does not support discard. - Storage that does not support the property that discard zeroes the data when WAD is enabled. But in this BZ there's no need to check all of these. Here we can use the simplest way to achieve an illegal value of Pass Discard which is using a storage domain that does not support discard. For example, when importing a vm template from an export domain, if one of the template's disks has its Pass Discard enabled and you choose as a target storage domain a storage domain that does not support discard, the operation will not be blocked because you may not have other storage domains at that time and we don't want to make the template unusable. Thus, you'll get a situation where you have a vm template that contains a disk on a storage domain that does not support discard, and that is considered as an illegal Pass Discard value. So after the vm template is created, an audit log should be shown and warn you about this situation. The same goes with, for example, clone vm - you should have a vm that contains a disk with an illegal Pass Discard value and clone it. To get such a vm you can, for example, import a vm from an export domain to a target storage domain that, again, does not support discard.
Verified with the following code: ------------------------------------- ovirt-engine-4.1.1-0.1.el7.noarch rhevm-4.1.1-0.1.el7.noarch vdsm-4.19.5-1.el7ev.x86_64 Verified with the following scenario: ------------------------------------------- isks with illegal Pass Discard value should be logged when: - Cloning a vm - Creating a cloned vm from a template - Creating a vm from a snapshot - Could not do this as the GUI won't let you - Importing a vm template from an export domain. - Restoring a snapshot Moving to VERIFIED!