Bug 917522

Summary: [RHEVM] [backend] VNIC plug/unplug is incorrectly reported in logs
Product: Red Hat Enterprise Virtualization Manager Reporter: Martin Pavlik <mpavlik>
Component: ovirt-engineAssignee: Alona Kaplan <alkaplan>
Status: CLOSED ERRATA QA Contact: Martin Pavlik <mpavlik>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, dyasny, gklein, iheim, lpeer, masayag, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---Keywords: Improvement
Target Release: 3.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: network
Fixed In Version: sf13.1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-10 21:34:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 948448    
Attachments:
Description Flags
log_collector
none
screenshot 1 none

Description Martin Pavlik 2013-03-04 09:28:11 UTC
Created attachment 704825 [details]
log_collector

Description of problem:

1) When VNIC is unplugged from a VM, log message says plugged=true and when VNIC is plugged, plugged=false (See Additional info for full log line)

Hotplug itself works fine, just the log is wrong.

2) GUI event message could be improved

now it says that VNIC was updated, but does not say how
Interface nic2 (Red Hat VirtIO) was updated for VM F18. (User: admin@internal)

if possible change it to

Interface nic2 (Red Hat VirtIO) was plugged for VM F18. (User: admin@internal)
Interface nic2 (Red Hat VirtIO) was unplugged for VM F18. (User: admin@internal)

- see screenshot


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

How reproducible:
100%

Steps to Reproduce:
1. Create VM with 1 VNIC and OS supporting hotplug
2. Start VM and plug/unplug the VNIC
  
Actual results:
plugged = false in log when VNIC is plugged
plugged = true in log when VNIC is NOT plugged

Expected results:
plugged = true in log when VNIC is plugged
plugged = false in log when VNIC is NOT plugged


Additional info:

It would be nice if all boolean values were grouped together in the following log line

2013-03-04 09:17:31,009 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.HotUnplugNicVDSCommand] (ajp-/127.0.0.1:8702-8) [1a4b1955] START, HotUnplugNicVDSCommand(HostName = dell-06, HostId = 4ebe3c1b-6fb7-4de6-8045-3459fad14131, vm.vm_name=F18, nic=VmNetworkInterface {id=9ef89efd-6073-4fa0-9ac5-902c301ed7d6, networkName=rhevm, speed=1000, type=3, name=nic2, macAddress=00:1a:4a:22:3f:29, active=true, linked=true, portMirroring=false, vmId=be00921f-365f-42bb-99d0-b33b4a097c1b, vmName=F18, vmTemplateId=null}, vmDevice=VmDevice {vmId=be00921f-365f-42bb-99d0-b33b4a097c1b, deviceId=9ef89efd-6073-4fa0-9ac5-902c301ed7d6, device=bridge, type=interface, bootOrder=0, specParams={}, address={bus=0x00, domain=0x0000, type=pci, slot=0x08, function=0x0}, managed=true, plugged=true, readOnly=false, deviceAlias=net0}), log id: bd82abd
2013-03-04 09:17:31,315 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.HotUnplugNicVDSCommand] (ajp-/127.0.0.1:8702-8) [1a4b1955] FINISH, HotUnplugNicVDSCommand, log id: bd82abd

Comment 1 Martin Pavlik 2013-03-04 09:29:15 UTC
Created attachment 704826 [details]
screenshot 1

Comment 2 Moti Asayag 2013-03-06 09:55:51 UTC
Regarding 1: the printed nic properties are part of log mechanism which prints the entity passed to VDS command. It reflects the current value of the property, prior to the execution. Therefore if the nic should be plugged, its 'plugged' property value would be 'false', since this is its actual value.

If it causes any confusion, we can remove the properties from the log for this specific action.

Regarding 2: There are 2 separate commands which are equivalent to performed commands: The Add/Update command and the Activate/Deactivate command.
The log should present both of them when performing plug/unplug via the Add/Update vnic commands. And basically this is what is shown on the log: 
'Deactivate nic' message followed by 'Update nic' message - two messages which reflects the performed actions.

Comment 3 Martin Pavlik 2013-03-06 13:38:24 UTC
Hello Moti,
thanks for the clarification

1) I would not remove it, I consider more information better in this case

2) I think problem is the word "activate/deactivate" since it appears after "plug/unplug" action in the GUI

If activate/deactivate could be changed to plug/unplug, it would be perfect.

Comment 4 Martin Pavlik 2013-03-06 13:39:59 UTC
Please ignore comment 3, I see you already did it.

Comment 5 Martin Pavlik 2013-04-11 14:43:49 UTC
VERIFIED

Network Interface nic1 (Red Hat VirtIO) was unplugged from VM F18. (User: admin@internal)

Network Interface nic1 (Red Hat VirtIO) was plugged to VM F18. (User: admin@internal)

Comment 8 errata-xmlrpc 2013-06-10 21:34:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0888.html