Better start with Virtual Machines on the same subnet

Copper Contributor

Good day all,

  I'm new to Azure, but not to the public cloud, so i suppose having some insights and tips would let me being productive quickly, i hope.

I'm starting to evaluate Azure in general, and some cloud-native applications in particular, trying to leverage docker, kubernetes and the entire ecosystem over there.

Said so, the first step i want to achieve is the so called "kubernetes the hard way" or similar , to have a basic infrastructure made up of 3 virtual machines, and the build on top the services and what needed.

Of course i will use centos, and the first thin i need to understand is the network.

I've tried to build the first two vm but they end up on different subnets, which is something i want to avoid. I need to use VM1 on and the same subnet, or other, for the second and the third.

Can i do that?

Secondarily will come the connection, even if i don't need all the VMs widely accessible, as I have a jumphost (the first one VM would be enough).


Any suggestions, links and documentation, would be very appreciated.


Thank you



2 Replies



Yes you can assign them to the same subnet but not for all services. VMs can be created in the same VNet and they can connect to each other using private IP addresses. They can connect even if they are in different subnets without the need to configure a gateway or use public IP addresses. If you deploy multiple VMs into a VNet or subnet, they are assigned IP addresses as they boot up.


If you plan to deploy some Azure service resources into a virtual network, they may require, or create, their own subnet, so there must be enough unallocated space for them to do so. To determine whether an Azure service creates its own subnet, see information for each Azure service that can be deployed into a virtual network. For example, if you connect a virtual network to an on-premises network using an Azure VPN Gateway, the virtual network must have a dedicated subnet for the gateway but that is not the case for VM's :)



Thank you




Make sure you allocate enough addresses for VM resources. Azure allocates 5 host addresses for itself for each subnet, for example will provide 8 host addresses:

5 - automatically allocated by azure

3 - available for your VMs


VMs in the same VNET will be assigned an available IP address automatically.