From 40a835e1337804229810e53fca003ad5b753f838 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 10 May 2017 15:34:01 +0200 Subject: [PATCH] + Fix hyperv node-snapshot --- centreon/common/powershell/hyperv/2012/nodesnapshot.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/centreon/common/powershell/hyperv/2012/nodesnapshot.pm b/centreon/common/powershell/hyperv/2012/nodesnapshot.pm index 945c794ce..28b715eb5 100644 --- a/centreon/common/powershell/hyperv/2012/nodesnapshot.pm +++ b/centreon/common/powershell/hyperv/2012/nodesnapshot.pm @@ -58,10 +58,14 @@ Try { if ($vm.status -imatch "Backing") { $VMDisks = Get-VMHardDiskDrive -VMName $vm.VMName Foreach ($VMDisk in $VMDisks) { - if ($VMDisk.Path -imatch ".avhdx" -or $VMDisk.VhdType -imatch "Differencing") { - $vhd = Get-VHD $VMDisk.Path - $parent = Get-Item $vhd.ParentPath + $VHD = Get-VHD $VMDisk.Path + if ($VHD.Path -imatch ".avhdx" -or $VHD.VhdType -imatch "Differencing") { + $parent = Get-Item $VHD.ParentPath + if ($i -eq 0) { + Write-Host "[name=" $vm.VMName "][state=" $vm.State "][note=" $note "]" + } Write-Host "[checkpointCreationTime=" (get-date -date $parent.LastWriteTime -UFormat ' . "'%s'" . ') "]" + $i=1 } } }