typo in IVS related privsep method, VM creation failure

Bug #1794126 reported by Aditya Vaja
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned
Queens
Fix Committed
High
Aditya Vaja

Bug Description

Description
===========
As part of the change here [1], a few calls to edit files as root were moved to a privsep class that encompasses all those edits.
A typo creeped in, causing a failure when creating a VM with VIF type IVS.

Method in question:
@nova.privsep.dacnet_admin_pctxt.entrypoint
def disable_ipv6(interface):
    """Disable ipv6 for a bridge."""
    with open('/proc/sys/net/ipv6/conf/%s/disable_ipv' % interface, 'w') as f:
        f.write('1')

The name of the file should be 'disable_ipv6' instead of 'disable_ipv'.
Missing '6' at the end.

Logs & Configs
==============
log excerpt for failure:
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [req-e2560c77-8950-4dc6-8f4f-44254b184bbb 17bbd148d3f34a42bede6bdb8fcc84aa 62daca4c6dff406685f3fcf754cb82c4 - default default] [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] Instance failed to spawn: IOError: [Errno 2] No such file or directory
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] Traceback (most recent call last):
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2236, in _build_resources
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] yield resources
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2016, in _build_and_run_instance
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] block_device_info=block_device_info)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 3100, in spawn
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] destroy_disks_on_failure=True)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 5590, in _create_domain_and_network
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] destroy_disks_on_failure)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] self.force_reraise()
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] six.reraise(self.type_, self.value, self.tb)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 5549, in _create_domain_and_network
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] self.plug_vifs(instance, network_info)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 829, in plug_vifs
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] self.vif_driver.plug(instance, vif)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/vif.py", line 896, in plug
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] func(instance, vif)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/vif.py", line 722, in plug_ivs
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] self.plug_ivs_hybrid(instance, vif)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/vif.py", line 703, in plug_ivs_hybrid
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] nova.privsep.libvirt.disable_ipv6(br_name)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/oslo_privsep/priv_context.py", line 207, in _wrap
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] return self.channel.remote_call(name, args, kwargs)
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] File "/usr/lib/python2.7/site-packages/oslo_privsep/daemon.py", line 202, in remote_call
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] raise exc_type(*result[2])
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d] IOError: [Errno 2] No such file or directory
2018-09-24 14:21:47.167 1 ERROR nova.compute.manager [instance: a631eff3-9d68-4e06-a7ce-4338e29e8e2d]

I'll open a fix PR as well. And add a check that file exists before editing - apparently that's not true for this particular case and wasn't carried over from existing code.

Note: only affects stable/queens branch. Later releases has proper calling to os-vif-bigswitch and this code has been cleaned up from Nova.

[1] https://review.openstack.org/#/c/489438/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/604817

description: updated
Matt Riedemann (mriedem)
Changed in nova:
status: New → Won't Fix
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/604817
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0c9bd9ce6e0fe9eb6e8e2a16fe04615662a4f0f0
Submitter: Zuul
Branch: stable/queens

commit 0c9bd9ce6e0fe9eb6e8e2a16fe04615662a4f0f0
Author: Aditya Prakash Vaja <email address hidden>
Date: Mon Sep 24 20:19:39 2018 +0530

    stable-only: fix typo in IVS related privsep method

     - as part of this change [1], methods requiring root access for
       IVS were moved to a separate file
     - there was a typo that causes failure to plug VM interface
     - this fixes the typo and includes the original file existence
       check to the utility method

    This is a stable-only change for Queens because the code in
    question was removed in Rocky [2].

    [1] Ic48087fdf283b3ba503294a944be91be0c338132
    [2] Icf948f6ee1c0da2327fb5eac61fec6e89ac30531

    Change-Id: Ifa4df2bde2d9799727b29c63f2037fcd3eaa4b87
    Closes-Bug: #1794126

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.7

This issue was fixed in the openstack/nova 17.0.7 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.