osede.blogg.se

Azure take snapshot of vm
Azure take snapshot of vm












azure take snapshot of vm azure take snapshot of vm

This operation can be performed entirely via the portal, but for me it is more time consuming and I do not use it ) Copy the VM to it and move the entire resource group (containing a copy of our VM) to a new location, region B. Assuming that we have a VM in region A that we want to copy to region B, we can, for example … Create a new resource group in region A. Another way to move the diskīy the way, there are other ways that you can move the drive to another region without even using PowerShell. If you made it to the end and would like more advanced stuff, leave comments and I will try to do a more advanced post. It all depends mainly on our ingenuity, remember that.

azure take snapshot of vm

create a snapshot disk at the target location,.move the snapshot to the target location,.create a Storage Account in the target location,.

azure take snapshot of vm

You might as well create a more complicated script that, after specifying the source disk name, resource group, and target location: I gave a simple example that you can move a snapshot to another region. You can learn how to replace the disk itself in a virtual machine from the previous article: Please note that the created disk cannot be smaller than a snapshot. When you creating a disk as a source, select “Storage blob” and select the image you have just created. When you have move the snapshot to a new location (region), you can easily create a disk using the portal. Start-AzStorageBlobCopy -AbsoluteUri $snapshotaccess.AccessSAS -DestContainer $StorageAccountBlob -DestContext $DestStorageContext -DestBlob "$($vhdname).vhd" -Force -ErrorAction stop $DestStorageContext = New-AzStorageContext –StorageAccountName $storageaccount -StorageAccountKey $StorageAccountKey -ErrorAction stop $snapshotaccess = Grant-AzSnapshotAccess -ResourceGroupName $SnapshotResourceGroup -SnapshotName $SnapshotName -DurationInSecond 3600 -Access Read -ErrorAction stop $snapshot = Get-AzSnapshot -ResourceGroupName $SnapshotResourceGroup -SnapshotName $SnapshotName $StorageAccountKey = (Get-AzStorageAccountKey -Name $StorageAccount -ResourceGroupName $StorageAccountResourceGroup).value $storageaccountResourceGroup = "ResourceGroupNAME2" $StorageAccountBlob = "StorageAccountBlobNAME" $SnapshotResourceGroup = "ResourceGroupNAME1" If you do not have a Storage Account created in the target location, you need to create it. Finally, the name of the created disk image. We give its name, the name of the BLOB to which the disk image will go, and the name of the resource group in which it is located. Before running the script below, you need to correct the variable names in it.Įnter the name of the snapshot you want to move and its resource group.














Azure take snapshot of vm