Hi Glenn Maxwell,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
In the PowerShell script you've provided for taking snapshots of a Windows VM in Azure, you are actually creating full snapshots rather than incremental ones.
The documentation to create incremental snapshots is https://learn.microsoft.com/en-us/azure/virtual-machines/disks-incremental-snapshots?tabs=azure-cli#cli---list-incremental-snapshots. If you want to create incremental snapshots, the parameter Incremental should be mentioned in the script. And yes, by default as Rich Matheisen said, when running New-AzSnapshot
, it creates a full snapshot of the managed disk.
As per the documentation, you can take snapshots of Linux VMs in Azure using the same approach you've implemented for Windows VMs. Simply changing the -OsType
parameter from Windows
to Linux
in your New-AzSnapshotConfig
cmdlet will be appropriate for Linux VMs. Reference: https://learn.microsoft.com/en-us/powershell/module/az.compute/new-azsnapshotconfig?view=azps-12.4.0#example-1. As per my understanding, specifying -OsType Linux
does indeed cover all Linux distributions in Azure, including Red Hat, Ubuntu, SUSE, CentOS, Debian, and more.
The Get-Date
cmdlet gets a DateTime object that represents the current date or a date that you specify. Get-Date
can format the date and time in several .NET and UNIX formats. You can use Get-Date
to generate a date or time character string, and then send the string to other cmdlets or programs.
Please let me know if you have tried the date format suggested by Rich Matheisen, as it is a recommended approach.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-date?view=powershell-7.4&viewFallbackFrom=powershell-7.2
Hope this helps! Feel free to tag me in your comments, if you have any further queries.
If you feel that your queries have been resolved, please accept the answer by clicking the "Upvote" and "Accept Answer" on the post.