Reviewed: https://review.openstack.org/267206 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ecb8cbe34c16f85cf235b1051e8bf01fdae66f98 Submitter: Jenkins Branch: master
commit ecb8cbe34c16f85cf235b1051e8bf01fdae66f98 Author: Matt Riedemann <[email protected]> Date: Wed Jan 13 14:27:00 2016 -0800 Remove "or 'reserved'" condition from reserve_block_device_name This condition was added in 66f1a34cabc26930db2a1afed5a0f5ced4d1c015 in grizzly to fix a regression with the compute 2.x rpc api. As of 91b35b22e753a4eb0c22c004bb12586970a95e11 we require compute rpc api >= 4.0 so the 2.x rpc api compat is no longer a concern. We should remove this condition since it's confusing, especially considering that the block_device_mappings table has no unique constraint yet we try to treat them as unique in most cases. Note that the v2 and v2.1 REST APIs also require that a volumeId is provided when attaching a volume (which is the only API that uses this method), so the volume_id should always be provided and we don't need to worry about this optional case. Apparently there was never a unit test added for this case, so there are no tests to update. Change-Id: I5cde374a2621b22b094d14e357a399a2fb784287 Closes-Bug: #1533871 ** 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/1533871 Title: compute manager reserve_block_device_name should not set 'reserved' as BDM volume_id Status in OpenStack Compute (nova): Fix Released Bug description: The code here is misleading: https://github.com/openstack/nova/blob/d49a78e9f895be36eeeb3da88e2472cf773cb105/nova/compute/manager.py#L4638 volume_id=volume_id or 'reserved', That originated in grizzly with: https://github.com/openstack/nova/commit/66f1a34cabc26930db2a1afed5a0f5ced4d1c015 To fix a problem in the 2.x compute api where volume_id was optional. As of https://github.com/openstack/nova/commit/91b35b22e753a4eb0c22c004bb12586970a95e11 we now required compute rpcapi >= 4.0 so we don't support the 2.x volume_id being optional case. Furthermore, the v2 API and v2.1 REST APIs require the volume_id to be passed in when attaching a volume: v2: https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/legacy_v2/contrib/volumes.py#L293 v2.1: https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/volumes.py#L79 So we should remove that "or 'reserved'" condition in the compute manager code since it's very confusing, especially when we don't have unique constraints on the BDM table in the database, we really need to have a unique volume_id (or None in the case of booting from blank/image/snapshot). To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1533871/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

