Get All Vm's, and Get All Current Backup Ussage Question

RESTful knowledge exchange

Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Wed Jun 18, 2014 3:17 pm

I'm trying to access two values from the REST API and I can't seem to find out how to access them.

So my question is:

What is the best way to access a list of VM's that are utilizing the backup server.

Then how do you pull a specific VM's current total consumed backup usage from rest. I can't find this anywhere inside the api documentation.


I appreciate the help.
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby v.Eremin » Wed Jun 18, 2014 3:51 pm

What is the best way to access a list of VM's that are utilizing the backup server.

You mean VMs that are chosen as a source for existing backup jobs?

Then how do you pull a specific VM's current total consumed backup usage from rest. I can't find this anywhere inside the api documentation.

How much space is occupied by given restore point,right?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Wed Jun 18, 2014 4:42 pm

Well,

Let me explain a little further.

I need the total back up size for each job. for instance.

I have a customer called John Doe, John Doe has 12 VMs. I have a report that takes all of the jobs from the month and list their Back Up Size (GB) We are using this information for billing. Thus if Customer John Doe's 12 VMS are consuming 33.11 gb I need to be able to pull John Doe and 33.11 gb from the Veeam server but for every customer which technically on our report is a JOB.
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Wed Jun 18, 2014 6:20 pm

So for sakes we will say this is a returned value from /api/jobs:
Code: Select all
  <Ref Href="http://127.0.0.1:9399/api/jobs/c40199fa-d660-42ab-b508-f603a1c53a15" Type="JobReference" UID="urn:veeam:Job:c40199fa-d660-42ab-b508-f603a1c53a15" Name="ENKI_Metering">
    <Links>
      <Link Href="http://127.0.0.1:9399/api/backupServers/ea8cc42e-a660-4fab-bd4a-a3061fb3d980" Name="127.0.0.1" Type="BackupServerReference" Rel="Up"/>
      <Link Href="http://127.0.0.1:9399/api/jobs/c40199fa-d660-42ab-b508-f603a1c53a15?format=Entity" Name="ENKI_Metering" Type="Job" Rel="Alternate"/>
      <Link Href="http://127.0.0.1:9399/api/jobs/c40199fa-d660-42ab-b508-f603a1c53a15/backupSessions" Type="BackupJobSessionReferenceList" Rel="Down"/>
    </Links>
  </Ref>
</EntityReferences>


Then I filter out a string using string formatting:

However the string i get from the returned jobs query http://127.0.0.1:9399/api/backupServers ... 061fb3d980 doesn't pull up any data and i get a 200 response like below.
However i'm pulling it directly from the jobs query which i don't understand why its not working ive tried all three urls it returns.

<Response [200]>
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Wed Jun 18, 2014 6:25 pm

NVM the last post I forgot to return the .content
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Wed Jun 18, 2014 6:55 pm

NVM the last post I forgot to return the .content

However I still can't find out where the total backup storage space used is per job
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

What Units is <toalsize> in under /api/backupTaskSessions/

Veeam Logoby PyDev » Wed Jun 18, 2014 11:57 pm

Hello,

This is kind in lines with my other question but different. So I think I figured out how to get the total size of each back up for each vm, but I have no idea what units it is in, and the documentation doesn't say. When I convert it from bits to GB or bytes to GB it still doesn't match what the Backup Billing report is giving me for total consumed space of the VMS. I have included some XML as well as my Programs output. However my question is:


one why are they different numbers when I sum all of the VM's up from /backupTaskSession compared to the veeam generated backup billing report total size

two what units is the <totalsize> in because it could be just a conversion issue.

Code: Select all

<BackupTaskSession Type="BackupTaskSession" Href="http://masked:9399/api/backupTaskSessions/927e3a22-35d0-4ded-803a-24c99df518be?format=Entity" Name="ENKI-Holon-Repo@2014-06-13 00:01:25" UID="urn:veeam:BackupTaskSession:927e3a22-35d0-4ded-803a-24c99df518be" VmDisplayName="ENKI-Holon-Repo">
<Links>
<Link Href="http://masked:9399/api/backupServers/ea8cc42e-a660-4fab-bd4a-a3061fb3d980" Name="127.0.0.1" Type="BackupServerReference" Rel="Up"/>
<Link Href="http://masked:9399/api/backupSessions/eb3eb41b-f5bc-4c0e-85be-01c76744cff9" Name="ENKI_Metering, Jun 13 2014 12:00AM" Type="BackupJobSessionReference" Rel="Up"/>
<Link Href="http://masked:9399/api/backupTaskSessions/927e3a22-35d0-4ded-803a-24c99df518be" Name="ENKI-Holon-Repo@2014-06-13 00:01:25" Type="BackupTaskSessionReference" Rel="Alternate"/>
</Links>
<CreationTimeUTC>2014-06-13T00:01:25Z</CreationTimeUTC>
<EndTimeUTC>2014-06-13T00:02:55Z</EndTimeUTC>
<State>Completed</State>
<Result>Success</Result><Reason/>
<TotalSize>107374182400</TotalSize>
</BackupTaskSession>
[img][/img]

