Bug 1907392

Summary: [OSP 17] n-api should reject requests to attach a volume to an instance *if* an active bdm record exists
Product: Red Hat OpenStack Reporter: Lee Yarwood <lyarwood>
Component: openstack-novaAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 17.0 (Wallaby)CC: dasmith, eglynn, jhakimra, kchamart, sbauza, sgordon, vromanso
Target Milestone: betaKeywords: Patch, Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-23.0.3-0.20210908140341.e39bbdc.el9ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1948515 (view as bug list) Environment:
Last Closed: 2022-09-21 12:13:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1948515    

Description Lee Yarwood 2020-12-14 12:42:15 UTC
Description of problem:

$subject, this is an odd little corner case but if an admin resets the state of an attached volume to available there are no checks within n-api stopping a user from attaching the volume to another instance, regardless of the original bdm record.

Version-Release number of selected component (if applicable):
OSP 17

How reproducible:
Always

Steps to Reproduce:
1. Attach a volume to an instance.
2. Reset the state of the volume to available.
3. Attach the volume to another instance.

Actual results:
The volume is attached to both instances in Nova but a single instance in Cinder.

Expected results:
The second request to attach a volume should be rejected by Nova until the attachment is removed.

Additional info:

Comment 6 errata-xmlrpc 2022-09-21 12:13:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543