Comment 2 for bug 1890505

Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :

The manila-share resource is only exposed by manila-ganesha/2, not manila-ganesha/0 which is the one the leader hacluster unit is taking the resource configuration data from - only a vip resource got exposed by manila-ganesha/0:

sudo juju-run -r 42 --remote-unit manila-ganesha/0 hacluster/0 'JUJU_HOOK_NAME=ha-relation-changed hooks/ha-relation-changed'

rlwrap telnet localhost 4444

ubuntu@juju-dedf8c-zaza-a6cee85c0b7f-11:~$ rlwrap telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(290)ha_relation_changed()
-> if not get_corosync_conf():

(Pdb) l
285 def ha_relation_changed():
286 import rpdb
287 rpdb.set_trace()
288 # Check that we are related to a principle and that
289 # it has already provided the required corosync configuration
290 -> if not get_corosync_conf():
291 log('Unable to configure corosync right now, deferring configuration',
292 level=INFO)
293 return
294
295 if relation_ids('hanode'):

(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(295)ha_relation_changed()
-> if relation_ids('hanode'):
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(296)ha_relation_changed()
-> log('Ready to form cluster - informing peers', level=DEBUG)
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(297)ha_relation_changed()
-> relation_set(relation_id=relation_ids('hanode')[0], ready=True)
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(305)ha_relation_changed()
-> if len(get_cluster_nodes()) < int(config('cluster_count')):
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(310)ha_relation_changed()
-> relids = relation_ids('ha') or relation_ids('juju-info')
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(311)ha_relation_changed()
-> if len(relids) == 1: # Should only ever be one of these
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(313)ha_relation_changed()
-> relid = relids[0]
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(314)ha_relation_changed()
-> units = related_units(relid)
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(315)ha_relation_changed()
-> if len(units) < 1:

(Pdb) l
310 relids = relation_ids('ha') or relation_ids('juju-info')
311 if len(relids) == 1: # Should only ever be one of these
312 # Obtain relation information
313 relid = relids[0]
314 units = related_units(relid)
315 -> if len(units) < 1:
316 log('No principle unit found, deferring configuration',
317 level=INFO)
318 return
319
320 unit = units[0]
(Pdb) relid
'ha:42'
(Pdb) units
['manila-ganesha/0']

(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(320)ha_relation_changed()
-> unit = units[0]
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(321)ha_relation_changed()
-> log('Parsing cluster configuration using rid: %s, unit: %s' %
(Pdb) unit
'manila-ganesha/0'
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(322)ha_relation_changed()
-> (relid, unit), level=DEBUG)

-> resources = parse_data(relid, unit, 'resources')
(Pdb) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/ha-relation-changed(324)ha_relation_changed()
-> delete_resources = parse_data(relid, unit, 'delete_resources')
(Pdb) resources
{'res_ganesha_a3b980a_vip': 'ocf:heartbeat:IPaddr2'}

(Pdb) debug parse_data(relid, unit, 'resources')
ENTERING RECURSIVE DEBUGGER
> <string>(1)<module>()
((Pdb)) s
--Call--
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/utils.py(494)parse_data()
-> def parse_data(relid, unit, key):

((Pdb)) s
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/utils.py(496)parse_data()
-> _key = 'json_{}'.format(key)
((Pdb)) l
491 return get_node_flags('member_ready')
492
493
494 def parse_data(relid, unit, key):
495 """Helper to detect and parse json or ast based relation data"""
496 -> _key = 'json_{}'.format(key)
497 data = relation_get(_key, unit, relid) or relation_get(key, unit, relid)
498 if data:
499 try:
500 return json.loads(data)
501 except (TypeError, ValueError):
((Pdb)) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/utils.py(497)parse_data()
-> data = relation_get(_key, unit, relid) or relation_get(key, unit, relid)
((Pdb)) _key
'json_resources'
((Pdb)) n
> /var/lib/juju/agents/unit-hacluster-0/charm/hooks/utils.py(498)parse_data()
-> if data:
((Pdb)) data
'{"res_ganesha_a3b980a_vip": "ocf:heartbeat:IPaddr2"}'

((Pdb)) import subprocess
((Pdb)) subprocess.check_call(['relation-get'])

((Pdb)) subprocess.check_output(['relation-get'])
b'corosync_bindiface: eth0\ncorosync_mcastport: "4440"\negress-subnets: 10.5.0.17/32\ningress-address: 10.5.0.17\njson_colocations: \'{"ganesha_with_vip": "inf: res_nfs_ganesha_nfs_ganesha grp_ganesha_vips",\n "manila_with_vip": "inf: res_manila_share_manila_share grp_ganesha_vips"}\'\njson_delete_resources: \'["res_ganesha_ens3_vip"]\'\njson_resource_params: \'{"res_ganesha_a3b980a_vip": " params ip=\\"10.5.0.45\\" meta\n migration-threshold=\\"INFINITY\\" failure-timeout=\\"5s\\" op monitor timeout=\\"20s\\"\n interval=\\"10s\\" depth=\\"0\\""}\'\njson_resources: \'{"res_ganesha_a3b980a_vip": "ocf:heartbeat:IPaddr2"}\'\nprivate-address: 10.5.0.17\n'