Creating a vRanger report from SQL

As a vRanger user, version 4 brought lots of welcome improvements. Apart from the overall performance achieved by no longer requiring the vRanger server to proxy the backups, the main improvement for me was the database moving to SQL.

As a result of this change, gaining access to and manipulating the backup data is now really easy. The company I work for, like many others have various checks that run each morning – the next logical step was to include an automated vRanger report. Now while vRanger does have a report system built in, it didn’t do quite what I needed and cannot email, so I wanted to be able to reproduce the report in a way I could stick into email, webpages etc.

To work out how to form the query, I began a trace on the vRangerPro database in SQL Profiler – once I had run the report in the vRanger GUI, I could work out which query was being executed, load it back into SQL Query Analyser and start tinkering. Now all of my VM backups run overnight so I wanted to be able to run the query to only look at jobs starting within the last  24 hours so when executed in the morning checks it would cover the previous nights run.

The eventual output was as follows:

SELECT DISTINCT t.VmName AS [VM Name], dbo.TaskStatus.Name AS Status, dbo.TaskState.Name AS [Task Status], dbo.SpaceSavingType.Name AS [Space Saving], isc.Address AS ESX, r.DisplayName AS Repository, dbo.RepositoryCIFS.ShareName AS [Share Name], t.StartTime, t.EndTime, DATEDIFF(minute, t.StartTime, t.EndTime) AS [Duration in Minutes], sp.SizeInMbOriginal AS [VM Size], sp.SizeInMbStored AS [Backup Size], t.Error FROM dbo.SpaceSavingType INNER JOIN dbo.SavePoint AS sp ON dbo.SpaceSavingType.SpaceSavingTypeId = sp.SpaceSavingTypeId RIGHT OUTER JOIN dbo.Task AS t INNER JOIN dbo.Job AS j ON t.JobId = j.JobId INNER JOIN dbo.BackupTask AS bt ON bt.TaskId = t.TaskId INNER JOIN dbo.Repository AS r ON bt.RepositoryId = r.RepositoryId INNER JOIN dbo.RepositoryCIFS ON r.RepositoryId = dbo.RepositoryCIFS.RepositoryId INNER JOIN dbo.TaskState ON t.TaskStateId = dbo.TaskState.TaskStateId INNER JOIN dbo.TaskStatus ON t.TaskStatusId = dbo.TaskStatus.TaskStatusId LEFT OUTER JOIN dbo.InventorySourceConnection AS isc ON bt.InventorySourceConnectionId = isc.InventorySourceConnectionId ON sp.SavePointId = bt.SavePointId WHERE     (j.JobTypeId = 0) AND (t.StartTime >= DATEADD(day, – 1, GETDATE())) AND (DATEDIFF(minute, t.StartTime, t.EndTime) >= 0) AND (j.JobStatusId IN (0, 1, 3, 2)) AND (t.TaskStatusId IN (0, 1, 3, 2))


The query links various tables in order to produce a meaningful output that can be used easily in reports and web pages – the important factor is what time period you want to report against. In this case, the filter is the last day based on the Start Time of each job.

The query should produce the following type of result:

Example output of the SQL query in Excel 2007

Example output of the SQL query in Excel 2007

  • VM Name – unsurprisingly is the name of the VM being backed up
  • Status – displays either Success or Failed
  • Task Status – again self evident!
  • Space Saving – None (Full Backup), Incremental or Differential
  • ESX – reports which ESX Host the VM was on at the time of the backup
  • Repository –  shows the name under which the CIFS repository is labelled in vRanger
  • Share Name – the specific CIFS share
  • Start Time and End Time are obvious but useful to record for tracking backup performance
  • Duration in Minutes – created by SQL using a DATEDIFF method
  • VM Size – the recorded size of the actually VM size i.e. VMDKs
  • Backup Size – the actual end result of the backup – again useful for seeing how much space is saved due to compression
  • Error – If the job failed, the field will display the information relating to the failure (Disk Space, Permissions etc)

I used this SQL method because I am more familiar with it and how to get it into other formats for distribution – there are Powershell cmdlets for vRanger which may well produce similar results but for now this works well and is easy to tweak. Once the Powerpack for PowerGUI / VESI is released for vRanger I am sure this will be the preferred way of interrogating and controlling the vRanger application.

Hope this is proves useful for fellow vRanger users …

vRanger 4.1 GA release ..

Vizioncore have finally released 4.1 of vRanger DPP – it has a plethora of fixes for various issues that have been raised since 4 was released in July.

A list of the fixes are detailed here

A few people on their support forums suggest they were a bit premature in releasing 4 – I was surprised that it was released so quickly after the beta 3 – so perhaps they were right. I am still waiting for them to fix an outstanding bug about restoring to hosts that reside in folders within Virtual Centre.

Veeam 3 Backup Faster, vRanger 4 Smaller ?

