The get_cluster_subnets [0] method uses resolve_network_ip [1] which uses _get_for_address which is looking for a *local* interface address such that the remote IP is a member of the local IPs subnet. Thus it returns None.
We will need another mechanism to implement the discovery of CIDR networks for each cluster member. We likely need to set ingresss-address or egress-subnets or some other relation key with this information.
TRIAGE:
The bug is lack of support for separate subnets for cluster nodes.
Each of the nodes in the example is on a separate subnet:
$ ipcalc 172.31.40.28/20 00011111. 0010 1000.00011100 11111111. 1111 0000.00000000 00000000. 0000 1111.11111111 00011111. 0010 0000.00000000 00011111. 0010 0000.00000001 00011111. 0010 1111.11111110 00011111. 0010 1111.11111111
Address: 172.31.40.28 10101100.
Netmask: 255.255.240.0 = 20 11111111.
Wildcard: 0.0.15.255 00000000.
=>
Network: 172.31.32.0/20 10101100.
HostMin: 172.31.32.1 10101100.
HostMax: 172.31.47.254 10101100.
Broadcast: 172.31.47.255 10101100.
Hosts/Net: 4094 Class B, Private Internet
$ ipcalc 172.31.29.80/20 00011111. 0001 1101.01010000 11111111. 1111 0000.00000000 00000000. 0000 1111.11111111 00011111. 0001 0000.00000000 00011111. 0001 0000.00000001 00011111. 0001 1111.11111110 00011111. 0001 1111.11111111
Address: 172.31.29.80 10101100.
Netmask: 255.255.240.0 = 20 11111111.
Wildcard: 0.0.15.255 00000000.
=>
Network: 172.31.16.0/20 10101100.
HostMin: 172.31.16.1 10101100.
HostMax: 172.31.31.254 10101100.
Broadcast: 172.31.31.255 10101100.
Hosts/Net: 4094 Class B, Private Internet
$ ipcalc 172.31.0.158/20 00011111. 0000 0000.10011110 11111111. 1111 0000.00000000 00000000. 0000 1111.11111111 00011111. 0000 0000.00000000 00011111. 0000 0000.00000001 00011111. 0000 1111.11111110 00011111. 0000 1111.11111111
Address: 172.31.0.158 10101100.
Netmask: 255.255.240.0 = 20 11111111.
Wildcard: 0.0.15.255 00000000.
=>
Network: 172.31.0.0/20 10101100.
HostMin: 172.31.0.1 10101100.
HostMax: 172.31.15.254 10101100.
Broadcast: 172.31.15.255 10101100.
Hosts/Net: 4094 Class B, Private Internet
The get_cluster_subnets [0] method uses resolve_network_ip [1] which uses _get_for_address which is looking for a *local* interface address such that the remote IP is a member of the local IPs subnet. Thus it returns None.
We will need another mechanism to implement the discovery of CIDR networks for each cluster member. We likely need to set ingresss-address or egress-subnets or some other relation key with this information.
[0] https:/ /github. com/openstack/ charm-mysql- innodb- cluster/ blob/master/ src/lib/ charm/openstack /mysql_ innodb_ cluster. py#L581 /github. com/juju/ charm-helpers/ blob/master/ charmhelpers/ contrib/ network/ ip.py#L227 /github. com/juju/ charm-helpers/ blob/master/ charmhelpers/ contrib/ network/ ip.py#L180- L202
[1] https:/
[2] https:/