Windows Azure Infrastructure Services IP Address Management (Part 1)
Join the DZone community and get the full member experience.Join For Free
this two-part series details the ip address management of windows azure infrastructure services including:
- part 1. windows azure infrastructure services ip assignments facts (this article)
- part 2. how to assign a static ip to a windows azure vm and a sample session
this series is a cross-posting from http://yungchou.wordpress.com .
we will first examine some basic concepts to better understand how ip addresses are assigned in windows azure and what are the implications.
vip vs. dip
upon deployment, a windows azure vm instance has two ip addresses:
- a vip (virtual ip address) is the public ip address pointing to the cloud service where the vm is deployed to. notice that a vip once assigned is not released from a cloud service till every vm instance in the cloud services has either a “stopped (deallocated)” status or deleted.
- a dip (an internal ip assigned by windows azure with dhcp) is the ip address assigned to the vm for communicating within windows azure. notice that a dip once assigned is not released from a vm till the vm has a “stopped (deallocated)” status.
the following illustrates a conceptual model where multiple vms are deployed to a cloud service. a vip is assigned to windows azure’s public interface and pointing to this cloud service, while each vm within the cloud service has an individual dip assigned by windows azure via dhcp.
notice that if these vms are deployed to a virtual network, a dip will be assigned from or released to the address pool defined in the virtual network configuration.
endpoint vs. port
in windows azure, accessing a cloud service from internet requires an endpoint which is a pair of two ports associated with the vip of the cloud service. the public port of an endpoint is the one facing internet, while within windows azure the corresponding port is the private port. the above diagram depicts the concept of an endpoint as the vehicle to access a cloud service from internet, while a defined endpoint effectively connects a public interface and a private one of a cloud service with a port translation at the edge of windows azure where the vip points.
stopped vs. stopped (deallocated)
a windows azure vm instance can be shut down with two fundamental ways. one is to shut down a vm within the vm instance itself as shown below. this will bring the vm to a “stopped” state. at this time, although the instance is stopped, it is however not deallocated, and consequently it is still being charged by minute based on the pricing model as detailed in http://aka.ms/waprice .
another way to stop the vm instance is to operate directly from windows azure management portal by highlighting a vm an click the shutdown button from the black menu bar as shown above. which in addition to shutting down the vm, it also deallocates the instance as the status, stopped (deallocated), indicated. at this time, the vm instance is not being charged any more.
the storage cost of a vm is introduced by the associated vhd file which include an os disk and additional data disk, if added. this storage cost is always there since regardless the state of a vm, storage capacity is consumed to store a vhd file which is stored as page blobs in an associated storage account and depending on if geo-replication is maintained, there may be additional storage and transmission costs. the article, http://aka.ms/hadr explains the two storage account types and how they work.
ip assignments in windows azure virtual network (vnet)
when deploying vms to a vnet, the dips (i.e. internal ip addresses) of vms are allocated from a configured address pool (as defined in vnet) in the order of each vm is deployed. therefore deploying the same vms in a different order to the vnet or deallocate then redeploy vms in a vnet will likely result in different internal ip addresses assigned. for example, two vms in a vnet had had a stopped deallocated state and then both were restarted in a random order. the new internal ip addresses assigned to the two vms will likely be different than those ip addresses previously assigned before deallocation. this behavior is most noticeable after restarting those vms with a stopped deallocated state which as addressed earlier releases the internal ip address. and it is an issue for a deployment expecting vms with persistent ip addresses throughout the lifetime of an associated service. however, if static ip addresses were assigned to vms, the same predictable ip address will be in the vm upon restart. for a vm deployed to a vnet, a static ip can be assigned to the vm using windows azure powershell.
in part 2, we will walk through a sample session on assigning a static ip to a vm which is deployed to a vnet.
Published at DZone with permission of Yung Chou, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.