@Felipe, thanks for your suggestion, I've implemented it in patchset 3, but there
are still the following problems.
We have two operations, delete_hm_port and update_neutron_ip_list, the data
departing_unit_name is required for both operations, and it can only be
obtained from octavia/1.
(suppose departing unit is octavia/7 and leader unit is octavia/1).
So
octavia/7 should run cluster-departed hook to obtain departing_unit_name
@reactive.when_not('cluster.connected')
def cluster_departed():
if hookenv.local_unit() == hookenv.departing_unit():
# run delete_hm_port here
and octavia/1 should be running cluster-relation-changed hook and/or
cluster-broken and cluster-departed to run existing update_neutron_ip_list
...
+@reactive.when_not('cluster.connected')
def update_controller_ip_port_list():
# run existing update_neutron_ip_list here
Now the question will be:
1, We can use relation_set() to pass departing_unit_name from octavia/7
to octavia/3
2, but how to pass event from octavia/7 to octavia/3 to trigger
update_controller_ip_port_list after running cluster_departed.
because it seems the above proposal can't guarantee the order to first run
cluster_departed then run update_controller_ip_port_list
Do you guys have any ideas to find a better solution for this? thanks.
@Felipe, thanks for your suggestion, I've implemented it in patchset 3, but there
are still the following problems.
We have two operations, delete_hm_port and update_ neutron_ ip_list, the data
departing_unit_name is required for both operations, and it can only be
obtained from octavia/1.
(suppose departing unit is octavia/7 and leader unit is octavia/1).
So
octavia/7 should run cluster-departed hook to obtain departing_unit_name
@reactive. when_not( 'cluster. connected' ) local_unit( ) == hookenv. departing_ unit():
def cluster_departed():
if hookenv.
# run delete_hm_port here
and octavia/1 should be running cluster- relation- changed hook and/or neutron_ ip_list
cluster-broken and cluster-departed to run existing update_
... when_not( 'cluster. connected' ) controller_ ip_port_ list(): neutron_ ip_list here
+@reactive.
def update_
# run existing update_
Now the question will be:
1, We can use relation_set() to pass departing_unit_name from octavia/7
to octavia/3
2, but how to pass event from octavia/7 to octavia/3 to trigger controller_ ip_port_ list after running cluster_departed. controller_ ip_port_ list
update_
because it seems the above proposal can't guarantee the order to first run
cluster_departed then run update_
Do you guys have any ideas to find a better solution for this? thanks.