commit 1ff029c1c3792f53865c6bdb3dce8d2c51b73ca7
Author: Matt Riedemann <email address hidden>
Date: Wed Jun 19 16:26:07 2019 -0400
Delete InstanceMapping in conductor if BuildRequest is already deleted
The BuildRequest represents a server in the API until the scheduler
picks a host in a cell and we create the instance record in that cell
and update the instance mapping to point at the cell. If the user
deletes the BuildRequest before the instance record is created in a
cell, the conductor schedule_and_build_instances method cleans up the
resource allocations created by scheduler and then continues to the
next instance (if it's a multi-create request). The point is the instance
does not get created in a cell, the BuildRequest is gone, and the
instance mapping is left pointing at no cell - effectively orphaned.
Furthermore, the archive_deleted_rows command change
I483701a55576c245d091ff086b32081b392f746e to cleanup instance mappings
for archived instances will not catch and cleanup the orphan instance
mapping because there never was an instance record to delete and archive
(the BuildRequest was deleted before the instance record was created, and
the BuildRequest is hard deleted so there is no archive).
This change simply deletes the InstanceMapping record in case the
BuildRequest is already gone by the time we finish scheduling and we
do not create the instance record in any cell.
Reviewed: https:/ /review. opendev. org/666438 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1ff029c1c37 92f53865c6bdb3d ce8d2c51b73ca7
Committed: https:/
Submitter: Zuul
Branch: master
commit 1ff029c1c3792f5 3865c6bdb3dce8d 2c51b73ca7
Author: Matt Riedemann <email address hidden>
Date: Wed Jun 19 16:26:07 2019 -0400
Delete InstanceMapping in conductor if BuildRequest is already deleted
The BuildRequest represents a server in the API until the scheduler and_build_ instances method cleans up the
picks a host in a cell and we create the instance record in that cell
and update the instance mapping to point at the cell. If the user
deletes the BuildRequest before the instance record is created in a
cell, the conductor schedule_
resource allocations created by scheduler and then continues to the
next instance (if it's a multi-create request). The point is the instance
does not get created in a cell, the BuildRequest is gone, and the
instance mapping is left pointing at no cell - effectively orphaned.
Furthermore, the archive_ deleted_ rows command change 76c245d091ff086 b32081b392f746e to cleanup instance mappings
I483701a555
for archived instances will not catch and cleanup the orphan instance
mapping because there never was an instance record to delete and archive
(the BuildRequest was deleted before the instance record was created, and
the BuildRequest is hard deleted so there is no archive).
This change simply deletes the InstanceMapping record in case the
BuildRequest is already gone by the time we finish scheduling and we
do not create the instance record in any cell.
Change-Id: Ia03577ae41f010 b449e47ff5b69b4 32d74f8467b
Related-Bug: #1784074
Related-Bug: #1773945