Last active
June 15, 2016 21:25
-
-
Save vMarkusK/0de7b009458fdc255c572049ea3a0838 to your computer and use it in GitHub Desktop.
Fix for Snapshot consolidation in VMware ESXi 5.5.x and ESXi 6.0.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Set-ConsolidationFix { | |
[cmdletbinding()] | |
param ( | |
#[parameter(Mandatory=$true)] | |
[parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]$myVM, | |
[parameter(Mandatory=$true)] | |
[string]$Fix = "Timeout" # Timeout or Stun | |
) | |
Process { | |
if ($Fix -like "Timeout") { | |
$MyVM | New-AdvancedSetting -Name snapshot.asyncConsolidate.forceSync -Value TRUE -Confirm:$False -Force:$True | |
$MySnap = $MyVM | New-Snapshot -Name "ConsolidationFix" | |
$MySnap | Remove-Snapshot -confirm:$false | |
} | |
elseif ($Fix -like "Stun") { | |
$MyVM | New-AdvancedSetting -Name snapshot.maxConsolidateTime -Value 30 -Confirm:$False -Force:$True | |
$MySnap = $MyVM | New-Snapshot -Name "ConsolidationFix" | |
$MySnap | Remove-Snapshot -confirm:$false | |
} | |
else { | |
Write-Error "No Valid Fix" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment