Fix cephx key rotation race condition with Nova

When new nova-compute units are added to Ceph-backed clouds,
cephx keys are temporarily reverted back to the wrong (old)
key value. This happens due to a race condition between the
client hooks of nova-compute and ceph-mon. Details can be
found in LP#2125295.

This patch ensures that nova-compute sends the application
name value early on to ensure the race condition does not
occur.

Closes-Bug: #2125295
Change-Id: Ibdd5ccdd6d26b5d72dd80ed54bd90b38d5c99ceb
Signed-off-by: Alejandro Santoyo <alejandro.santoyo@canonical.com>
This commit is contained in:
Alejandro Santoyo
2025-11-25 11:20:14 +01:00
committed by Edward Hope-Morley
parent bf0dffe467
commit 6131e66bee
+3 -2
View File
@@ -479,6 +479,9 @@ def ironic_api_changed():
@hooks.hook('ceph-relation-joined')
@restart_on_change(restart_map())
def ceph_joined():
# install old credentials first for backwards compatibility
send_application_name()
pkgs = filter_installed_packages(['ceph-common'])
if pkgs:
status_set('maintenance', 'Installing ceph-common package')
@@ -486,8 +489,6 @@ def ceph_joined():
# Bug 1427660
if not is_unit_paused_set() and config('virt-type') in LIBVIRT_TYPES:
service_restart(libvirt_daemon())
# install old credentials first for backwards compatibility
send_application_name()
def get_ceph_request():