Your chances of getting the previous IP address back are very slim. It's possible it has already been reassigned to another customer. There are two ways you can attempt to get your old IP address back, but neither is likely to succeed:
- Allocate a few static IP addresses in the same region and hope you get your old IP back.
- Contact Google Support and hope you are lucky enough that they can help you.
To prevent your IP address from changing again, you need to convert it from ephemeral to static. Converting the IP address from ephemeral to static can be done while the VM is running and does not cause the IP address to change.
You also need to update any DNS entries pointing to the old IP address so they will instead point to the new. And if you have any configuration files with the old IP address hardcoded, you will need to update those. Since the VM sits behind a 1-1 NAT and doesn't know its own external IP address, it's not very likely that configuration files on the VM contains the external IP address. But if you cannot get things to work, it is still a thing to watch out for.
You should also keep in mind that for highest availability you should not rely solely on a single region. Two ways to achieve redundancy across regions are:
- Use HTTP(S) load balancing with backends in two or more regions. (This solution has the added benefit that you get IPv6 support)
- Deploy your site on static regional IPs in two or more regions and put all of those static IPs in your DNS records.