Create a snapshot
Take a snapshot of an OS or data disk VHD for backup or to troubleshoot VM issues. A snapshot is a full, read-only copy of a VHD.
Use Azure portal to take a snapshot
- Sign in to the Azure portal.
- Starting in the upper left, click New and search for snapshot.
- In the Snapshot blade, click Create.
- Enter a Name for the snapshot.
- Select an existing Resource group or type the name for a new one.
- Select an Azure datacenter Location.
- For Source disk, select the Managed Disk to snapshot.
- Select the Account type to use to store the snapshot. We recommend Standard_LRS unless you need it stored on a high performing disk.
- Click Create.
Use PowerShell to take a snapshot
The following steps show you how to get the VHD disk to be copied, create the snapshot configurations, and take a snapshot of the disk by using the New-AzureRmSnapshot cmdlet.
Make sure that you have the latest version of the AzureRM.Compute PowerShell module installed. Run the following command to install it.
Install-Module AzureRM.Compute -RequiredVersion 2.6.0
For more information, see Azure PowerShell Versioning.
Set some parameters.
$resourceGroupName = 'myResourceGroup' $location = 'eastus' $dataDiskName = 'myDisk' $snapshotName = 'mySnapshot'
Get the VHD disk to be copied.
$disk = Get-AzureRmDisk -ResourceGroupName $resourceGroupName -DiskName $dataDiskName
Create the snapshot configurations.
$snapshot = New-AzureRmSnapshotConfig -SourceUri $disk.Id -CreateOption Copy -Location $location
Take the snapshot.
New-AzureRmSnapshot -Snapshot $snapshot -SnapshotName $snapshotName -ResourceGroupName $resourceGroupName
If you plan to use the snapshot to create a Managed Disk and attach it a VM that needs to be high performing, use the parameter
-AccountType Premium_LRSwith the New-AzureRmSnapshot command. The parameter creates the snapshot so that it's stored as a Premium Managed Disk. Premium Managed Disks are more expensive than Standard. So be sure you really need Premium before using that parameter.
Create a virtual machine from a snapshot by creating a managed disk from a snapshot and then attaching the new managed disk as the OS disk. For more information, see the Create a VM from a snapshot sample.