Can I assume a machine's private IP to stay stable?

For various reasons, I have to keep track of my machines’ IDs and private IPs and route traffic to them.

On creation, each machine gets a private IP (IPv6 address of a machine for reaching it from within other machines in the same organization). Can I assume that this private IP will stay the same for a given machine throughout updates of the machine config and base image version? Or the other way around: under what circumstances would that private IP change?

1 Like

My understanding is the IP will stay the same unless you manually detach and attach a new one. Shared IPs can be assigned to many machines and uses their proxy to go to the correct app based on URL (I assume), but dedicated ones will always point to a single machine.

The private IP will stay the same for the same machine unless we need to rebalance and move the machine to a different host. The way it is structured, part of the private IP is specific to each host.

It can happen, but it should be rare. It’s best to use DNS resolution to get up to date IPs.

1 Like

Thank you.

I am indeed able to convert a machine ID to its private IP by querying the Fly DNS for 32877432fe6948.vm.my-app-name.internal.

As a little follow-up question: Can I assume stability for the IDs assigned to the machines? Would the ID change if it gets moved to a different host?

2 Likes

Yes, machine IDs are stable even if they are moved.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.