Is it Possible To Move An Azure Virtual Machine To Another Region? - azure

I have an Azure VM with un-managed disk. I want to move it to another region.
Is there any other way than generalizing my current VM?

Is there any other way than generalizing my current VM?
Azure does not support changing a VM's location. You need copy the VM's VHD to another location and use that VHD to create a new VM.
If you don't use current VM's VHD to create multiple VMs in other location, you don't need generalize your VM. Please refer to following steps.
Stop your VM.
Create a new storage account and blob container in another location.
Copy VHD to the new storage account, you could use Azcopy. For more information about Azcopy please refer to this article.
AzCopy /Source:https://shuidisks446.blob.core.windows.net/vhds /Dest:https://shuidiag102.blob.core.windows.net/vhds /SourceKey:sGqtdFHQWQWYyf2tRWGF5jkeAEubTp13AVaeTM25QogxXE+K0Ezq1ulcs18qGVPhCEp6ULdLLbKVa7fMbUvYZg== /DestKey:iCjeS+eegjkSJXHjH2UqCkqXnUPiCGvxaOG0Ad2LoPgUnvBoWl9wQJtC1jc//lOj4CF7khpLQe791P4QeyTY6Q== /Pattern:shui20161222141315.vhd
Use the VHD to create a new VM. It is easy for you to recreate with existing VHD by using this template.
Important: Because you don't generalize your currently VM, please don't start two VM at the same time. The second would have the same network issue.

Yes, even though the VM is generalized if you restore from backup the working state will get restored
Plan your VM backup infrastructure in Azure
https://learn.microsoft.com/en-us/azure/backup/backup-azure-vms-introduction
Back up Azure virtual machines to a Recovery Services vault
https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-vms
Use Azure portal to restore virtual machines
https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms

Azure Site Recovery now offers migration capability between some regions. See this link for details.
https://learn.microsoft.com/en-us/azure/site-recovery/azure-to-azure-tutorial-migrate
Notably, you can only move between supported regions as shown here - basically the same continent.
https://learn.microsoft.com/en-us/azure/site-recovery/azure-to-azure-support-matrix#region-support

Related

Can't restore a VM from a disk backup in Azure

I can't get my VM disk restored in Azure: it is only "converted" to the Storage Account linked to my VM.
Does anyone know how to get a VM fully restored from a Recovery Service Vault backup in Azure please?
Edit :
For additional precision, I made a simple Linux VM hosting a test website in order to experience Azure's backup and restore feature.
So once the test website was online, I waited for a backup job to be done.
Then I deliberately broke the test website inside the VM, and launched a disk restore.
Unfortunately, the restore did nothing to the VM. I checked on the jobs and restore was marked as "Successful", and a VM restart did nothing.
Anyway, I can find the "vhd" in the Conainer tab of the Storage Account. But I can't find a way to attach it to the VM...
Is the disk restoration feature even supposed to work like intended ?
I tried to replicate a backed up restore of a virtual machine using Azure Site Recovery.
When you restore the virtual machine you have the option to select if you want to restore the disks or the virtual machine.
Selecting here to restore as a VM, will create the VM for you.
You can check that status of the restore by going to the jobs section of the machine in ASR.
For reference, see this page for more detailed instructions.
This likely flies in the face of what Azure thinks it can do, but have you tried to create the VM first and then just restore your data? Other possible options are:
The user you are logged in as does have the correct permissions to create a VM in that space as well as restore the data, yes?
And you did select Recovery Service vaults in the portal, correct?
check if the original VM had any special conditions, such as multiple NICs or a load balancer. Any custom VM configurations, including HUB licensing, will not be duplicated with the Create Virtual Machine option as it uses Quick Create. You will need to use PowerShell to attach the restore disks to your chosen VM configuration. You can get additional information on PowerShell and Azure backups here.
And in the link that kim provided above, scroll down to the "Create a new VM from a restore point" section and review the options and notes for creating a new VM. You can get more information on ASR at this page.

Azure back up vs Snapshots

I'm an azure newbie and just trying to understand Azure better. My questions are specific to backing up Linux VMs in Azure. Please help me in understanding it better.
I read that Azure backup takes snapshots and then uploads them to the vault. I'm trying to understand how using 'Azure backup' to backup a VM is different from taking the snapshots of OS Disk and data disk of azure VM via "az vm" cli commands?
What exactly is the vault here? Is it internally implemented as a storage account with blob container or is it something similar to the Glacier in AWS?
Which is better cost wise, azure backup or osdisk snapshots?
If both the options are similar, i.e using azure backup or taking a snapshot of OS disk/Data disks. Is there an advantage of using one over the other?
Are the Snapshots of OS disk taken in Azure global in nature? Can they be accessed from any other geos?
In the azure portal, snapshots, what is "snapshot state"? Why is the snapshot state "Unattached" for me even after spinning off a VM from the snapshot disk?
I'm trying to understand how using 'Azure backup' to backup a VM is different from taking the snapshots of OS Disk and data disk of azure VM via "az vm" cli commands?
Azure backup works as disaster recovery service(DRaaS). It is a managed service and more easier to use. You don't need to worried where and how the backup files are stored. If the VM is running, Azure Backup service uses the VMSnapshotLinux extension to take a point-in-time snapshot in Linux. Otherwise, the Backup service takes a snapshot of the underlying storage.
What exactly is the vault here?
A backup vault is an managed storage service that stores all the backups that have been created over time. It also contains the backup policy applied to the protected VMs.
Is it internally implemented as a storage account with blob container or is it something similar to the Glacier in AWS?
It is a managed service, it hasn't been announced how it is worked.
Which is better cost wise, azure backup or osdisk snapshots?
Azure backup has extra charge than the storage consumed charge. For more information, link below is for your reference.
Backup Pricing
Is there an advantage of using one over the other?
If you want to take a snapshot and the VM is running, we suggest you shutdown the VM first to take a clean and consistent snapshot. Azure backup service will use a extension to do it, we don't need to shutdown the VM.
Are the Snapshots of OS disk taken in Azure global in nature? Can they be accessed from any other geos?
A snapshot is a read-only blob, it can be accessed from any other geos.
In the azure portal, snapshots, what is "snapshot state"?
The 'Unattached' is the state of image/disk. It means that the disk haven't attached to any VM.

