Comment 1 for bug 1736050

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1736050] [NEW] juju private-address returns wrong IP

How are we to tell what address is "wrong" vs "right" when all addresses
are private. (10.220.254.1 is certainly an RFC 1918 address.)

Charms are recommended to move away from "unit-get private-address" to
"network-get" (see docs for more complete information), which allows juju
to know what space/binding/etc the charm is trying to talk about, and
allows us to have enough context to know which address of multiple possible
addresses is correct.

On Mon, Dec 4, 2017 at 6:45 AM, Haw Loeung <email address hidden>
wrote:

> Public bug reported:
>
> Hi,
>
> Nagios checks etc. uses results returned from private-address. Seems on
> hosts where there's multiple, this can sometimes be wrong:
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "unit-get private-address"
> | 10.220.254.1
>
> Is it returning the first?
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "ip -4 addr"
> | 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
> group default qlen 1
> | inet 127.0.0.1/8 scope host lo
> | valid_lft forever preferred_lft forever
> | 8: br-eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
> state UP group default qlen 1000
> | inet 10.220.254.1/24 brd 10.220.254.255 scope global br-eno2
> | valid_lft forever preferred_lft forever
> | 9: br-eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
> state UP group default qlen 1000
> | inet 10.222.128.23/22 brd 10.222.131.255 scope global br-eno1
> | valid_lft forever preferred_lft forever
>
> Obviously wrong and should be 10.222.128.23:
>
> | ubuntu@comet:~$ sudo juju-run infra/0 "ip route get 8.8.8.8"
> | 8.8.8.8 via 10.222.128.1 dev br-eno1 src 10.222.128.23
> | cache
>
> This is from an environment deployed using Juju 2.2.3.
>
>
> Thanks,
>
> Haw
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1736050
>
> Title:
> juju private-address returns wrong IP
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1736050/+subscriptions
>