Bug 1017602

Summary: Update VM NIC of a running VM accepts networks that don't exist on the host
Product: Red Hat Enterprise Virtualization Manager Reporter: GenadiC <gcheresh>
Component: ovirt-engineAssignee: Moti Asayag <masayag>
Status: CLOSED CURRENTRELEASE QA Contact: GenadiC <gcheresh>
Severity: high Docs Contact:
Priority: high    
Version: 3.3.0CC: acathrow, danken, gcheresh, iheim, lpeer, mpavlik, myakove, Rhev-m-bugs, yeylon
Target Milestone: ---   
Target Release: 3.3.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: network
Fixed In Version: is21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 1019461, 1023403, 1032811    
Attachments:
Description Flags
engine log none

Description GenadiC 2013-10-10 08:44:07 UTC
Created attachment 810375 [details]
engine log

Description of problem:
If you try to update the VNIC profile without unplugging VNIC you should get an explanational message that updating is possible only if you unplug the NIC first. Instead of that you get unexpected exception message

How reproducible:
Always

Steps to Reproduce:
1. Create VM with several VNICs with profiles on it
2. Try to change the VNIC profile on running VM without unpluggin VNIC first
3. 

Actual results:
You get unexpected exception message

Expected results:
Should have message that explains the reason of the failure

Additional info:
 ERROR [org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand] (ajp-/127.0.0.1:8702-6) Command org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand throw Vdc Bll exception. With error message VdcBLLException: org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException: VDSGenericException: VDSErrorException: Failed to UpdateVmInterfaceVDS, error = Unexpected exception (Failed with error unexpected and code 16)

Comment 1 Moti Asayag 2013-10-10 10:49:47 UTC
Please attach the vdsm.log from the host so we'll be able to see the failure reason reported from VDSM.

Comment 2 Moti Asayag 2013-10-10 11:02:32 UTC
The relevant piece from vdsm.log:

Thread-9342::DEBUG::2013-10-10 13:54:24,746::libvirtconnection::108::libvirtconnection::(wrapper) Unknown libvirterror: ecode: 9 edom: 10 level: 2 message: operation failed: bridge Blue doe
sn't exist
Thread-9342::DEBUG::2013-10-10 13:54:24,746::vm::3143::vm.Vm::(setLinkAndNetwork) vmId=`0dcf947f-85aa-43a4-864b-d4abb71a1a5f`::Request failed: <interface type="bridge">
        <address bus="0x00" domain="0x0000" function="0x0" slot="0x04" type="pci"/>
        <mac address="00:1a:4a:16:88:68"/>
        <model type="virtio"/>
        <source bridge="Blue"/>
        <filterref filter="vdsm-no-mac-spoofing"/>
        <link state="up"/>
</interface>
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 3138, in setLinkAndNetwork
    libvirt.VIR_DOMAIN_AFFECT_LIVE)
  File "/usr/share/vdsm/vm.py", line 835, in f
    ret = attr(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/vdsm/libvirtconnection.py", line 76, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1755, in updateDeviceFlags
    if ret == -1: raise libvirtError ('virDomainUpdateDeviceFlags() failed', dom=self)
libvirtError: operation failed: bridge Blue doesn't exist
Thread-9342::DEBUG::2013-10-10 13:54:24,747::vm::3150::vm.Vm::(setLinkAndNetwork) vmId=`0dcf947f-85aa-43a4-864b-d4abb71a1a5f`::Rolling back link and net for: net2
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 3145, in setLinkAndNetwork
    raise SetLinkAndNetworkError(e.message)
SetLinkAndNetworkError: operation failed: bridge Blue doesn't exist


The engine allows the user to select vnic profiles of a networks which aren't exist on the host, therefore the action fails with that error.

Fix should be applied to the engine, to verify the existence of the network if an update for the vm device is required.

A complementary fix will be presenting only the relevant list on the UI.

Comment 3 Martin Pavlik 2013-11-01 08:25:40 UTC
works in is21

if network with profile is not attached to the host, proper warning with explanation is shown

Error while executing action:

F19:

    The Network does not exist on the host the VM is running on.
    Either add the Network to the Host or migrate the VM to a Host that has this Network.

Comment 4 Itamar Heim 2014-01-21 22:29:31 UTC
Closing - RHEV 3.3 Released

Comment 5 Itamar Heim 2014-01-21 22:29:31 UTC
Closing - RHEV 3.3 Released

Comment 6 Itamar Heim 2014-01-21 22:32:27 UTC
Closing - RHEV 3.3 Released