Contrail-controller (but not only) do not respect juju space bindings. First controller unit gets data-address IP a from different space than other units whem data-network is not specified.
Configuration:
contrail-controller:
charm: cs:~juniper-os-software/contrail-controller
series: bionic
num_units: 3
constraints: spaces=oam-space,contrail-space
bindings:
"": *oam-space
controller-cluster: *contrail-space
contrail-controller: *contrail-space
http-services: *contrail-space
https-services: *contrail-space
nrpe-external-master: *oam-space
contrail-auth: *contrail-space
contrail-analytics: *contrail-space
contrail-analyticsdb: *contrail-space
options:
log-level: "SYS_DEBUG"
cassandra-minimum-diskgb: "4"
cassandra-jvm-extra-opts: "-Xms8g -Xmx8g"
docker-registry: *docker-registry
docker-user: *docker-user
docker-password: *docker-password
image-tag: *image-tag
auth-mode: rbac
# auth-mode: cloud-admin
https_proxy: *contrail_proxy
http_proxy: *contrail_proxy
no_proxy: *contrail_no_proxy
vip: *contrail-api-vip
control-network: *contrail-control-net
local-rabbitmq-hostname-resolution: True
haproxy-https-mode: http
cloud-admin-role: "admin"
data-network is not set.
All 3 units have 2 addresses:
192.168.209.x OAM space
172.16.131.x Contrail space
Relevant log example:
2020-04-21 11:19:12 DEBUG install hub.juniper.net/contrail/contrail-controller-config-dnsmasq:1912.32
...
2020-04-21 11:19:50 INFO juju-log IP_LIST: dict_values(['172.16.131.2']) IPS: {'contrail-controller/1': '172.16.131.2'}
2020-04-21 11:19:50 INFO juju-log DATA_IP_LIST: dict_values(['192.168.209.173']) DATA_IPS: {'contrail-controller/1': '192.168.209.173'}
2020-04-21 11:19:50 INFO juju-log IP_LIST: dict_values(['172.16.131.2']) IPS: {'contrail-controller/1': '172.16.131.2'}
2020-04-21 11:25:40 INFO juju-log controller-cluster:7: IP_LIST: ['172.16.131.2', '172.16.131.4', '172.16.131.3'] IPS: {'contrail-controller/1': '172.16.131.2', 'contrail-controller/0': '172.16.131.4', 'contrail-controller/2': '172.16.131.3'}
2020-04-21 11:25:41 INFO juju-log controller-cluster:7: DATA_IP_LIST: ['192.168.209.173', '172.16.131.4', '172.16.131.3'] DATA_IPS: {'contrail-controller/1': '192.168.209.173', 'contrail-controller/0': '172.16.131.4', 'contrail-controller/2': '172.16.131.3'}
You can see that the leader unit obtained address from 192.168.209.x and other 2 from the expected 172.16.131.x.
This applies only to first, leader, unit. Consult the way unit obtains IP:
https://github.com/tungstenfabric/tf-charms/blob/master/contrail-controller/hooks/contrail_controller_utils.py#L94
https://github.com/tungstenfabric/tf-charms/blob/a0b28e9c7869b5ea286e8e03a750cff2dd528bfd/contrail-controller/hooks/common_utils.py#L34
This code does not respect bindings defined in the charm as it should (use network-get to obtain IP in a valid space).
Contrail-controller (but not only) do not respect juju space bindings. First controller unit gets data-address IP a from different space than other units whem data-network is not specified.
Configuration:
data-network is not set.
All 3 units have 2 addresses:
192.168.209.x OAM space
172.16.131.x Contrail space
Relevant log example:
You can see that the leader unit obtained address from 192.168.209.x and other 2 from the expected 172.16.131.x.
This applies only to first, leader, unit. Consult the way unit obtains IP:
https://github.com/tungstenfabric/tf-charms/blob/master/contrail-controller/hooks/contrail_controller_utils.py#L94
https://github.com/tungstenfabric/tf-charms/blob/a0b28e9c7869b5ea286e8e03a750cff2dd528bfd/contrail-controller/hooks/common_utils.py#L34
This code does not respect bindings defined in the charm as it should (use network-get to obtain IP in a valid space).