nova-manage volume_attachment refresh not setting mount_point or mode on the new attachment

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

Bug Description

Description
===========

$subject, when refreshing a volume attachment this nova-manage command actually recreates the volume attachment from scratch. Previously it would do so without updating the attachment with the optional mountpoint within the connector.

https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=update-an-attachment-detail#update-an-attachment

$ nova-manage volume_attachment refresh 74adb548-f3ed-4d68-b282-b278dd1ec3f2 02a27e61-b242-460e-8cf6-8525c5353698 connector.json

$ openstack volume show 02a27e61-b242-460e-8cf6-8525c5353698 -f json -c attachments | jq '.attachments[] | {id, server_id, volume_id, device, mode}'
{
  "id": "02a27e61-b242-460e-8cf6-8525c5353698",
  "server_id": "74adb548-f3ed-4d68-b282-b278dd1ec3f2",
  "volume_id": "02a27e61-b242-460e-8cf6-8525c5353698",
  "device": "na",
  "mode": null
}

Steps to reproduce
==================

* Refresh a volume attachment using nova-manage

Expected result
===============

mountpoint/device set on the attachment in cinder.

Actual result
=============

mountpoint/device not set on the attachment in cinder.

Environment
===========
1. Exact version of OpenStack you are running. See the following
  list for all releases: http://docs.openstack.org/releases/

   master

2. Which hypervisor did you use?
   (For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
   What's the version of that?

   libvirt

2. Which storage type did you use?
   (For example: Ceph, LVM, GPFS, ...)
   What's the version of that?

   N/A

3. Which networking type did you use?
   (For example: nova-network, Neutron with OpenVSwitch, ...)

   N/A

Logs & Configs
==============

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/811713

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit d59188d5e2db3d7d33f9da0c2546101747da6423
Author: Lee Yarwood <email address hidden>
Date: Wed Sep 29 11:25:18 2021 +0100

    nova-manage: Ensure mountpoint is passed when updating attachment

    This optional kwarg to the nova.volume.cinder.API.attachment_update
    method ends up stashed in the connector passed to c-api and sets the
    device associated with the attachment within Cinder. While this being
    unset has no real world impact it should be kept the same as the
    original attachment for completeness.

    The Cinder fixture is extended to mimic the behaviour of
    nova.volume.cinder.API.attachment_update prior to calling Cinder
    allowing us to assert the value stashed in the connector and attachment
    record.

    Closes-Bug: #1945450
    Change-Id: Ib2938a407598bf2dd466aae41700f350d2d34418

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 25.0.0.0rc1

This issue was fixed in the openstack/nova 25.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.