How to chage a VM's os Disk

I have created a VM (Standard DS11 v2) on Azure about 2 - 3 weeks ago. It attached a premium disk which has extra price. (I did not know that when I created the VM.)
Now I want to change this disk to a standard disk. As I see, it is not possible to downgrade a premium disk to standard.
What I am trying to do is:
Attach a standard disk to my VM.
Copy premium disk to standard disk.
Make standard disk OS disk.
Detach premium disk.
Delete premium disk.,
How can I do that?
Also I am open to different solutions to my problem.
My OS is Centos 7.2.
You could not resize Ds series VM to D series VM.
Based on my knowledge, you could recreate your VM by using your VHD.
Please refer the following steps.
Stop and delete your VM but don't delete the VM's VHD.
Create a new standard storage account and blob container in the same resource group.
Copy VHD to the new storage account, you could use Azcopy.
AzCopy /Source:https://shuidisks446.blob.core.windows.net/vhds /Dest:https://shuidiag102.blob.core.windows.net/vhds /SourceKey:sGqtdFHQWQWYyf2tRWGF5jkeAEubTp13AVaeTM25QogxXE+K0Ezq1ulcs18qGVPhCEp6ULdLLbKVa7fMbUvYZg== /DestKey:iCjeS+eegjkSJXHjH2UqCkqXnUPiCGvxaOG0Ad2LoPgUnvBoWl9wQJtC1jc//lOj4CF7khpLQe791P4QeyTY6Q== /Pattern:shui20161222141315.vhd
More information about Azcopy please refer to this article.
Use the VHD to create a D series VM. It is easy for you to recreate with existing VHD by using this template
Delete your Premium Storage Account.

How to move an Azure Virtual Machine to another storage account?

In Windows Azure, I have created a number of virtual machines over the same storage account. I want to move some of those virtual machines to a different storage account so that I can have Geo-Replication for only some of them instead of all.
Is there any way to change the storage account of a VM?
There is no such feature provided out of the box. What you can do is following:
Shut down the VM
Copy the system disk's VHD to the new storage account (use Copy Blob feature!)
Create a new VM based on the copied VHD
(Pray that the new VM will boot up successfully :) )
Most of the times this scenario is valid and works.
Yes you can. Please find the refrences below-
http://azure.microsoft.com/blog/2014/10/22/migrate-azure-virtual-machines-between-storage-accounts/
http://michaelwasham.com/windows-azure-powershell-reference-guide/copying-vhds-blobs-between-storage-accounts/

How do I migrate an existing Windows Azure VM to a Windows Azure virtual network?

I would like to migrate our test server - a Windows Azure VM running Windows 2008 server (running AD DC and variety of apps such as Dynamics CRM) - to a virtual network.
I am looking for a safe way to migrate the server to the virtual network.
My research to date indicates that I can create a new VM using the same OS disk. However when I attempt to create a new VM the existing OS disk is not visible in the list of images.
Is anybody able to point me in the right direction as to how this is achieved? Also, do you have any recommendations with respect to a rollback strategy (e.g. Backup tools)?
Alan.
I haven't verified the flow, but it should be working fine. Follow these steps:
Make sure you are not using static IP on your AD/DC. The IP Addresses in Azure shall always be DHCP allocated!
Shut down the AD/DC
Copy the VHD blob to a new blob! I strongly suggest that you have the OS Disk (VHD blob) in a storage account which is in the same affinity group as the Virtual Network. So, if the current OS Disk is not in a Storage Account, which is in the same affinity group as the VNet, create a new storage account and copy the original VHD there. Please note that you should copy the blob only when the VM is shut down!
Create the sub-net you want to bring the VM in. (probably you already have created it).
Create a new VM using the copied VHD as an OS Disk and selecting the Virtual Network and sub-net.
Possible gotchas with this migration:
IP Address of AD/DC will change when added to the Virtual Network. Be prepared and never assign static IP Address to a VM in Azure
You will not see the VHD in the list of possible images to use - in that case use some kind of storage explorer (such as Cloud Storage Studio) to make sure there is no existing lease on the blob with the VHD. If there is a lease - break it!
A suggested VNet setup for AD/DC/DNS infrastructure in azure is clearly described in this blog post

Resources