PowerShell script exchange
Post Reply
Jack1874
Enthusiast
Posts: 95
Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:

Export List of Hard Disk Read Times

Post by Jack1874 » 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:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

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 ...

Image
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Export List of Hard Disk Read Times

Post by PTide »

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:
Image
Jack1874
Enthusiast
Posts: 95
Liked: 5 times
Joined: Oct 17, 2015 3:32 pm
Full Name: Stuart Little
Location: Canada
Contact:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

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:

Re: Export List of Hard Disk Read Times

Post by PTide »

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:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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

Image
-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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

That is perfect ....

I get this message when I run it ...

Image
jbennett
Enthusiast
Posts: 33
Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:

Re: Export List of Hard Disk Read Times

Post by jbennett »

Jack1874 wrote:That is perfect ....

I get this message when I run it ...

Image
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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

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:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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.

Image

Image
-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:

Re: Export List of Hard Disk Read Times

Post by veremin » 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:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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

Image

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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

Pretty much perfection ...

Is it possible to list out the the Disk Details Hard Disk 1 , 2 , 3 .. etc

Image
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Export List of Hard Disk Read Times

Post by veremin »

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:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

Think I found something useful here ...

http://forums.veeam.com/powershell-f26/ ... 27946.html
jbennett
Enthusiast
Posts: 33
Liked: 12 times
Joined: Jun 23, 2015 3:47 pm
Full Name: Justin Bennett
Location: Los Angeles, CA
Contact:

Re: Export List of Hard Disk Read Times

Post by jbennett »

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 } )
Image

Image

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:

Re: Export List of Hard Disk Read Times

Post by Jack1874 »

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:

[MERGED] Queued Time

Post by massimoberloffa »

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:

Re: Export List of Hard Disk Read Times

Post by PTide »

How can I extract the time "queued" a vm?
Please check this this post

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests