Azure Empty Snapshot

TechGuy_MS1 61 Reputation points
2021-02-25T13:55:07.963+00:00

Hello,
I wanted to ask about empty snapshot. Hos is it different from "Snapshot"? Is it about taking snapshot of the OS only? Lets say if I have Win10 with several apps installed. Will empty snapshot means only OS Win10 will be coped? Can I create another VM from empty snapshot?

Apology for several questions, thanks for your help.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,282 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Andreas Baumgarten 68,386 Reputation points MVP
    2021-03-02T17:15:37.54+00:00

    Hi @TechGuy_MS1 ,

    I doubt it's possible to create a snapshot only of the disk capacity in use.
    The reason for that is for instance "data privacy". Microsoft is not allowed to take a look inside the disk to get the details how much data is stored in logical partition(s) on the disk.
    Snapshots always contain the full virtual disk, it doesn't matter how much data is stored on the disk.

    Same counts for the "selective disk backup". The full disk is backed up.
    https://learn.microsoft.com/en-us/azure/backup/selective-disk-backup-restore

    I think you have to think about a different solution than taking snapshots of the disk to backup your data.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

  2. JamesTran-MSFT 29,716 Reputation points Microsoft Employee
    2021-03-02T21:24:04.713+00:00

    @TechGuy_MS1
    Thank you for the quick follow up!

    When it comes to an Empty Snapshot, I wasn't able to find documentation on this, but I did find something referencing an "Empty Snapshot Object". This object is a configurable snapshot object and is used to create the snapshot.

    For example: New-AzSnapshotConfig

    #This command creates a local "empty snapshot object" with size 5GB in Standard_LRS storage account type. It also sets Windows OS type and enables encryption settings.  
    PS C:\> $snapshotconfig = New-AzSnapshotConfig -Location 'Central US' -DiskSizeGB 5 -AccountType StandardLRS -OsType Windows -CreateOption Empty -EncryptionSettingsEnabled $true;  
    #----------------------------------------#  
    #Initializing Secret and Key variables  
    PS C:\> $secretUrl = https://myvault.vault-int.azure-int.net/secrets/123/;  
    PS C:\> $secretId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault123';  
    PS C:\> $keyUrl = https://myvault.vault-int.azure-int.net/keys/456;  
    PS C:\> $keyId = '/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup01/providers/Microsoft.KeyVault/vaults/TestVault456';  
    #----------------------------------------#  
    #Setting the disk encryption key and key encryption key settings for the snapshot object.  
    PS C:\> $snapshotconfig = Set-AzSnapshotDiskEncryptionKey -Snapshot $snapshotconfig -SecretUrl $secretUrl -SourceVaultId $secretId;  
    PS C:\> $snapshotconfig = Set-AzSnapshotKeyEncryptionKey -Snapshot $snapshotconfig -KeyUrl $keyUrl -SourceVaultId $keyId;  
    #----------------------------------------#  
    #This command takes the snapshot object and creates a snapshot with name 'Snapshot01' in resource group 'ResourceGroup01'.  
    PS C:\> New-AzSnapshot -ResourceGroupName 'ResourceGroup01' -SnapshotName 'Snapshot01' -Snapshot $snapshotconfig;  
    

    Lastly, as stated by Andreas, taking a snapshot of only the data used on a disk isn't possible, since a snapshot is meant to be a full read-only copy of a virtual hard drive (VHD). If you'd like a snapshot feature that only takes a snapshot of used space on a disk, I'd recommend leveraging our User Voice forum so our engineering team can look into implementing this feature.

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

  3. TechGuy_MS1 61 Reputation points
    2021-03-03T08:01:07.847+00:00

    Dear @JamesTran-MSFT and @Andreas Baumgarten - thanks for your help and valuable responses.

    Regards,