Bug 1410019

Summary: Disks with illegal Pass Discard value are not logged
Product: [oVirt] ovirt-engine Reporter: Idan Shaby <ishaby>
Component: Backend.CoreAssignee: Idan Shaby <ishaby>
Status: CLOSED CURRENTRELEASE QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: medium Docs Contact:
Priority: unspecified    
Version: futureCC: bugs, gklein, ishaby, tnisan
Target Milestone: ovirt-4.1.0-betaFlags: rule-engine: ovirt-4.1+
tnisan: devel_ack+
Target Release: 4.1.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-16 14:48:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Idan Shaby 2017-01-04 08:43:17 UTC
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.

Comment 1 Yaniv Kaul 2017-01-04 10:27:03 UTC
What is an illegal pass discard value exactly?

Comment 2 Idan Shaby 2017-01-04 11:57:19 UTC
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.

Comment 3 Kevin Alon Goldblatt 2017-02-23 15:24:35 UTC
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!