網頁

2014年9月7日 星期日

Microsoft Azure --- how to move the machine from one to another subnet in the same region


If the Azaure VM locates on the wrong virtual network but on the same region, whether there is a method to move this VM from bad to right Subnet?
擷取選取區域_012.jpg
Yes, we can do it!
To log in to Azure subscription by executing the Add-AzureAccount powershell command. if the authentication is successful, we will collect some information for the VM will be moved later.
What information do we want to get? It will be the Cloud Service Name and VM Name by using the Get-AzureVM powershell command.
擷取選取區域_012.jpg
So do that we will know the maz-dc-05 VM belong to the xxx02 ServiceName.
At first, we will shutdown this VM by using the Start-Azure -ServiceName “Cloud Service Name” -Name “VM Name” powershell command.
擷取選取區域_011.jpg
And realize the original Subnet Name is “Subnet-FrontEnd” by executing the following command.
擷取選取區域_008.jpg
To move a VM to another subnet by using the Start-Azure -ServiceName “Cloud Service Name” -Name “VM Name” | Set-AzureSubnet –SubnetNames “the destination Subnet Name” | Update-AzureVM powershell command
擷取選取區域_009.jpg
So does that the VM has already been on the “Subnet-DMZ” now.
擷取選取區域_011.jpg

Reference:
(# 1). Move a VM or Role Instance to a Different Subnet
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.