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

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/

Related

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

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

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.

Can you copy an Azure VM from one account to another account?

We created a VM for a client and set it all up on our account. A bunch of work. Now I'd like to put a copy of it on his Azure account (which he does not have yet) and keep my copy for troubleshooting. Is there a method I can use to backup the VM and restore it to his Azure account? Or any other suggested way to copy it to another account's VM?
Sure you can. Since VHD for your Virtual Machine is stored as Page Blob in Azure Storage, you can simply copy the blob from one storage account to another. You can use AzCopy tool to do that. There's no need for you to download the blob from main storage account and reupload it in backup storage account.
When you need to create a VM again, simply create an image using that blob and then create a VM from that image.
You can create Image and upload to the new account, You can check link for more information Create and upload a Windows Server VHD to Azure

Azure virtual machine - Purpose of Storage account

I'm looking for the purpose of a Storage account in Azure. Because I have a problem with.
My account is limited to 1 Storage account, and apparently I'm already using it, but I don't know why, I don't think I need it.
I have one virtual machine with a cloud service and the storage account. I would like to create another virtual machine but I can't because of the Storage account limit.
May I delete the Storage accout? I don't want to break my virtual machine.
Few months ago, I was able to create two virtual machines, so I don't understand why I can't anymore, my Azure account didn't change. Thanks.
Storage Account is "the storage" where Azure puts your Virtual Machine disks (=vhd files).
On the same Storage Account you can create more than one Virtual Machine.

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