IP address changed but relation data (hostname and private-address) still not updated
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Ubuntu Repository Cache Charm |
Medium
|
Haw Loeung | ||
| charm-haproxy |
Undecided
|
Unassigned | ||
| juju |
Undecided
|
Unassigned |
Bug Description
Hi,
u-r-c was stopped and started for maintenance in AWS. Unfortunately, the HAProxy unit still has the old IP. The u-r-c charm should really detect IP changes and send it through the relation.
| ubuntu@
| 1
| # be_id be_name srv_id srv_name srv_addr srv_op_state srv_admin_state srv_uweight srv_iweight srv_time_
| 5 ubuntu-
| 5 ubuntu-
| 5 ubuntu-
| ubuntu@
| inet 10.127.251.15/24 brd 10.127.251.255 scope global eth0
| ubuntu@
| hostname: 10.187.27.67
| port: "80"
| private-address: 10.187.27.67
Related branches
- Stuart Bishop: Approve on 2020-12-07
- Barry Price: Approve on 2020-12-03
-
Diff: 48 lines (+17/-0)1 file modifiedreactive/ubuntu-repository-cache.py (+17/-0)
- Barry Price: Approve on 2020-12-03
- Canonical IS Reviewers: Pending requested 2020-12-03
-
Diff: 61 lines (+19/-3)1 file modifiedhooks/hooks.py (+19/-3)
Haw Loeung (hloeung) wrote : | #1 |
Haw Loeung (hloeung) wrote : | #2 |
This is juju 2.6.10.
Changed in ubuntu-repository-cache: | |
status: | New → Invalid |
summary: |
- Old/stale IP on HAProxy units + IP address changed but relation data (hostname and private-address) + still not updated |
Haw Loeung (hloeung) wrote : | #3 |
As discussed with Ian (wallyworld):
|14:34 <wallyworld_> hloeung: if i recall, private-address is set when the relation is first set up. it's use is deprecated
in favour of using network-get. i wonder what that shows. typically i think an address chnage on a host machine generates a
config-change hook and from there you can get any new address values via unit-get private-address, but network-get is
preferred
network-get provides the correct info:
| ubuntu@
| bind-addresses:
| - macaddress: ""
| interfacename: ""
| addresses:
| - hostname: ""
| address: 10.127.251.15
| cidr: ""
| egress-subnets:
| - 10.127.251.15/32
| ingress-addresses:
| - 10.127.251.15
So the HAProxy charm should use network-get rather than private-address.
Changed in juju: | |
status: | New → Invalid |
Haw Loeung (hloeung) wrote : | #4 |
Used relation-set to work around it for now:
| sudo juju-run ubuntu-
Haw Loeung (hloeung) wrote : | #5 |
u-r-c also uses relation-get private-address for it's peers and the metadatasync.
Changed in ubuntu-repository-cache: | |
status: | Invalid → New |
Dmitrii Shcherbakov (dmitriis) wrote : | #6 |
You can use ingress-address which replaced private-address - it is populated by Juju when a unit enters the relation scope at the Juju level - in other words, on <name>-
`network-get <binding-name>` can be used to retrieve ingress-address and bind-address of the unit for the current hook execution.
As for hostnames, see https:/
Haw Loeung (hloeung) wrote : | #7 |
Yeah, ingress-address (via network-get) is what we want the charms to be using as that's what juju keeps up-to-date rather than 'relation-get private-address' which is only changed on establishing the relation.
Changed in ubuntu-repository-cache: | |
assignee: | nobody → Haw Loeung (hloeung) |
status: | New → In Progress |
Changed in ubuntu-repository-cache: | |
importance: | Undecided → Medium |
Changed in ubuntu-repository-cache: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-repository-cache: | |
status: | Fix Committed → Fix Released |
Or maybe this is juju that updates hostname and private-address?