Bug 1948515

Summary: [OSP 16.2] 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: 16.2 (Train)CC: dasmith, eglynn, jhakimra, kchamart, nova-maint, sbauza, sgordon, vromanso
Target Milestone: betaKeywords: Patch, Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-20.6.1-2.20210429124809.10df176.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1907392 Environment:
Last Closed: 2021-09-15 07:13:57 UTC Type: ---
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: 1907392    
Bug Blocks:    

Description Lee Yarwood 2021-04-12 10:43:17 UTC
+++ This bug was initially created as a clone of Bug #1907392 +++

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 16 errata-xmlrpc 2021-09-15 07:13:57 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 (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement advisory), 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-2021:3483