google-cloud-powershell icon indicating copy to clipboard operation
google-cloud-powershell copied to clipboard

How To enable VSS snapshots using powershell

Open ihabhady opened this issue 6 years ago • 3 comments

Hi,

I have script that takes snapshot perodically and it working good. When i try to enable VSS using this reference http://googlecloudplatform.github.io/google-cloud-powershell/#/google-compute-engine/GceSnapshot/Add-GceSnapshot by adding parameter ‑GuestFlush or ‑VSS is not working. Can anyone give me an example how the VSS is working in the powershell command.

Thanks

ihabhady avatar May 21 '18 14:05 ihabhady

@ihabhady, thanks for using the module. Can you provide the exact command that you use?

quoctruong avatar May 24 '18 16:05 quoctruong

Thank you quoctruong for your feedback.

foreach ($Zone in $Zones) { $DisksInZone = Get-GceDisk -Project $Project -zone $Zone | foreach { $_.Name }

foreach ($Disk in $DisksInZone) {
    Write-Host "=========================================="
    Write-Host "$Zone "-" $Disk"
    Write-Host "=========================================="
    Add-GceSnapshot -project $Project -zone $Zone $Disk -VSS 
    }

}

I used -VSS and ‑GuestFlush but not working.

ihabhady avatar May 29 '18 10:05 ihabhady

@ihabhady Do you happen to have the error message when you run the command? Also, I believe VSS snapshots work only on Windows instances with image version v20160810 and newer.

quoctruong avatar May 29 '18 16:05 quoctruong