resize fails with FileExistsError if earlier resize attempt failed to cleanup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Tobias Urdin | ||
Xena |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This bug is related to resize with the libvirt driver
If you are performing a resize and it fails the _cleanup_
2021-12-14 14:40:12.535 175177 INFO nova.virt.
Then on next resize attempt a long time later
2022-02-04 13:07:31.255 175177 ERROR oslo_messaging.
2022-02-04 13:07:31.255 175177 ERROR oslo_messaging.
2022-02-04 13:07:31.255 175177 ERROR oslo_messaging.
This is happens here [3] because os.rename tries to rename the /var/lib/
We should check if the directory exists before trying to rename and delete it before.
[1] https:/
[2] https:/
[3] https:/
Changed in nova: | |
status: | New → In Progress |
Changed in nova: | |
importance: | Undecided → Medium |
assignee: | nobody → Tobias Urdin (tobias-urdin) |
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /827865 /opendev. org/openstack/ nova/commit/ 9111b99f739d41c 092db8d01712a5a a72388b5fb
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 9111b99f739d41c 092db8d01712a5a a72388b5fb
Author: Tobias Urdin <email address hidden>
Date: Fri Feb 4 15:01:36 2022 +0100
Cleanup old resize instances dir before resize
If there is a failed resize that also failed the cleanup remote_ migration( ) the retry
process performed by _cleanup_
of the resize will fail because it cannot rename the current
instances directory to _resize.
This renames the _cleanup_ failed_ migration( ) that does the failed_ instance_ base() and
same logic we want to _cleanup_
uses it for both migration and resize cleanup of directory.
It then simply calls _cleanup_ failed_ instances_ base() with
the resize dir path before trying a resize.
Closes-Bug: 1960230 2da59a6139df9f0 913281b5d77
Change-Id: I7412b16be31063