We currently have a problem with a backup job that continuously does not produce correct backup data for a VM (backup status ok).
That's why I was looking for a way to quickly check all existing backups for functionality.
The options with Surebackup are not suitable for this (approximately 8000 vms should be checked).
- normal surebackup jobs with booting the VM are too slow and require a lot of preparation for the network and the analysis.
- simple sure backups since 12.1 are even slower, as a virus scanner usually takes hours...
I then used a Powershell script to mount all recent backups via iscsi publish to a host and checked the status of the file systems visible there and compared them with the information from the VCenter (e.g. a file system is missing because the disk does not have healthy ntfs).
Fortunately, no other system was found.
In follow-up, I may have come across a more elegant method.
Veeam makes it possible to integrate new virus scanners via an XML file for simple Surebackup jobs.
What speaks against using your own simple scanner via Powershell that does what you need.
In my case, a Powershell script that checks the NTFS volumes and compares them with (previously read) information from the VCenter.
Has anyone already done this and can give tips on how to store a Powershell script in the XML file, which in turn accepts parameters?
-
- Enthusiast
- Posts: 83
- Liked: 11 times
- Joined: May 09, 2012 12:52 pm
- Full Name: Stefan Holzwarth
- Contact:
-
- Product Manager
- Posts: 14828
- Liked: 1774 times
- Joined: Feb 04, 2013 2:07 pm
- Full Name: Dmitry Popov
- Location: Prague
- Contact:
Re: Fast surebackups using self defined virusscanner
Hello Stefan,
Can you please share what tests or checks you would like to trigger via PowerShell? Is that a chkdsk for disks from mounted backups? Thank you!
Can you please share what tests or checks you would like to trigger via PowerShell? Is that a chkdsk for disks from mounted backups? Thank you!
-
- Enthusiast
- Posts: 83
- Liked: 11 times
- Joined: May 09, 2012 12:52 pm
- Full Name: Stefan Holzwarth
- Contact:
Re: Fast surebackups using self defined virusscanner
Most important thing is to have the data of our customer in our backups.
If we can mount the disks of the vm and find a working filesystem 90% of the job is done.
Viruscheck or check whether vm is booting isn't needed in our case - so:
- Simple check - get-volume shows state e.g. healthy of mounted disk
- Enhanced checkdisk or repair-volume
And important - look for every disk that is reported by vcenter get-vmdisks since
surebackup doesn't care about this and only gives a log entry that a disk has no filesystem - no error.
Currently my check looks like this: (simplified)
If we can mount the disks of the vm and find a working filesystem 90% of the job is done.
Viruscheck or check whether vm is booting isn't needed in our case - so:
- Simple check - get-volume shows state e.g. healthy of mounted disk
- Enhanced checkdisk or repair-volume
And important - look for every disk that is reported by vcenter get-vmdisks since
surebackup doesn't care about this and only gives a log entry that a disk has no filesystem - no error.
Currently my check looks like this: (simplified)
Code: Select all
...
foreach ($disk in (Get-Disk | ?{$_.BusType -Eq "iSCSI"})){ # read in fo about iSCSI Disks
$partitions = ($disk | Get-Partition | ?{$_.Accesspaths -like $("C:\VeeamFLR\"+$backuptarget.vmname +"_*")})
foreach ($partition in $partitions) {
$volstate=Get-Volume -Path $($partition.AccessPaths|?{$_ -like "\\?\Volume*"})
$myvol = New-Object -TypeName PSObject
$myvol | Add-Member -MemberType NoteProperty -Name WindowsPath -Value $($partition.AccessPaths|?{$_ -like "\\?\Volume*" })
$myvol | Add-Member -MemberType NoteProperty -Name VBRPath -Value $($partition.AccessPaths|?{$_ -like "C:\VeeamFLR\*" })
$myvol | Add-Member -MemberType NoteProperty -Name VolState -Value $volstate.healthstatus
$myvol | Add-Member -MemberType NoteProperty -Name FilesystemType -Value $volstate.FileSystemType
$myvol | Add-Member -MemberType NoteProperty -Name FilesystemLabel -Value $volstate.FileSystemLabel
$myvols+=$myvol
}
}
foreach ($myvol in $myvols) {
if ($myvol.volstate -eq "Healthy") {
Write-Host -ForegroundColor Green "$($myvol.FileSystemLabel) - $($myvol.FileSystemType) - OK"
} else {
Write-Host -ForegroundColor Yellow "$($myvol.FileSystemLabel) - $($myvol.FileSystemType) - $($myvol.volstate)"
}
}
$mountedvolcount = $($($myvols|?{$_.FilesystemLabel -ne "System Reserved"})|Measure-Object).count
$expectedvolcount= $($vmdisks|?{$_.Diskpath -notlike "c:\Users\*"}|Measure-Object).count #c:\Users\ -> citrix # with $vmdisks=$vm|Get-VMGuestDisk from vcenter
$compare = $mountedvolcount - $expectedvolcount
switch ($vergleich) {
{$_ -lt 0} {
Write-Host -ForegroundColor red "ERROR - Mounted Volume missing - ist: $mountedvolcount soll: $expectedvolcount !"
}
{$_ -gt 0} {
Write-Host -ForegroundColor Yellow "WARNING - Mounted Volume to much - ist: $mountedvolcount soll: $expectedvolcount !"
}
{$_ -eq 0} {
write-host -foregroundcolor Green "Alle Disks im iSCSI Mount gefunden."
}
default {
write-host -ForegroundColor Red "Unknown eror"; exit 1
}
}
if ($compare-ne 0) {
write-host "Expected:"
$vmdisks|out-host
write-host "Found:"
$myvols|?{$_.FilesystemLabel -ne "System Reserved"}|Select-Object FilesystemLabel,VolSize,VolFree| Format-Table
return "ERROR"
} else {
return "OK"
}
}
Who is online
Users browsing this forum: Andreas Neufert, Ilya V, Regnor and 206 guests