Bug 1478806

Summary: Failed to run VM with long name network or with special characters name network
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Leon Goldberg <lgoldber>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: high Docs Contact:
Priority: high    
Version: ---CC: bugs
Target Milestone: ovirt-4.1.6Flags: rule-engine: ovirt-4.1+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-19 10:02:07 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:
Attachments:
Description Flags
vdsm log none

Description Michael Burman 2017-08-07 07:17:44 UTC
Created attachment 1309931 [details]
vdsm log

Description of problem:
Failed to run VM with long name network or with special characters name network.

When trying to run VM with name that has special characters, for example: net1*

2017-08-07 09:51:57,227+0300 ERROR (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') The vm start process failed (vm:631)
Traceback (most recent call last):
  File "/usr/share/vdsm/virt/vm.py", line 562, in _startUnderlyingVm
    self._run()
  File "/usr/share/vdsm/virt/vm.py", line 2022, in _run
    self._connection.createXML(domxml, flags),
  File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 123, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 944, in wrapper
    return func(inst, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3567, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: Cannot get interface MTU on 'net1*': No such device
2017-08-07 09:51:57,234+0300 INFO  (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') Changed state to Down: Cannot get interface MTU on 'net1*': No such device (code=1) (vm:1221)
2017-08-07 09:51:57,234+0300 INFO  (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') Stopping connection (guestagent:430)

If the network name is long, for example: eeeeeeeeeeeeeeeee5%&@ we fail with:
2017-08-07 10:10:09,763+0300 ERROR (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') The vm start process failed (vm:631)
Traceback (most recent call last):
  File "/usr/share/vdsm/virt/vm.py", line 562, in _startUnderlyingVm
    self._run()
  File "/usr/share/vdsm/virt/vm.py", line 2022, in _run
    self._connection.createXML(domxml, flags),
  File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 123, in wrapper
    ret = f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 944, in wrapper
    return func(inst, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3567, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirtError: Network interface name 'eeeeeeeeeeeeeeeee5%&@' is too long: Numerical result out of range
2017-08-07 10:10:09,766+0300 INFO  (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') Changed state to Down: Network interface name 'eeeeeeeeeeeeeeeee5%&@' is too long: Numerical result out of r
ange (code=1) (vm:1221)
2017-08-07 10:10:09,766+0300 INFO  (vm/a7b9e633) [virt.vm] (vmId='a7b9e633-eeb6-4f49-b812-da8ce04f474e') Stopping connection (guestagent:430)

Version-Release number of selected component (if applicable):
vdsm-4.20.2-33.gite85019b.el7.centos
vdsm-4.19.26-1.el7ev

How reproducible:
100%

Steps to Reproduce:
1. Create network net1* and network eeeeeeeeeeeeeeeee5%&@
2. Attach both networks to the host
3. Try to run VM with one of those networks

Actual results:
Failed

Expected results:
Should work

Comment 1 Michael Burman 2017-08-07 07:38:18 UTC
Engine must pass vdsm_name and not network name

Comment 2 Michael Burman 2017-08-28 13:36:56 UTC
Verified on -  4.1.6-0.1.el7