Reviewed: https://review.opendev.org/541420 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=de5bce6ea23e16c976b64fdf5b0daf06c540eb8b Submitter: Zuul Branch: master
commit de5bce6ea23e16c976b64fdf5b0daf06c540eb8b Author: Matt Riedemann <[email protected]> Date: Mon Sep 16 11:00:24 2019 -0400 Create volume attachment during boot from volume in compute When performing a boot from volume with an existing volume the compute API creates a volume attachment for the BDM so that we do a new-style attach flow in DriverVolumeBlockDevice.attach. However, when booting from source_type of blank, image or snapshot, where nova-compute creates the volume and then attaches it, we were still doing the legacy attach flow because there was no attachment_id on the BDM. This change fixes that so when nova creates the volume we also create the volume attachment so we can go down the new style attach flow. Note that we unconditionally create the volume attachment record since we require Cinder Queens since Nova Train [1][2]. This is important for eventually migrating off the old attach flow so we can drop that code. In other words, doing this means we eventually have fewer data records to migrate before we can drop the compat code. [1] I6a777b4b7a5729488f939df8c40e49bd40aec3dd [2] Ic9d1fb364e06e08250c7c5d7d4bdb956cb60e678 Change-Id: I30a49c9e085cffc071d0ba332db67945e116bc80 Closes-Bug: #1747693 ** 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/1747693 Title: boot from volume using source type blank/image/snapshot still does legacy style attach Status in OpenStack Compute (nova): Fix Released Bug description: As part of this blueprint in queens: https://specs.openstack.org/openstack/nova-specs/specs/queens/approved /cinder-new-attach-apis.html We now want to create new volume attachments using the cinder 3.44 API. However, when booting from volume using a source_type of blank/image/snapshot, where nova-compute creates the volume and then attaches it, it still goes down the legacy attach flow because a volume attachment record is never created and stored on the BlockDeviceMapping.attachment_id field. There are even TODOs in the code for where this needs to be fixed: https://github.com/openstack/nova/blob/2c1874a0ecdd1b5ce7670cdfc42396e90e3a55aa/nova/virt/block_device.py#L687 https://github.com/openstack/nova/blob/2c1874a0ecdd1b5ce7670cdfc42396e90e3a55aa/nova/virt/block_device.py#L712 https://github.com/openstack/nova/blob/2c1874a0ecdd1b5ce7670cdfc42396e90e3a55aa/nova/virt/block_device.py#L736 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1747693/+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

