Revert "Fix migration across apps when using VMs created from image"

This reverts commit c3c2cf0349.

Reason for revert: This introduces an undesired behavior when scaling-out that needs to be addressed in a complementary patch.

Change-Id: I21c127aa565e489ba4d93a1efc8ddba63ef32e87
This commit is contained in:
Rodrigo Barbieri 2023-10-05 09:22:10 +00:00
parent c3c2cf0349
commit 11845c7aab
4 changed files with 9 additions and 20 deletions

View File

@ -158,19 +158,15 @@ def get_osd_settings(relation_name):
return _order_dict_by_key(osd_settings)
def send_application_name(relid=None, app_name=None):
def send_application_name(relid=None):
"""Send the application name down the relation.
:param relid: Relation id to set application name in.
:type relid: str
:param app_name: Application name to send in the relation.
:type app_name: str
"""
if app_name is None:
app_name = application_name()
relation_set(
relation_id=relid,
relation_settings={'application-name': app_name})
relation_settings={'application-name': application_name()})
def send_osd_settings():

View File

@ -63,7 +63,7 @@ from charmhelpers.contrib.network.ip import (
# This is just a label and it must be consistent across
# nova-compute nodes to support live migration.
CEPH_SECRET_UUID = 'c91ce26f-403d-4058-9c38-6b56e1c428e0'
CEPH_SECRET_UUID = '514c9fca-8cbe-11e2-9c52-3bc8c7819472'
OVS_BRIDGE = 'br-int'
@ -435,7 +435,7 @@ class NovaComputeCephContext(context.CephContext):
ctxt = super(NovaComputeCephContext, self).__call__()
if not ctxt:
return {}
svc = 'nova-compute'
svc = service_name()
# secret.xml
ctxt['ceph_secret_uuid'] = CEPH_SECRET_UUID
# nova.conf

View File

@ -454,7 +454,7 @@ def ceph_joined():
# Bug 1427660
if not is_unit_paused_set() and config('virt-type') in LIBVIRT_TYPES:
service_restart(libvirt_daemon())
send_application_name(app_name='nova-compute')
send_application_name()
def get_ceph_request():
@ -566,7 +566,7 @@ def ceph_changed(rid=None, unit=None):
log('ceph relation incomplete. Peer not ready?')
return
if not ensure_ceph_keyring(service='nova-compute', user='nova',
if not ensure_ceph_keyring(service=service_name(), user='nova',
group='nova'):
log('Could not create ceph keyring: peer not ready?')
return
@ -691,11 +691,8 @@ def _get_broker_rid_unit_for_previous_request():
@hooks.hook('ceph-relation-broken')
def ceph_broken():
delete_keyring(service='nova-compute')
# cleanup old entries based on application name
svc_name = service_name()
if svc_name != 'nova_compute':
delete_keyring(service=svc_name)
service = service_name()
delete_keyring(service=service)
update_all_configs()
@ -721,9 +718,6 @@ def upgrade_charm():
for r_id in relation_ids('amqp'):
amqp_joined(relation_id=r_id)
# Trigger upgrade-path from application_name to 'nova-compute'
for r_id in relation_ids('ceph'):
send_application_name(relid=r_id, app_name='nova-compute')
if is_relation_made('nrpe-external-master'):
update_nrpe_config()

View File

@ -598,8 +598,7 @@ class NovaComputeRelationsTests(CharmTestCase):
self.apt_install.assert_called_with(['ceph-common'], fatal=True)
self.service_restart.assert_called_with('libvirt-bin')
self.libvirt_daemon.assert_called()
self.send_application_name.assert_called_once_with(
app_name='nova-compute')
self.send_application_name.assert_called_once_with()
@patch.object(hooks, 'CONFIGS')
def test_ceph_changed_missing_relation_data(self, configs):