Bug 1408727 - Manage unattached Storage Domain throws NPE
Summary: Manage unattached Storage Domain throws NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-beta
: ---
Assignee: Maor
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-26 18:51 UTC by Maor
Modified: 2017-02-15 14:52 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-15 14:52:50 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 68680 0 None None None 2016-12-26 18:55:26 UTC
oVirt gerrit 69172 0 ovirt-engine-4.1 MERGED core: Fix NPE on manage domains for unattached SD. 2016-12-27 11:53:41 UTC
oVirt gerrit 69306 0 master MERGED webadmin: fix NPE when editing an unattached sd 2016-12-29 15:16:52 UTC
oVirt gerrit 69312 0 ovirt-engine-4.1 MERGED webadmin: fix NPE when editing an unattached sd 2017-01-01 09:17:02 UTC

Description Maor 2016-12-26 18:51:33 UTC
Description of problem:
Since unattached SD has no storage pool validate of
DiscardAfterDeleteSupportedByDcVersion throws an NPE.

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


How reproducible:
100%

Steps to Reproduce:
1. Create storage domain and don't attach it to a Data Center
2. Try to edit the Storage Domain (For example change its description)
3.

Actual results:
We get a general exception message in the GUI and an NPE is being thrown in the engine log

Expected results:
update of unattached SD should succeed

Additional info:

Comment 1 Raz Tamir 2017-01-22 19:06:40 UTC
Maor,
I tried to edit the domain's (unattached domain) description and it blocked with the following message:
"Error while executing action: Cannot edit Storage. Can only update the following fields: name, description, comment, wipe after delete, low space threshold, and critical space threshold."

from the engine.log:
2017-01-22 21:00:53,527+02 WARN  [org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand] (default task-12) [fca85241-e14c-48bb-8212-a655b3ce3642] There was an attempt to update the following fields al
though they are not allowed to be updated: storageFormat
2017-01-22 21:00:53,528+02 WARN  [org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand] (default task-12) [fca85241-e14c-48bb-8212-a655b3ce3642] Validation of action 'UpdateStorageDomain' failed for user admin@internal-authz. Reasons: VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__UPDATE,ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS

Comment 2 Maor 2017-01-23 08:44:29 UTC
(In reply to Raz Tamir from comment #1)
> Maor,
> I tried to edit the domain's (unattached domain) description and it blocked
> with the following message:
> "Error while executing action: Cannot edit Storage. Can only update the
> following fields: name, description, comment, wipe after delete, low space
> threshold, and critical space threshold."
> 
> from the engine.log:
> 2017-01-22 21:00:53,527+02 WARN 
> [org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand]
> (default task-12) [fca85241-e14c-48bb-8212-a655b3ce3642] There was an
> attempt to update the following fields al
> though they are not allowed to be updated: storageFormat
> 2017-01-22 21:00:53,528+02 WARN 
> [org.ovirt.engine.core.bll.storage.domain.UpdateStorageDomainCommand]
> (default task-12) [fca85241-e14c-48bb-8212-a655b3ce3642] Validation of
> action 'UpdateStorageDomain' failed for user admin@internal-authz. Reasons:
> VAR__TYPE__STORAGE__DOMAIN,VAR__ACTION__UPDATE,
> ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS

You were trying to update the storageFormat as well, and update the storage format is not part of the reproduce steps.
Also there was no NPE which was thrown.

While you update the storage domain please check that the storage format does not change as well while the storage domain is being updated.

Regarding the storageFormat update, 
The upgrade process manages the storage format update as an internal operation while the storage pool is being upgraded or while attaching the storage domain to a Data Center, the user never do it him self, so I think it is sounds reasonable to make it as non-editable.

of course if you think otherwise you are welcome to open a separate bug and I will change the behavior as we think it will be best.

Comment 3 Raz Tamir 2017-01-25 10:05:41 UTC
After check with Maor, the issue in comment #1 applied to SD with V1 only.
I will open a separate bug.
Verified on 4.1.0.2-0.2.el7


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