yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #86825
[Bug 1937375] Re: Duplicate BlockDeviceMapping if attaching volumes too fast
Reviewed: https://review.opendev.org/c/openstack/nova/+/801990
Committed: https://opendev.org/openstack/nova/commit/2209b0007fe85d7c5439e0bfdfe2120c63898fa2
Submitter: "Zuul (22348)"
Branch: master
commit 2209b0007fe85d7c5439e0bfdfe2120c63898fa2
Author: Felix Huettner <felix.huettner@mail.schwarz>
Date: Fri Jul 23 10:43:32 2021 +0200
compute: Avoid duplicate BDMs during reserve_block_device_name
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.
To work around this we add a check in nova-compute to validate that
the volume has not been attached in the mean time.
Closes-Bug: #1937375
Change-Id: I92f35514efddcb071c7094370b79d91d34c5bc72
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1937375
Title:
Duplicate BlockDeviceMapping if attaching volumes too fast
Status in OpenStack Compute (nova):
Fix Released
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
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1937375/+subscriptions
References