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:
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"}'
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-a6cee85c0b 7f-11:~ $ rlwrap telnet localhost 4444 juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 290)ha_ relation_ changed( ) conf():
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
> /var/lib/
-> if not get_corosync_
(Pdb) l changed( ): conf(): ids('hanode' ):
285 def ha_relation_
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_
291 log('Unable to configure corosync right now, deferring configuration',
292 level=INFO)
293 return
294
295 if relation_
(Pdb) n juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 295)ha_ relation_ changed( ) ids('hanode' ): juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 296)ha_ relation_ changed( ) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 297)ha_ relation_ changed( ) set(relation_ id=relation_ ids('hanode' )[0], ready=True) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 305)ha_ relation_ changed( ) cluster_ nodes() ) < int(config( 'cluster_ count') ): juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 310)ha_ relation_ changed( ) ids('juju- info') juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 311)ha_ relation_ changed( ) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 313)ha_ relation_ changed( ) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 314)ha_ relation_ changed( ) units(relid) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 315)ha_ relation_ changed( )
> /var/lib/
-> if relation_
(Pdb) n
> /var/lib/
-> log('Ready to form cluster - informing peers', level=DEBUG)
(Pdb) n
> /var/lib/
-> relation_
(Pdb) n
> /var/lib/
-> if len(get_
(Pdb) n
> /var/lib/
-> relids = relation_ids('ha') or relation_
(Pdb) n
> /var/lib/
-> if len(relids) == 1: # Should only ever be one of these
(Pdb) n
> /var/lib/
-> relid = relids[0]
(Pdb) n
> /var/lib/
-> units = related_
(Pdb) n
> /var/lib/
-> if len(units) < 1:
(Pdb) l ids('juju- info') units(relid) ganesha/ 0']
310 relids = relation_ids('ha') or relation_
311 if len(relids) == 1: # Should only ever be one of these
312 # Obtain relation information
313 relid = relids[0]
314 units = related_
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-
(Pdb) n juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 320)ha_ relation_ changed( ) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 321)ha_ relation_ changed( ) juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 322)ha_ relation_ changed( )
> /var/lib/
-> unit = units[0]
(Pdb) n
> /var/lib/
-> log('Parsing cluster configuration using rid: %s, unit: %s' %
(Pdb) unit
'manila-ganesha/0'
(Pdb) n
> /var/lib/
-> (relid, unit), level=DEBUG)
-> resources = parse_data(relid, unit, 'resources') juju/agents/ unit-hacluster- 0/charm/ hooks/ha- relation- changed( 324)ha_ relation_ changed( ) a3b980a_ vip': 'ocf:heartbeat: IPaddr2' }
(Pdb) n
> /var/lib/
-> delete_resources = parse_data(relid, unit, 'delete_resources')
(Pdb) resources
{'res_ganesha_
(Pdb) debug parse_data(relid, unit, 'resources') (1)<module> () juju/agents/ unit-hacluster- 0/charm/ hooks/utils. py(494) parse_data( )
ENTERING RECURSIVE DEBUGGER
> <string>
((Pdb)) s
--Call--
> /var/lib/
-> def parse_data(relid, unit, key):
((Pdb)) s juju/agents/ unit-hacluster- 0/charm/ hooks/utils. py(496) parse_data( ) }'.format( key) flags(' member_ ready') }'.format( key) juju/agents/ unit-hacluster- 0/charm/ hooks/utils. py(497) parse_data( ) juju/agents/ unit-hacluster- 0/charm/ hooks/utils. py(498) parse_data( ) ganesha_ a3b980a_ vip": "ocf:heartbeat: IPaddr2" }'
> /var/lib/
-> _key = 'json_{
((Pdb)) l
491 return get_node_
492
493
494 def parse_data(relid, unit, key):
495 """Helper to detect and parse json or ast based relation data"""
496 -> _key = 'json_{
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/
-> data = relation_get(_key, unit, relid) or relation_get(key, unit, relid)
((Pdb)) _key
'json_resources'
((Pdb)) n
> /var/lib/
-> if data:
((Pdb)) data
'{"res_
((Pdb)) import subprocess check_call( ['relation- get'])
((Pdb)) subprocess.
((Pdb)) subprocess. check_output( ['relation- get']) 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'
b'corosync_