xenapi: issues with destroy_vdi masking real errors

Bug #1246276 reported by John Garbutt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
John Garbutt

Bug Description

In cleaning up VDIs we call destroy_vdi.

However, should the destroy fail, it masks the real error, for example:

Unable to destroy VDI OpaqueRef:f53f35a9-31e1-af85-87a8-aa0dc7eecd43
  nova/compute/manager.py", _build_instance
...
  nova/virt/xenapi/vmops.py", line, in _attach_disks
    DEVICE_SWAP, name_label, swap_mb)
  nova/virt/xenapi/vm_utils.py", line, in generate_swap
    'swap', swap_mb, fs_type)
 nova/virt/xenapi/vm_utils.py", line, in _generate_disk
    destroy_vdi(session, vdi_ref)
  nova/virt/xenapi/vm_utils.py", line, in destroy_vdi
    _('Unable to destroy VDI %s') % vdi_ref)

We should instead use the safe_destroy_vdi call.

Tags: xenserver
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/54526

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/54526
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=04e53669dd3e6acd8086fd06ea073a02207ffb24
Submitter: Jenkins
Branch: master

commit 04e53669dd3e6acd8086fd06ea073a02207ffb24
Author: John Garbutt <email address hidden>
Date: Wed Oct 30 11:38:24 2013 +0000

    xenapi: stop destroy_vdi errors masking real error

    We frequently call destroy_vdi in an exception block where we plan to
    re-raise the exception.

    Should an error occur while destroying the vdi this hides the real error
    that caused the problem. To stop this, I have moved those calls to
    safe_destroy_vdis and added unit tests to ensure the error from
    destroy_vdi does not mask the real issue.

    Closes-Bug: #1246276
    Change-Id: Ib02f93ab1086f077d3d00e5ca915a26f90552c85

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
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.