I have begun playing with the new vRanger 4 DPP Beta 2 to see how it compares with the current version and more importantly with the current rival Veeam 3.0.1.

Firstly it is important to note vRanger 4 is beta – there are bugs but the basics seem to work. I am not going to go into the differences between its predecessor – there are numerous major changes which you can check out at Vizioncore’s website.

However I thought I would just try a little test to see how vRanger and Veeam compare in a simple head to head backup.

I was using an HP Minitower with SATA drives as the backup server running both products – connecting to the same VMWare ESX 3.5 host (an HP DL380 G5 with local SAS disk). All were running 1Gb NICs.

The VM Guest being backed up was a 20GB Windows 2003 image – the results were as follows:

Vizioncore vRanger 4 DPP Beta 2

Time Taken : 17m2s
Backup Size : 4.9GB
Reported Throughput : 22MB/s

Veeam 3.0.1 (Set to Optimal compression)

Time Taken : 15m17s
Backup Size : 8.9GB
Reported Throughput : 22MB/s

Veeam 3.0.1 (Set to Best compression)

Time Taken : 14m6s
Backup Size : 8.9GB
Reported Throughput : 24MB/s

EDIT: After advice from Anton (see below reply) I recreated the job for the Best setting – the results were as below so Veeam still wins the race on speed / compression

Time Taken : 15m23s
Backup Size : 4.5GB
Reported Throughput : 22MB/s

I ran multiple tests for vRanger to ensure the same result and two different tests as noted above for Veeam as it had the option for altering the compression settings – ironically while this ‘Best’ function improved the speed of the backup the resulting file was the same size. Overall vRanger was acheiving compression of 75% versus Veeam’s 55% – it will be up to the individual to whether speed or size is most important.

So things are looking hopeful for vRanger at this stage although until a finished product is released there is no certainty what the final build will achieve. There are still quite a few glitches in the beta gui that need attention before it will be as clean as Veeam in terms of speed and usability.

Hyper-V and HP NIC Teaming – time to revisit …

The company I work for is heavily HP based in the datacentre – so I was quite disappointed to find that my first foray into Hyper-V was somewhat scuppered by the lack of compatibility between HP Network Teaming and Hyper-V. As ESX 3.5 could handle teaming itself it remained the natural choice for our virtualisation elements.

However having seen Windows 2008 R2 RC was on route, I wondered if the new version would allow for greater compatibility – to my surprise my first google search found this white paper explaining how to install this successfully with the current incarnation of Hyper-V.

While I love VMWare, I am always reminded by my manager that our worldwide MS licencing gives us a very competitive cost model for Hyper-V – the ability to run a host with sufficient NIC resilience may mean a dual platform will be on the cards …

I will most likely download the R2 version and test this … Will post my findings.

Control VMWare from your mobile …

I found this at the weekend – http://communities.vmware.com/community/beta/vcmobileaccess

A mobile appliance that you can use to proxy access from your mobile device to your virtual centre server. Really cool and because it is aimed at mobile devices nice and quick even on GPRS.

Very useful for those of you on call 🙂

Stephen Fry’s Techie Review …

If you ever thought you had too much gadgetry, then Mr Fry’s collection may offer you some solace – http://www.stephenfry.com/blog/2008/12/11/gee-one-bold-storm-coming-up…/

If only all tech reviews were so eloquent.

powershell healthcheck for vmware …

This week saw a dev environment brought to its knees by vm snapshotting – the environment had been snapped the week before prior to a release but had then been left to its own devices. Ordinarily the machines this covers would not have suffered to badly as they are not data servers – however in this scripted run (another powershell script) it had snapped the whole environment including 5 SQL servers.

Nevertheless by the time I got to this environment the SQL servers had delta files totalling several 100GB a piece … I managed to pull four of them back from the brink – the fifth sadly didn’t make it.

That night I pondered how I could keep an eye on snapshots so they don’t bite me again – and a few searches led me to this very handy script – http://www.ivobeerens.nl/?p=106

I won’t go into detail here, as the writers site is an evidently better place to understand all the things it does – but it can tell you a huge amount about your ESX environment and plonk it into a rather useful html page.

In the end I plucked out the elements relating to snapshots to fashion a smaller leaner script for my purpose but if you haven’t got round to trying the Powershell Toolkit from VMWare you should … 

The useful links are …

http://blogs.vmware.com/vipowershell

http://www.powergui.org

openfiler

During a recent course I went on, I was learning more about iSCSI which I had no previous experience with for VMWare. On my search I found numerous vendors, but an open source one called openfiler caught my eye.

For the non-Linux amongst you (including myself) a pre packaged appliance is available as a  VMWare appliance – although I installed it from the ISO download so it is not tricky to do.

It is really good for trying out different storage types with VMWare especially if you want a good way of testing things like VMotion.

Create your own website, free on WordPress.com.Create your own website.
Start free