In Microsoft Azure, an administrator can now use PowerShell to migrate a VM from one subnet to another within the same virtual network. This offers an opportunity to reorganize an application topology for better managing subnet capacity and grouping. For instance, when an existing subnet, ABC, is running out of IP addresses, customers can move the associated VMs to a different and perhaps larger subnet. At this time, subnet ABC can then be deleted to recover the IP address space.
The logical process to carry out a subnet migration is to:
The MSDN documentation at http://msdn.microsoft.com/en-us/library/azure/dn643636.aspx offers a sample PowerShell statement as below.
Get-AzureVM –Name <a target VM name> –ServiceName <the associated service name> `| Set-AzureSubnet –SubnetNames <a target subnet to migrate to> `| Update-AzureVM
And I am here providing a sample scenario of moving a VM from a DEV subnet to a TEST one as illustrated below.
A virtual network, fooNet, has three subnets: AD, DEV, and TEST, while each subnet is configured with a specific IP address range as shown.
This is a cross-posting from http://yungchou.wordpress.com.