0
votes

I have successfully used this recipe in the past to migrate a virtual network including attached VMs: https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-cli-migration-classic-resource-manager

But today, and also when I tried last week, no matter the number of reboots, I get this error (Azure CLI):

> azure network vnet prepare-migration "<RG-NAME>"
info:    Executing command network vnet prepare-migration
error:   BadRequest : Migration is not allowed for HostedService 
<CLOUD-SERVICE> because it has VM <VM-NAME> in State :
RoleStateUnknown. Migration is allowed only when the VM is in one of the 
following states - Running, Stopped, Stopped Deallocated.

The VM is in fact running smoothly, and so says the Azure portal. So any ideas how to get out of this mess?

1

1 Answers

0
votes

Have you edited the NSG or local firewall of the VM? Please do not restrict the outbound traffic from the VM. It may break the VM Agent.

Also, please check if the VM Agent is running properly. If the VM Agent is not reachable, this issue may occur.

==============================================================================

Only issue is that I don't seem to be able to moved the Reserve IP to my new load balancer.

If we migrate the cloud service with a preserved public IP address, this public IP address will be migrated to ARM and be assigned to a load balancer automatically. (The load balancer is auto-created.) Then, you are able to re-assign this static public IP address to your load balancer.

Here is the screenshot of my lab:

  1. Before the migration

Before

  1. After the migration

enter image description here

  1. I can re-associate the IP with new load balancer after I delete the auto-created one.

Re-associate