← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1825882] Re: Virsh disk attach errors silently ignored

 

Reviewed:  https://review.opendev.org/655696
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bc57ae50734fa6a70115b6369e867079fb5eb4b8
Submitter: Zuul
Branch:    master

commit bc57ae50734fa6a70115b6369e867079fb5eb4b8
Author: Lee Yarwood <lyarwood@xxxxxxxxxx>
Date:   Thu Apr 25 14:42:09 2019 +0100

    libvirt: Stop ignoring unknown libvirtError exceptions during volume attach
    
    Id346bce6e47431988cce7001abcf29a9faf2936a attempted to introduce a
    simple breadcrumb in the logs to highlight a known Libvirt issue.
    Unfortunately this change resulted in libvirtError exceptions that
    didn't match the known issue being silently ignored.
    
    This change corrects this by using excutils.save_and_reraise_exception
    to ensure all libvirtError exceptions are logged and raised regardless
    of being linked to the known issue.
    
    Change-Id: Ib440f4f2e484312af5f393722363846f6c95b760
    Closes-Bug: #1825882


** Changed in: nova
       Status: In Progress => Fix Released

** Changed in: nova/stein
       Status: Triaged => In Progress

** Changed in: nova/stein
     Assignee: (unassigned) => Lee Yarwood (lyarwood)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1825882

Title:
  Virsh disk attach errors silently ignored

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) queens series:
  In Progress
Status in OpenStack Compute (nova) rocky series:
  In Progress
Status in OpenStack Compute (nova) stein series:
  In Progress

Bug description:
  Description
  ===========
  The following commit (1) is causing volume attachments which fail due to libvirt device attach erros to be silently ignored and Nova report the attachment as successful.

  It seems that the original intention of the commit was to log a
  condition and re-raise the exeption, but if the exception is of type
  libvirt.libvirtError and does not contain the searched pattern, the
  exception is ignored. If you unindent the raise statement, errors are
  reported again.

  In our case we had ceph/apparmor configuration problems in compute
  nodes which prevented virsh attaching the device; volumes appeared as
  successfully attached but the corresponding block device missing in
  guests VMs. Other libvirt attach error conditions are ignored also, as
  when you have already occuppied device names (i.e. 'Target vdb already
  exists', device is busy, etc.)

  (1)
  https://github.com/openstack/nova/commit/78891c2305bff6e16706339a9c5eca99a84e409c

  Steps to reproduce
  ==================
  This is somewhat hacky, but is a quick way to provoke a virsh attach error:
  - virsh detach-disk <domain> vdb
  - update nova & cinder DB as if volume is detached
  - re-attach volume
  - volume is marked as attached, but VM block device is missing

  Expected result
  ===============
  - Error 'libvirtError: Requested operation is not valid: target vdb already exists' should be raised, and volume not attached

  Actual result
  =============
  - Attach successful but virsh block device not created

  Environment
  ===========
  - Openstack version Queens

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1825882/+subscriptions


References