How to change juju machine address

Hi ,

I have a Opestack Charm setup that is running fine. I had added a new host on it, that host as two IPs , one public that I will use here as X.X.X.X and a private that would be used as Y.Y.Y.Y . I did run the juju add-unit on that host and it run ok, except that the public IP address X.X.X.X are designate at juju status , so when I request juju machine information with juju show-machines it returns the correct IPs but with X.X.X.X at the first line , and at juju machines the X.X.X.X ip is the that is showing . How can I change the IP to Y.Y.Y.Y private ip at juju machines command and juju status list ?

1 Like

Iā€™m also interested in how to make juju update the network info.

Hi, I will try to answerā€¦ I think it happens at the level of the management of network spaces by ā€œjuju spacesā€ and the ā€œbindā€ command. @nvinuesa can clarify for us.
For Caas bundles, the Traefik Ingress controller snap makes the link for the public IP of the bundle and not of the machine. Thankā€™s.

Hi @moulab1 and thanks for joining!

There are two subjects here, one is how subnets are organized into spaces (this is a network modeling used by Juju and MAAS for example, mainly for network segmentation) and the other is the machineā€™s addresses.

Just to make sure I understand correctly, can you show the outputs of juju machines, juju show-machine {machineID} (where machineID is the host you just added), juju spaces and juju subnets please?

Also what do you mean by public and private addresses? I ask because Juju will just discover interfaces and the bound addresses but wonā€™t know which networks are public/private.

Hi @nvinuesa Thank you for your answer. What he said is that each machine has 2 IP addresses. One public and another private. What he asks is to change IP 2 to IP 1 for public access on the machine for example. In the case of my platform deployments. Each machine used an IP with PXE (172.200.0.0/24) from MAAS and another 192.168.70.0/24 Public. (see image 1)

When I deploy a model with Juju, it always takes the IP 172.200ā€¦ (see Image 2).

To have access to the charms deployed by this bundle, I always add traefik ingress for example. (see-Image-3)

Without this IP gateway 192.168.70.203, no access from the outside. (see Image-4)

The question asked initially is to swap the IPS directly on the bundle machine for example, I donā€™t know if we can do it directly.

There is also the story of tagging the subnet on MAAS too, to say this network concerns such charms as for example microceph on a microk8s clusterā€¦ Sorry, too much stuff. Thankā€™s.

OK, indeed I see better now.

As far as Iā€™m aware, users cannot manually select an address (when more than one is available), although you will see that they are all detected by the machine. Maybe @manadart or @jameinel have a workaround?

Regarding tagging a subnet on MAAS, if I understand correctly, you wonā€™t be able because you cannot let MAAS know what charms are using it. You can however create appropriate spaces and only deploy certain charms on them. Would something like that suit your needs?

1 Like

For my case, we have manually deployed machines which we have changed IP addresses for and juju still shows the old IPS in ā€˜juju statusā€™

1 Like

On which provider does this happen? And what happens exactly after the IP of the machine changed? Are you still able to see the machine? Is this also a machine with 2 NICs?

On which provider does this happen? Manual provider.

And what happens exactly after the IP of the machine changed? Hard to say, this was a long time ago. We havenā€™t been able to fix it.

Are you still able to see the machine? Yes. Everything seems to work fine. Its just the ā€œpublic addressā€ which is not right and ā€œjuju sshā€ doesnā€™t work for it.

Is this also a machine with 2 NICs? It has lots of nics. Its a physical server.

Thanks Erik! This is indeed an issue, juju addresses should be updated whenever the actual address on the machine changes (however they might happen).

If you can reproduce this, can you please open a bug? Iā€™ll try to work on this.

If you bounce jujud on the machine, does the address change?

@erik-lonroth I even had the same problem with deploying the maas-anvil project. Even if I change the IP of my network during deployment, juju always shows me the same IP on the first node. IP which is different on the other two nodes. I reported itā€¦

https://github.com/canonical/maas-anvil/issues/47 1er : 172.200ā€¦ 2em: 192.168ā€¦ 3em: 192.168ā€¦ Thankā€™s.