Issues with nova-manage volume_attachment subcommand

Bug #2012365 reported by Amit Uniyal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Amit Uniyal

Bug Description

Downstream bug report from Red Hat Bugzilla against Train: https://bugzilla.redhat.com/show_bug.cgi?id=2161733

1 - fix handling of instance locking
    Add a context manager for locking and unlocking instance for volume attachement refresh cmd.

2 - disconnecting the volume from the correct host
    Verify if instance is attached to correct compute host before removing volume connection.

Tags: nova-manage
Amit Uniyal (auniyal)
tags: added: nova-manage
Changed in nova:
assignee: nobody → Amit Uniyal (auniyal)
Changed in nova:
status: New → In Progress
Revision history for this message
Amit Uniyal (auniyal) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/873648
Committed: https://opendev.org/openstack/nova/commit/211737d0ce23a8a9b1f3953f4816150a9a3271fa
Submitter: "Zuul (22348)"
Branch: master

commit 211737d0ce23a8a9b1f3953f4816150a9a3271fa
Author: Amit Uniyal <email address hidden>
Date: Mon Feb 13 21:06:09 2023 +0000

    Added context manager for instance lock

    Moved lock and unlock instance code to context manager.
    Updated _refresh volume attachment method to use instance
    lock context manager

    Now there will be a single request ID for the lock, refresh, and unlock
    actions. Earlier, the volume_attachment refresh operation used to have a
    unique req-id for each action.

    Related-Bug: #2012365
    Change-Id: I6588836c3484a26d67a5995710761f0f6b6a4c18

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

Reviewed: https://review.opendev.org/c/openstack/nova/+/877446
Committed: https://opendev.org/openstack/nova/commit/a8f81d5f08692c16d538af3197460d9426cc00a1
Submitter: "Zuul (22348)"
Branch: master

commit a8f81d5f08692c16d538af3197460d9426cc00a1
Author: Amit Uniyal <email address hidden>
Date: Wed Mar 15 05:07:28 2023 +0000

    Disconnecting volume from the compute host

    cmd nova-manage volume_attachment refresh vm-id vol-id connetor

    There were cases where the instance said to live in compute#1 but the
    connection_info in the BDM record was for compute#2, and when the script
    called `remote_volume_connection` then nova would call os-brick on
    compute#1 (the wrong node) and try to detach it.

    In some case os-brick would mistakenly think that the volume was
    attached (because the target and lun matched an existing volume on the
    host) and would try to disconnect, resulting in errors on the compute
    logs.

    - Added HostConflict exception
    - Fixes dedent in cmd/manange.py
    - Updates nova-mange doc

    Closes-Bug: #2012365
    Change-Id: I21109752ff1c56d3cefa58fcd36c68bf468e0a73

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/2023.2)

Related fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/nova/+/911394

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

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/nova/+/911396

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/2023.1)

Related fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/nova/+/912511

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

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/nova/+/912513

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

This issue was fixed in the openstack/nova 29.0.0.0rc1 release candidate.

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.