Forum Discussion
Availability zone with same IP address
Hi,
Can Azure support in a different availability zone with a same IP address?
Thanks.
- pazdedavSteel Contributor
Hi ariffisariff,
Availability Zone (AZ) in Azure is a construct that allows for high availability design. AZs are unique physical locations within a region. Each zone is made up of one or more datacenters equipped with independent power, cooling, and networking.
Virtual Networks (when created) span the entire region. In other words, it is stretched to all AZs within the region, allowing you to use one address space and "spread" your Compute resources (typically Azure VMs) to multiple zones, but they are still connected to the same VNet.
I am not sure, if this answers your question, but AZ is not a networking feature, it is a physical boundary of buildings, equipment, and hardware, helping you to design and build more resilient applications and services.
- ariffisariffCopper Contributor
pazdedav Hi David. Thanks for the explanation. Are there any chances that I can provision 2 new VM within AZ with the same IP address? I have this question coming because based on my testing, the only configuration that I can configure the AZ to 1 or 2 or 3 zones which I can't technically configure to edit the IP address.
The only my understanding now is when I spawn a new VM in one region, I can select how many AZ (1, 2 or 3). My objective is simple, I have one application where I want to make it redundant for HA.
Traditionally, for HA, I need to spawn 2 VMs with a different IP address in the separate data centre and configure it for HA.
- ariffisariffCopper Contributor
pazdedav Hi David. Thanks for the explanation. Are there any chances that I can provision 2 new VM within AZ with the same IP address? I have this question coming because based on my testing, the only configuration that I can configure the AZ to 1 or 2 or 3 zones which I can't technically configure to edit the IP address.
The only my understanding now is when I spawn a new VM in one region, I can select how many AZ (1, 2 or 3). My objective is simple, I have one application where I want to make it redundant for HA.
Traditionally, for HA, I need to spawn 2 VMs with a different IP address in the separate data centre and configure it for HA.
- pazdedavSteel Contributor
Hi ariffisariff ,
If your goal is to make your application redundant, then using availability zones (or availability sets) is the right approach, but instead of trying to assign the same IP address to both machines (which is not technically possible, if they both are in the same VNet), you would typically have a load balancer (could be for example an Azure Load Balancer or Application Gateway) with a 'virtual IP address' (also referred to as 'fronted IP') and configure your clients to communicate with the VIP, rather than internal IPs of your VMs. Then you can configure your load balancer to distribute network traffic to your VMs (backend pool) based on rules and health of your backend pool (using probes).
Check this overview to learn more: https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-overview
This guide explains how to distribute traffic to VMs in different zones: https://docs.microsoft.com/en-us/azure/load-balancer/tutorial-load-balancer-standard-public-zone-redundant-portal
- SeyedBasimCopper ContributorAs David explained AZ is for high Availability seperated by a physical boundry within the region. But definitely no 2 compute resources within 2 AZs have the same internal IP. Because all the Compute resource has its own internal IP addresses. But you can have Public IP to be the same across VMs within 2 different AZs.
In that case:
1. For inbound - use Load Balancer or Application Gateway(only in layer 7)
2. For outbound - use NAT Gateway
https://docs.microsoft.com/en-us/azure/virtual-network/nat-gateway-resource