Duplicate BlockDeviceMapping if attaching volumes too fast
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Felix Huettner | ||
Queens |
New
|
Undecided
|
Unassigned | ||
Rocky |
New
|
Undecided
|
Unassigned | ||
Stein |
New
|
Undecided
|
Unassigned | ||
Train |
New
|
Undecided
|
Unassigned | ||
Ussuri |
New
|
Undecided
|
Unassigned | ||
Victoria |
New
|
Undecided
|
Unassigned | ||
Wallaby |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Description
===========
When attaching a volume to a running instance the nova-api validates that
the volume is not already attached to the instance. However nova-compute
is responsible for actually creating the BDM entry in the database.
If sending attach requests fast enough it can be possible that the same
"attach_volume" request can be sent to nova-compute for the same
volume/instance combination.
Steps to reproduce
==================
* Create an Instance and a volume
* run in 2 terminals in parallel "openstack server add volume <instance> <volume>"
* when being fast enough this results in "openstack server show" to report the volume id twice
Expected result
===============
The volume is attached to the instance just once
Actual result
=============
The volume is attached to the instance two (or with more parallelity) or more times.
Environment
===========
1. Happens on master till queens (possibly also earlier releases)
2. Which hypervisor did you use?
Indepentent of Hypervisor, observed with Libvirt
2. Which storage type did you use?
Independent of Storage, observed with ceph + nfs
3. Which networking type did you use?
Independent of Network, observed with ovs
Changed in nova: | |
assignee: | nobody → Felix Huettner (felix.huettner) |
Changed in nova: | |
status: | New → In Progress |
Fix is being developed in https:/ /review. opendev. org/c/openstack /nova/+ /801990