Bug 1017602 - Update VM NIC of a running VM accepts networks that don't exist on the host
Update VM NIC of a running VM accepts networks that don't exist on the host
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
x86_64 Linux
high Severity high
: ---
: 3.3.0
Assigned To: Moti Asayag
Depends On:
Blocks: 1019461 1023403 3.3snap2
  Show dependency treegraph
Reported: 2013-10-10 04:44 EDT by GenadiC
Modified: 2016-02-10 14:49 EST (History)
9 users (show)

See Also:
Fixed In Version: is21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
engine log (3.45 MB, text/x-log)
2013-10-10 04:44 EDT, GenadiC
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 20188 None None None Never
oVirt gerrit 20424 None None None Never

  None (edit)
Description GenadiC 2013-10-10 04:44:07 EDT
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:

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

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-/ 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 06:49:47 EDT
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 07:02:32 EDT
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"/>
Traceback (most recent call last):
  File "/usr/share/vdsm/vm.py", line 3138, in setLinkAndNetwork
  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 04:25:40 EDT
works in is21

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

Error while executing action:


    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 17:29:31 EST
Closing - RHEV 3.3 Released
Comment 5 Itamar Heim 2014-01-21 17:29:31 EST
Closing - RHEV 3.3 Released
Comment 6 Itamar Heim 2014-01-21 17:32:27 EST
Closing - RHEV 3.3 Released

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