This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1294354 - [Text] - Improve the format of the error message for detaching networks that are in use by VMs from SetupNetwork
[Text] - Improve the format of the error message for detaching networks that ...
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine
Classification: oVirt
Component: BLL.Network (Show other bugs)
3.6.2
x86_64 Linux
medium Severity medium (vote)
: ovirt-4.1.0-beta
: 4.1.0.2
Assigned To: Edward Haas
Michael Burman
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-27 08:51 EST by Michael Burman
Modified: 2017-02-01 09:35 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-01 09:35:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.1+


Attachments (Terms of Use)
screenshots (346.12 KB, application/x-gzip)
2015-12-27 08:51 EST, Michael Burman
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 54967 master MERGED engine: error message improvement for detach network 2016-08-18 06:59 EDT
oVirt gerrit 62390 master MERGED engine: Add a replaceWith method for custom seperator 2016-08-18 06:02 EDT

  None (edit)
Description Michael Burman 2015-12-27 08:51:38 EST
Created attachment 1109819 [details]
screenshots

Description of problem:
[Text] - Improve the format of the error message for detaching networks that are in use by VMs from SetupNetwork. 

Currently when detaching 1 network from 1 VM while this network is used by the VM, the error message looks OK , for example -->

"Cannot setup Networks. The following Logical Network: 'net-1' is being used by the following VM: 'v1'. Please stop the VM and try again."

But, if we have more then 1 network and 1 VM involved, the error message looks pretty bad and the order of the sentence is inconsistent (singular vs plural), for example :

"Cannot setup Networks. The following VMs are actively using the Logical Networks 'net-1,
qosvlan2' : 'v2,
v3,
v4'. Please stop the VMs and try again."

- We have 2 issues here:
1) Singular, the sentence starts with: 'The following Logical Network'
Plural, the sentence starts with:  'The following VMs' 
and it becomes very messy to understand. 
It should be consistent for all scenarios. 
'The following Logical Network/s is being/are being used by the following VM/VMs' 

2) In case of multiple Networks and VMs, the error message looks not aligned.
each network get it's own line in the error, the same for the VMs.
This should be fixed and improved.  
  
Version-Release number of selected component (if applicable):
3.6.2-0.1.el6

How reproducible:
100

Steps to Reproduce:
1. Detach 1 network from 1 VM while it being used by the VM
2. Detach 2 networks from 1 VM while it being used by the VM
3. Detach 2 networks from 2 VMs while it being used by the VMs

Actual results:
1 - Error message is OK
2 - Sentence starts with "The following VMs" instead of "The following Logical Network/s"
Each network name gets it's own line in the error. 
3 - Sentence starts with "The following VMs" instead of "The following Logical Network/s" 
Each network and VM name gets it's own line in the error.

The more networks and VMs you will have, the more lines will appear in the error message. 

The same will be shown in the engine.log.

2015-12-27 15:28:47,062 WARN  [org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand] (ajp-/127.0.0.1:8702-9) [b3166bf] CanDoAction of action 'HostSetupNetworks' failed for user admin@internal. Reasons: VAR__ACTION__SETUP,VAR__TYPE__NETWORKS,MULTIPLE_NETWORKS_CANNOT_DETACH_NETWORKS_USED_BY_VMS,$networkNames  net-1,
        qosvlan2,$networkNames_COUNTER 2,$vmNames       v2,
        v3,
        v4,$vmNames_COUNTER 3

Expected results:
All of this should be improved and fixed. There should be consistency between single network/VM and multiple networks/VMs.
Comment 1 Edward Haas 2016-03-20 07:09:47 EDT
Is this format acceptable: (?)

Cannot setup Networks. The following Logical Network(s): ' vmnet0' are being used by the following VM(s): ' VM0' . Please stop the VM(s) and try again.

Cannot setup Networks. The following Logical Network(s): ' vmnet0, vmnet1' are being used by the following VM(s): ' VM0' . Please stop the VM(s) and try again.

Cannot setup Networks. The following Logical Network(s): ' vmnet0, vmnet1' are being used by the following VM(s): ' VM0, VM1' . Please stop the VM(s) and try again.
Comment 2 Michael Burman 2016-03-20 07:36:29 EDT
Yes, indeed)
Comment 3 Sandro Bonazzola 2016-05-02 05:49:00 EDT
Moving from 4.0 alpha to 4.0 beta since 4.0 alpha has been already released and bug is not ON_QA.
Comment 4 Yaniv Lavi (Dary) 2016-05-23 09:13:37 EDT
oVirt 4.0 beta has been released, moving to RC milestone.
Comment 5 Dan Kenigsberg 2016-12-19 03:48:29 EST
It has been fixed and merged long ago.
Comment 6 Michael Burman 2016-12-19 07:33:03 EST
Verified on - 4.1.0-0.2.master.20161214234138.gitc23fdcc.el7.centos

"Cannot setup Networks. The following Logical Network: ' n1' is being used by the following VM(s): ' ro2, ro1, ro3' . Please stop the VM(s) and try again."

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