GoogleCloudPlatform / google-cloud-powershell

PowerShell cmdlets for the Google Cloud Platform
http://googlecloudplatform.github.io/google-cloud-powershell/
Apache License 2.0
135 stars 61 forks source link

How To enable VSS snapshots using powershell #618

Open ihabhady opened 6 years ago

ihabhady commented 6 years ago

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

quoctruong commented 6 years ago

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

ihabhady commented 6 years ago

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.

quoctruong commented 6 years ago

@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.