Bug 1408464 - [10.0.z] nova creates an invalid ethernet/bridge interface definition in virsh xml
Summary: [10.0.z] nova creates an invalid ethernet/bridge interface definition in virs...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: z2
: 10.0 (Newton)
Assignee: Artom Lifshitz
QA Contact: Prasanth Anbalagan
URL:
Whiteboard:
: 1422278 (view as bug list)
Depends On: 1412834
Blocks: 1415954 1416881 1416884 1416886 1416887 1422563 1431252
TreeView+ depends on / blocked
 
Reported: 2016-12-23 14:23 UTC by RHOS Integration
Modified: 2019-09-09 13:15 UTC (History)
15 users (show)

Fixed In Version: openstack-nova-14.0.3-5.el7ost
Doc Type: Bug Fix
Doc Text:
With this update, XML generated by the Compute service is now fully compatible with libvirt 2.0.0. Instances spawned prior to this update will need to have their XML regenerated through a hard reboot, rebuild, or unshelve operation in order to be compatible.
Clone Of:
: 1416881 1416884 1416886 1416887 (view as bug list)
Environment:
Last Closed: 2017-02-23 21:15:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1649527 0 None None None 2016-12-23 14:23:21 UTC
OpenStack gerrit 411936 0 None MERGED libvirt: avoid generating script with empty path 2020-09-14 15:51:51 UTC
Red Hat Product Errata RHBA-2017:0319 0 normal SHIPPED_LIVE openstack-nova bug fix advisory 2017-02-24 02:12:47 UTC

Description RHOS Integration 2016-12-23 14:23:13 UTC
Cloned from launchpad bug 1649527.

Description:

Description
===========

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/designer.py#L61
sets the script path of an ethernet interface to ""

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/config.py#L1228
checks script for None. As it is not none but a string it adds an empty 
script path to the ethernet interface definition in the virsh xml

Steps to reproduce
==================

nova generated virsh:

[root@overcloud-novacompute-0 heat-admin]# cat 2.xml |grep tap -A5 -B3
    <interface type='ethernet'>
      <mac address='02:b9:38:d2:ef:bf'/>
      <script path=''/>
      <target dev='tapb938d2ef-bf'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

XML validation:

[root@overcloud-novacompute-0 heat-admin]# virt-xml-validate 2.xml
Relax-NG validity error : Extra element devices in interleave
2.xml:59: element devices: Relax-NG validity error : Element domain failed to validate content
2.xml fails to validate

removing the <script path=''/> element the xml validation succeeds:

[root@overcloud-novacompute-0 heat-admin]# cat 1.xml |grep tap -A5 -B2
    <interface type='ethernet'>
      <mac address='02:b9:38:d2:ef:bf'/>
      <target dev='tapb938d2ef-bf'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
[root@overcloud-novacompute-0 heat-admin]# virt-xml-validate 1.xml
1.xml validates

Point is that libvirt <2.0.0 is more tolerant. libvirt 2.0.0 throws a segfault:
 
Dec  9 13:30:32 comp1 kernel: libvirtd[1048]: segfault at 8 ip 00007fc9ff09e1c3 sp 00007fc9edfef1d0 error 4 in libvirt.so.0.2000.0[7fc9fef4b000+352000]
Dec  9 13:30:32 comp1 journal: End of file while reading data: Input/output error
Dec  9 13:30:32 comp1 systemd: libvirtd.service: main process exited, code=killed, status=11/SEGV
Dec  9 13:30:32 comp1 systemd: Unit libvirtd.service entered failed state.
Dec  9 13:30:32 comp1 systemd: libvirtd.service failed.
Dec  9 13:30:32 comp1 systemd: libvirtd.service holdoff time over, scheduling restart.
Dec  9 13:30:32 comp1 systemd: Starting Virtualization daemon...
Dec  9 13:30:32 comp1 systemd: Started Virtualization daemon. 

Expected result
===============
VM can be started
instead of checking for None, config.py should check for an empty string before
adding script path


Actual result
=============
VM doesn't start

Environment
===========
OSP10/Newton, libvirt 2.0.0

Specification URL (additional information):

https://bugs.launchpad.net/nova/+bug/1649527

Comment 1 Stephen Gordon 2016-12-23 14:25:39 UTC
There is some additional context here:

    http://lists.openstack.org/pipermail/openstack-dev/2016-December/109401.html

It seems like there are at least two aspects at play here:

1) Stop Nova generating XML with path=''.

2) Re-mediation for guests that already have this.

Comment 2 Stephen Gordon 2016-12-23 14:29:25 UTC
From upstream conversation this would seem to impact at least the 'ivs', 'iovisor', 'midonet' and 'vrouter' plugins. We also need to ensure we fix not just in-tree but also in os-vif.

Comment 8 Stephen Gordon 2017-02-15 00:07:25 UTC
*** Bug 1422278 has been marked as a duplicate of this bug. ***

Comment 10 Prasanth Anbalagan 2017-02-15 20:12:02 UTC
Verified as follows,

*********
VERSION
*********

[heat-admin@compute-0 ~]$ yum list installed | grep openstack-nova
openstack-nova-api.noarch        1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-cert.noarch       1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-common.noarch     1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-compute.noarch    1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-conductor.noarch  1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-console.noarch    1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-novncproxy.noarch 1:14.0.3-8.el7ost     @rhos-10.0-signed        
openstack-nova-scheduler.noarch  1:14.0.3-8.el7ost     @rhos-10.0-signed        

*****
LOGS
*****

[heat-admin@compute-0 ~]$ sudo virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     instance-00000001              running

[heat-admin@compute-0 ~]$ sudo virsh dumpxml 1
.
..
...
    <interface type='bridge'>
      <mac address='fa:16:3e:31:c7:0b'/>
      <source bridge='qbrba0f5a90-1a'/>
      <target dev='tapba0f5a90-1a'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...
..
.
[heat-admin@compute-0 ~]$ sudo virsh dumpxml 1 > 1.xml
[heat-admin@compute-0 ~]$ virt-xml-validate 1.xml
1.xml validates

Comment 12 errata-xmlrpc 2017-02-23 21:15:08 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.

https://rhn.redhat.com/errata/RHBA-2017-0319.html


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