VHD detach issue

Bug #1840954 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
os-win
Fix Released
Undecided
Unassigned

Bug Description

Attempting to disconnect a VHD from the local host may fail if the image is in-use by a different host, even though it's not actually mounted on the local host.

The reason is that the detach API requires a handle, which we may fail to obtain if the file is in-use.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to os-win (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/678501

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

Reviewed: https://review.opendev.org/674607
Committed: https://git.openstack.org/cgit/openstack/os-win/commit/?id=dc9f6b9aeb07056aaefeadb5a337423303f97e83
Submitter: Zuul
Branch: master

commit dc9f6b9aeb07056aaefeadb5a337423303f97e83
Author: Lucian Petrut <email address hidden>
Date: Mon Aug 5 16:34:00 2019 +0300

    Fix VHD detach

    Attempting to disconnect a VHD from the local host may fail if the
    image is in-use by a different host, even though it's not actually
    mounted on the local host.

    The reason is that the detach API requires a handle, which we may
    fail to obtain if the file is in-use.

    This change will try to figure out if the image is actually attached
    to the local host before erroring out. This check is a bit more
    complicated than it should, again due to file locks. We'll use
    two approaches:
    * the preffered way, using virtdisk.dll:GetVirtualDiskInformation,
      which may fail due to file locks
    * the slower way, used as a fallback, which involves getting a full
      list of attached images and comparing file and volume ids as
      the file may be accessible through multiple paths

    Closes-Bug: #1840954
    Change-Id: Ib5bf0070c0ba4cb18e98c1cb983c641eaae582bf

Changed in os-win:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-win 4.3.1

This issue was fixed in the openstack/os-win 4.3.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to os-win (stable/stein)

Reviewed: https://review.opendev.org/678501
Committed: https://git.openstack.org/cgit/openstack/os-win/commit/?id=c51aaa1a53ce2dec9b641e4d6059a94262c869b0
Submitter: Zuul
Branch: stable/stein

commit c51aaa1a53ce2dec9b641e4d6059a94262c869b0
Author: Lucian Petrut <email address hidden>
Date: Mon Aug 5 16:34:00 2019 +0300

    Fix VHD detach

    Attempting to disconnect a VHD from the local host may fail if the
    image is in-use by a different host, even though it's not actually
    mounted on the local host.

    The reason is that the detach API requires a handle, which we may
    fail to obtain if the file is in-use.

    This change will try to figure out if the image is actually attached
    to the local host before erroring out. This check is a bit more
    complicated than it should, again due to file locks. We'll use
    two approaches:
    * the preffered way, using virtdisk.dll:GetVirtualDiskInformation,
      which may fail due to file locks
    * the slower way, used as a fallback, which involves getting a full
      list of attached images and comparing file and volume ids as
      the file may be accessible through multiple paths

    Closes-Bug: #1840954
    Change-Id: Ib5bf0070c0ba4cb18e98c1cb983c641eaae582bf

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/os-win 4.2.1

This issue was fixed in the openstack/os-win 4.2.1 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.