PowerShell script exchange
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Oct 23, 2015 2:20 pm
1 person likes this post
Guys, is there a way to export out the statistics of a job that shows the Hard disk read time ?
I seen this code for extracting the Removing Snapshop Statistic.. and wondered if the hard Disk read time can be substituted ..
Code: Select all
$Jobs = Get-VBRJob -Name "Job*"
foreach ($Job in $Jobs) {
$LastSession = $Job.FindLastSession()
$TaskSessions = $LastSession | Get-VBRTaskSession
foreach ($vm in $TaskSessions) {
$asd = $vm.Logger.GetLog().UpdatedRecords | where-object {$_.title -eq "Removing VM snapshot"} | Select-Object title, starttime,
updatetime
$diff = $asd.updatetime - $asd.starttime
Write-Host $vm.Name `t $diff.TotalMinutes
}
}
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Oct 28, 2015 2:11 am
this post
What specific statistics are you looking for? MB/s, Latency, etc?
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Oct 29, 2015 2:19 pm
this post
Hi Justin, I'm looking for the MB/s read for each vmdk within a job.
If I could also export the time it took to run the vmdk copy that would be great too ...
PTide
Product Manager
Posts: 6408 Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » Oct 29, 2015 2:35 pm
this post
Hi,
Hi Justin, I'm looking for the MB/s read for each vm within a job
If I could also export the time it took to run the job that would be great too ...
Have you considered using Veeam ONE report for that? I think it is able to do exactly what you are after:
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Oct 29, 2015 5:04 pm
this post
Yes.. I did consider that.. but I wanted them in a spreadsheet where I can make comparisons
PTide
Product Manager
Posts: 6408 Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » Oct 29, 2015 6:16 pm
this post
In this case I suggest you to utilize Veeam ONE "Scheduling". Please try the following:
1. Go to "Workspace" in Veeam ONE reporter
2. In "My Reports" create another subfolder, say, "My Jobs Info"
3. Go to Veeam Backup & Replication folder and pick "Backup Job Historical Information". Adjust it as needed and save into your "My Jobs Info" folder you've just created.
4. Go to "My Jobs Info" folder, click "Schedule Folder" button on the toolbar, click "Add" and add your "My Jobs Info" folder. Next specify MS Excel fromat, schedule, recipients.
Your reports excel files will appear in the specified place in accordance with schedule.
I hope this helps.
Thank you.
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 02, 2015 10:38 pm
this post
Jack1874 wrote: Yes.. I did consider that.. but I wanted them in a spreadsheet where I can make comparisons
Is this what you were thinking?
https://github.com/cajeeper/Veeam/blob/ ... MStats.ps1
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 03, 2015 11:18 pm
this post
That is perfect ....
I get this message when I run it ...
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 04, 2015 1:07 am
this post
Jack1874 wrote: That is perfect ....
I get this message when I run it ...
I thought I published the update - try the latest version. It has to do with putting a dash in the variable name.
https://github.com/cajeeper/Veeam/blob/ ... MStats.ps1
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 04, 2015 2:50 pm
this post
That works great...
Do you know if its possible to list the actual MB/s read from each individual VMDK (within in guest)?
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 09, 2015 5:11 pm
this post
I'm not seeing a way to pull that level of detail from PowerShell.
When I'm digging around the Job's TaskSession information and I'm not finding VMDK or VHD specific details. Only the overall progress information.
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
veremin
Product Manager
Posts: 20270 Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Nov 09, 2015 8:03 pm
1 person likes this post
Since this information is present inside the task session reflected in GUI, it should be possible to get it from log. Something like:
Code: Select all
$TaskSession.logger.getlog().updatedrecords
Thanks.
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 09, 2015 9:08 pm
this post
I've added the hard disk details (thanks to v.Eremin) as a string output of all disks from the log. I could break it out in an array if needed - it just becomes complicated with only having the formatted output and prerounded data elements (B / KB / MB / GB / TB / ETC). Would need the bytes to accurately output.
https://github.com/cajeeper/Veeam/blob/ ... MStats.ps1
Thank you!
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 10, 2015 7:51 pm
this post
Pretty much perfection ...
Is it possible to list out the the Disk Details Hard Disk 1 , 2 , 3 .. etc
veremin
Product Manager
Posts: 20270 Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Nov 10, 2015 8:44 pm
this post
Not sure whether I get your question. So, I'm still wondering how the "disk details" parameter should re-formatted. Can you probably show a string or something? Thanks.
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 10, 2015 9:21 pm
this post
Jack, could you give an example of how you think it should look. Like v.Eremin, I'm not sure what you're looking for.
Jack1874 wrote: Pretty much perfection ...
Is it possible to list out the the Disk Details Hard Disk 1 , 2 , 3 .. etc
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 10, 2015 10:15 pm
this post
Was thinking something along the lines of ...
Job Name VM Name Hard Disk 1 Hard Disk 2 Hard Disk 3
Job 1 VM_1 24 MB/s 28 MB/s 41 MB/s
Job 2 VM_2 21 MB/s 24 MB/s 39 MB/s
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 10, 2015 10:31 pm
this post
jbennett
Enthusiast
Posts: 33 Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:
Post
by jbennett » Nov 10, 2015 10:34 pm
this post
Jack1874 wrote: Was thinking something along the lines of ...
Job Name VM Name Hard Disk 1 Hard Disk 2 Hard Disk 3
Job 1 VM_1 24 MB/s 28 MB/s 41 MB/s
Job 2 VM_2 21 MB/s 24 MB/s 39 MB/s
You can add Hard Disk 1, Hard Disk 2 columns to the end of the result block like the following:
Code: Select all
"Hard Disk 1" = (($_.Logger.getlog()).updatedrecords | ? {$_.Title -like "Hard Disk 1*"} | % { ($_.description -split " ")[4]+" "+($_.description -split " ")[5] | out-string } )
"Hard Disk 2" = (($_.Logger.getlog()).updatedrecords | ? {$_.Title -like "Hard Disk 2*"} | % { ($_.description -split " ")[4]+" "+($_.description -split " ")[5] | out-string } )
Only thing is, like I mentioned prior, you're going to get ever changing size per second. Some will read MB/s, some will read KB/s, it'll be all over.
-Justin
[@cajeeper]|[http://www.allthingstechie.net]
Jack1874
Enthusiast
Posts: 95 Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:
Post
by Jack1874 » Nov 10, 2015 11:11 pm
this post
Thanks Justin... I'll check out your suggestion and report back.
massimoberloffa
Lurker
Posts: 1 Liked: never
Joined: Feb 19, 2016 9:56 am
Contact:
Post
by massimoberloffa » May 27, 2016 6:19 am
this post
How can I extract the time "queued" a vm?
VMNane JobName Duration QueuedTime
--------- ----------- ---------- --------------
vm1 job1 00:15:11 00:05:11
vm2 job1 00:55:11 00:15:11
vm3 job2 00:22:11 00:01:11
vm4 job2 00:11:11 00:00:11
thank you
PTide
Product Manager
Posts: 6408 Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:
Post
by PTide » May 30, 2016 5:06 pm
this post
How can I extract the time "queued" a vm?
Please check this
this post
Thanks
Users browsing this forum: No registered users and 25 guests