In the same Azure Subscription, each VM will build into a new cloud service if we create a new VM by taking the default set of options in the wizard. So do that we will reach the limit of 20 cloud service and the next new VM cannot be created besides apply for the request to Microsoft Cloud Help Desk.
“Whether VMs can move between different cloud services?” The following process will finish this thought.
Get the VM information by using the
Get-AzureVM -servicename “<old cloud service name>” -name “<VM name>” command
Export this VM config by using the
Export-AzureVM -ServiceName “<old cloud service name>” -name “<VM name>” -path “<.xml file>” command
Remove this VM from Azure but doesn’t delete the VHD file on disk
(# 1) by using the
Remove-AzureVM -ServiceName “<old cloud service name>” -Name “<VM name>” command
Edit the .xml file if we want to change local port number or Subnet Name for being compatible with the destination cloud service.
Ensure the current storage account is accessible by executing the
Get-AzureSubscription command.
If we find out the CurrentStorageAccount is blank, please choose what storage account this VMis in by using the
set-AzureSubscription -SubscriptionName “<Azure Subscription>” -CurrentStorageAccount “<new Storage Account>” command.
(# 2)
Import the VM config for creating this VM back to Azure by using the
Import-AzureVM -path “<.xml file>” | New-AzureVM -ServiceName “<new cloud service name>” -VNetName “<virtual network name>” command.
So does that the VM has already been moved to another cloud service.
Reference :
(# 1) Click on the Storage Icon on the left、select a storage account to open the Storage Main Page、click on the Containers tab and vhds item. We can see the removed VHD file in the list.
(# 2) If the CurrentStorageAccountName is not defined, we will get the following error message when execute the
Import-AzureVM powershell command.
沒有留言:
張貼留言