Bug 1410019 - Disks with illegal Pass Discard value are not logged
Summary: Disks with illegal Pass Discard value are not logged
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: future
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Idan Shaby
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 08:43 UTC by Idan Shaby
Modified: 2017-03-16 14:48 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-16 14:48:16 UTC
oVirt Team: Storage
rule-engine: ovirt-4.1+
tnisan: devel_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 69546 0 master MERGED backend: move illegal Pass Discard logging to AddVmCommand 2017-01-09 16:12:14 UTC
oVirt gerrit 69547 0 master MERGED backend: log disks with illegal Pass Discard on ImportVmTemplate 2017-01-09 16:12:11 UTC
oVirt gerrit 69548 0 master MERGED backend: log disks with illegal Pass Discard on RestoreFromSnapshot 2017-01-09 16:12:17 UTC
oVirt gerrit 69888 0 ovirt-engine-4.1 MERGED backend: move illegal Pass Discard logging to AddVmCommand 2017-01-10 12:47:15 UTC
oVirt gerrit 69889 0 ovirt-engine-4.1 MERGED backend: log disks with illegal Pass Discard on ImportVmTemplate 2017-01-10 12:47:24 UTC
oVirt gerrit 69890 0 ovirt-engine-4.1 MERGED backend: log disks with illegal Pass Discard on RestoreFromSnapshot 2017-01-10 12:47:20 UTC

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!


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