hi!
Is it possible to use PowerShell cmdlets to find out from the backup task which virtual machines are on which virtualization host?
-
- Novice
- Posts: 5
- Liked: never
- Joined: Nov 28, 2023 11:19 am
- Full Name: Andr2210
- Contact:
-
- Veeam Software
- Posts: 2015
- Liked: 671 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Which virtual machines are located on which virtualization node?
Hi,
Not directly from task session object, so you'd have to query infrastructure to see where a vm resides. Example for VMware:
Best regards,
Oleg
Not directly from task session object, so you'd have to query infrastructure to see where a vm resides. Example for VMware:
Code: Select all
$sessions = Get-VBRBackupSession
$vms = Find-VBRViEntity -VMsAndTemplates
foreach ($session in $sessions) {
if ($session.Platform.ToString() -eq "EVMware") {
$taskSessions = Get-VBRTaskSession -Session $session
foreach ($taskSession in $taskSessions) {
$vm = $vms | where {$_.Name -eq "$($taskSession.Name)"}
$vm | select Name, VMHostName
}
}
}
Oleg
-
- Novice
- Posts: 5
- Liked: never
- Joined: Nov 28, 2023 11:19 am
- Full Name: Andr2210
- Contact:
Re: Which virtual machines are located on which virtualization node?
Hi! Привет!
Get-VBRBackupSession Returns tasks performed during job sessions.
but at the time of launching the script, it may not be executed. I have your script hanging on the first line in a long wait. maybe the first line should have Get-VBRTaskSession ?
Во время запуска скрипта он не выполняется. У меня скрипт висит на первой строке в долгом ожидании. Возможно, в первой строке должно быть Get-VBRTaskSession ?
Get-VBRBackupSession Returns tasks performed during job sessions.
but at the time of launching the script, it may not be executed. I have your script hanging on the first line in a long wait. maybe the first line should have Get-VBRTaskSession ?
Во время запуска скрипта он не выполняется. У меня скрипт висит на первой строке в долгом ожидании. Возможно, в первой строке должно быть Get-VBRTaskSession ?
-
- Veeam Software
- Posts: 2346
- Liked: 555 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Which virtual machines are located on which virtualization node?
Hi @@Andr2210,
Get-VBRBackupSession will retrieve all sessions, so that's likely why it's taking awhile.
Does this data need to come from the task sessions? COib objects returned by Get-VBRRestorePoint have this data also and it should be a faster call:
$job = Get-VBRJob -name 'name of job'
$backups = Get-VBRBackup -name $job.name
$RPs = Get-VBRRestorePoint -Backup $backups
PS C:\Users\Administrator> $RPs | Select VMName, @{n="ESXi Host";e={$_.Auxdata.esxname}}
VmName ESXi Host
------ ---------
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
Will it work for you to pull this information from the COib objects or it must be from Session data?
Get-VBRBackupSession will retrieve all sessions, so that's likely why it's taking awhile.
Does this data need to come from the task sessions? COib objects returned by Get-VBRRestorePoint have this data also and it should be a faster call:
$job = Get-VBRJob -name 'name of job'
$backups = Get-VBRBackup -name $job.name
$RPs = Get-VBRRestorePoint -Backup $backups
PS C:\Users\Administrator> $RPs | Select VMName, @{n="ESXi Host";e={$_.Auxdata.esxname}}
VmName ESXi Host
------ ---------
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
ddom-tinyvm someesxihost.local
Will it work for you to pull this information from the COib objects or it must be from Session data?
David Domask | Product Management: Principal Analyst
Who is online
Users browsing this forum: No registered users and 9 guests