-
- Veteran
- Posts: 459
- Liked: 5 times
- Joined: Feb 01, 2012 12:04 pm
- Full Name: Mario
- Contact:
Listing all the times all VMs were replicated
In order to perform statistic analysis I need to create a job to list all the times all VMs were replicated or at least the last 50 time each VM was replicated, regardless of the job.
For each time a given VM was replicated I need to record the start and end time and the rersult (Success, warning, failed...).
The task could be described as something like "For each VM in each job list all the times the VM was replicated".
I made some tests but the results I get are not complete, so I presume I am getting the wrong data.
Is there any sample script I can start from?
Regards
marius
For each time a given VM was replicated I need to record the start and end time and the rersult (Success, warning, failed...).
The task could be described as something like "For each VM in each job list all the times the VM was replicated".
I made some tests but the results I get are not complete, so I presume I am getting the wrong data.
Is there any sample script I can start from?
Regards
marius
-
- Product Manager
- Posts: 20533
- Liked: 2345 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Listing all the times all VMs were replicated
Should it be a list of replicated VMs that still have restore points or more like historical report that will provide information regarding even those VMs that already have no replication restore points?
-
- Veteran
- Posts: 459
- Liked: 5 times
- Joined: Feb 01, 2012 12:04 pm
- Full Name: Mario
- Contact:
Re: Listing all the times all VMs were replicated
The second Solution would be far better...
Regards
marius
Regards
marius
-
- Product Manager
- Posts: 20533
- Liked: 2345 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Listing all the times all VMs were replicated
Unfortunately, I'm out of the office at the moment (on a sick leave, actually), so, I can only propose the algorithm that I'd implement.
Firstly, I'd get the list of all sessions, using Get-VBRBackupSession commandlet.
Secondly, I'd filter out those that are not replication ones (type is not equal to replica) via where-object commandlet.
Thirdly, I'd leverage Get-VBRTaskSession commandlet to get all VMs specific sessions within replication job sessions.
Fourthly, I'd select specific properties out of the list of existing task session, like VM name, result, start and end time.
Fifthly, I'd format the output a bit, so that, information is shown in required order (all sessions specific to first VM, then, to second, etc.)
Thanks.
Firstly, I'd get the list of all sessions, using Get-VBRBackupSession commandlet.
Secondly, I'd filter out those that are not replication ones (type is not equal to replica) via where-object commandlet.
Thirdly, I'd leverage Get-VBRTaskSession commandlet to get all VMs specific sessions within replication job sessions.
Fourthly, I'd select specific properties out of the list of existing task session, like VM name, result, start and end time.
Fifthly, I'd format the output a bit, so that, information is shown in required order (all sessions specific to first VM, then, to second, etc.)
Thanks.
-
- Veteran
- Posts: 459
- Liked: 5 times
- Joined: Feb 01, 2012 12:04 pm
- Full Name: Mario
- Contact:
[MERGED] Listing session start and end time
I need to get a list of the last 10 backup sessions for each job with start time, end time and result.
I need to detect as well if health check was performed for the given session.
My code looks like:
Which properties should I use to get the values I need?
Regards
Marius
I need to detect as well if health check was performed for the given session.
My code looks like:
Code: Select all
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
{
foreach ($Session in (Get-VBRBackupSession | Where {$_.Jobname -eq $Job.name}) | Sort creationtime -Descending | select -First 10)
{
...
$session_start =
$session_end =
$session_result =
$session_Health_Check =
...
}
}
Regards
Marius
-
- Veteran
- Posts: 459
- Liked: 5 times
- Joined: Feb 01, 2012 12:04 pm
- Full Name: Mario
- Contact:
Re: Listing all the times all VMs were replicated
Any update?
Regards
marius
Regards
marius
-
- Product Manager
- Posts: 20533
- Liked: 2345 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Listing all the times all VMs were replicated
The general approach is described above, and multiple examples of how the requested information can be received are available on our forums. Thanks.
-
- Veteran
- Posts: 459
- Liked: 5 times
- Joined: Feb 01, 2012 12:04 pm
- Full Name: Mario
- Contact:
Re: Listing all the times all VMs were replicated
I am working with a script based on the following loops:
It works, but it looks extremely slooooow.
Can anybody please suggest a smarter aproach?
Regards
Marius
Code: Select all
foreach ($Job in (Get-VBRJob | where {$_.JobType -eq "Backup"}))
{
foreach ($Session in (Get-VBRBackupSession | Where {$_.Jobname -eq $Job.name}) | Sort creationtime -Descending | select -First 3)
{
...
...
}
}
Can anybody please suggest a smarter aproach?
Regards
Marius
-
- Product Manager
- Posts: 20533
- Liked: 2345 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Listing all the times all VMs were replicated
You might try to run backup session only once, save the results into hash table and operate with the hash table afterwards; should save you the time, since the Get-VBRBackupSession cmdlet will be executed only once. Thanks.
Who is online
Users browsing this forum: No registered users and 5 guests