<BackupTaskSession Type="BackupTaskSession" Href="http://masked:9399/api/backupTaskSessions/9abfc68e-8b4c-4661-adb4-7fe970e029ae?format=Entity" Name="ENKI-Metering@2014-06-13 00:01:23" UID="urn:veeam:BackupTaskSession:9abfc68e-8b4c-4661-adb4-7fe970e029ae" VmDisplayName="ENKI-Metering">
<Links>
<Link Href="http://masked:9399/api/backupServers/ea8cc42e-a660-4fab-bd4a-a3061fb3d980" Name="127.0.0.1" Type="BackupServerReference" Rel="Up"/>
<Link Href="http://masked:9399/api/backupSessions/eb3eb41b-f5bc-4c0e-85be-01c76744cff9" Name="ENKI_Metering, Jun 13 2014 12:00AM" Type="BackupJobSessionReference" Rel="Up"/>
<Link Href="http://masked:9399/api/backupTaskSessions/9abfc68e-8b4c-4661-adb4-7fe970e029ae" Name="ENKI-Metering@2014-06-13 00:01:23" Type="BackupTaskSessionReference" Rel="Alternate"/>
</Links>
<CreationTimeUTC>2014-06-13T00:01:23Z</CreationTimeUTC>
<EndTimeUTC>2014-06-13T00:02:55Z</EndTimeUTC>
<State>Completed</State>
<Result>Success</Result><Reason/>
<TotalSize>161061273600</TotalSize>
</BackupTaskSession>



This is my program output that sums the data each time it loops through a VM
END OF LINE0
http://127.0.0.1:9399/api/backupSession ... skSessions

ENKI-Holon-Repo@2014-06-13 00:01:25 Storage: 107374182400 running total
ENKI-Metering@2014-06-13 00:01:23 Storage: 268435456000 running total

so you can see the running total is what equals the sum of the two outputs

but it does not match whats on the veeam billing back up report.

The veeam backup report for ENKI_Metering which is what these two are under
list the latest one 6/11/2014 at 163.29gb

my program calles the latest one as well so it is calling the 6/11/2014

so what are the numbers different and what is totalsize in the xml if not the total backupspace consumed like in the report. the total size of the backup job should infact give me the total used for each customer should it not when I sum all of the values.
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby v.Eremin » Thu Jun 19, 2014 1:22 pm

Even though, it's said that total size is the size of restore point produced by backup job (the number is given in bytes), I believe it's nothing but a size of processed VM. Can you check this value and the size of processed VM (you can get this information in the job session statistics, look for VM size metric), do they match each other? Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Thu Jun 19, 2014 3:14 pm

It is the total size of the vm as listed in enterprise manager i guess my confusion is enterprise manager list it as 250 gb total which is what my program is returning for customer enki-metering
howeer the veeam backup billing report list it as 163gb why is the total size of the vm through the api and enterprise manager larger than what the veeam one report I believe is giving me, I don't use these systems its not enterprise manager were getting the report from I believe its veeam one its where you print out back up billing reports. Anyways why does the size differ between the two
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby v.Eremin » Thu Jun 19, 2014 3:25 pm

Backup billing report provides information about actual backup size, meanwhile, "totalsize" - about VM size. Those are two different values, hence, the discrepancy. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Thu Jun 19, 2014 3:34 pm

so where is the actual backup size located and how do I get to that, I nee to access that with rest
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby v.Eremin » Fri Jun 20, 2014 10:34 am

Currently, it's not possible to get restore point size via RestAPI. At least, I'm not aware of a way to do to so. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby PyDev » Fri Jun 20, 2014 3:49 pm

Then how does the report get it if it doesn't use rest api?
PyDev
Novice
 
Posts: 9
Liked: never
Joined: Wed Jun 18, 2014 3:14 pm
Full Name: Grant A. Zukel

Re: Get All Vm's, and Get All Current Backup Ussage Question

Veeam Logoby v.Eremin » Fri Jun 20, 2014 4:05 pm

RestAPIs are built around Enterprise Manager functionality. In the meantime, Veeam ONE gets this information from VB&R. Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 3 guests