This project is read-only.

2012 R2 - class issue

Oct 25, 2013 at 11:17 AM
Has anyone been able to fix the class issue when using Windows 2012 R2?

Backing up all VMs on this server
Error: Invalid class
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStat
us errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.Mo
at Cloudbase.Titan.HyperV.Backup.BackupManager.GetVMNames(IEnumerable1 vmNam
es, VMNameType nameType) in c:\Soft\Scripts\Backup\Hyper-V\HVBackup_Source\Hyper
VBackup\HyperVBackup\BackupManager.cs:line 323
at Cloudbase.Titan.HyperV.Backup.BackupManager.VSSBackup(IEnumerable
1 vmName
s, VMNameType nameType, String backupOutputPath, String backupOutputFormat, Bool
ean singleSnapshot, Int32 compressionLevel) in c:\Soft\Scripts\Backup\Hyper-V\HV
Backup_Source\HyperVBackup\HyperVBackup\BackupManager.cs:line 77
at Cloudbase.Titan.HyperV.Backup.CLI.Program.Main(String[] arg
Nov 3, 2013 at 11:55 PM
We're having the exact same problem. :-( No news yet...
Nov 4, 2013 at 2:50 PM
Change "root\virtualization" to "root\virtualzation\v2".
good luck
Nov 4, 2013 at 2:52 PM
Excuse me,change "root\virtualization" to "root\virtualization\v2".
Nov 4, 2013 at 4:34 PM
I'm running into this issue also.

Any way that someone can compile a version compatible with R2 and post?
Nov 4, 2013 at 5:34 PM
Hi guys, going to compile a 2012 R2 compatible version ASAP
Nov 4, 2013 at 6:16 PM
Here's a compiled version including the fix, can you please test it before I update the public download?


Nov 4, 2013 at 8:35 PM
Awesome! Thanks for the quick response!

I tried it out on an 8GB VM and it took a snapshot and sent it over the network to a removable drive without any issues!

I'm sure others will be able to use this also... Thanks again!
Nov 5, 2013 at 10:55 PM
Edited Nov 5, 2013 at 10:57 PM
Whoah - blowing up here, right?

First and foremost: a HUGE thanks to Alessandro (and also to Mast2013) - very much appreciated! This is yet another reason I love open source. :-)

Secondly: we're testing this today and will let you know if we run into any issues whatsoever.
Nov 8, 2013 at 8:12 AM
If I run

HVBackup -a -o c:\xxxxx

The script just ends. If I specify a vm, it says no machine found.

Any ideas?
Nov 8, 2013 at 1:14 PM
VM must be online
Nov 8, 2013 at 1:16 PM
I even tried to backup all vm's, some are running and same error.

Also, there was a patched version that fixed the issue around the vm's having to be online. Can that not be incorporated, or modifed to work with R2?
Nov 8, 2013 at 2:54 PM
Offline build is here:

Be good to get that working.
Nov 9, 2013 at 9:41 AM

Has anyone tested the software under Windows 2012 R2 in German?
I don´t get an error but the software does not work.
I checked and

Thanks for feedback
Gerhard (Austria)
Nov 10, 2013 at 3:02 PM

I have same problem as GMLLERQ... on Windows 2012 R2...
i don´t get an error, everything seem to be OK, but elapsed time is too small (in miliseconds) and nothing was backed up...

any ideas?

Thanks ...
Nov 11, 2013 at 12:57 PM
You must combine Workitem 8837 and "root\virtualization\v2".

Good luck
Nov 12, 2013 at 1:25 PM

I am sorry - I cannot find Information about the following step.
How can I change the "root\virtualization" to "root\virtualization\v2" on Windows 2012
Have anyone an idea?

Nov 13, 2013 at 7:24 AM

You can change it in "BackupManager.cs" in the procedure " IDictionary<string, string> GetVMNames(IEnumerable<string> vmNames, VMNameType nameType)".
The value of "scopeFormatStr" should be ""\\{0}\root\virtualization\v2".
Maybe, Moderator alexp can provide a compiled Version for testing.

Nov 14, 2013 at 8:12 PM
Hi Mast2013

Thank you for the answer.
I hope alexp read this and creates me a compiled Version, please.

I am sorry, I am not a programer.

Jan 22, 2014 at 10:22 AM
don't know if it helps but i had the same Problem as GMLLERQ and couda(German 2012 R2)

I followed Mast2013's advice: (thank you)

"You must combine Workitem 8837 and "root\virtualization\v2". "

and it is working now!

the "root\virtualization\v2" issue seems to be fixed already in the (at this point) downloadable source but the Workitem 8837 (the one in the comments by beatcracker wrote Sep 26, 2013 at 3:41 PM - thank you too) need to be inserted/replaced

only one Thing seems to be not right, in the log running Vm's are recognised as "offline".
Nevertheless it seems to work so i ignore it for now.
Feb 2, 2014 at 9:30 AM
You must combine Workitem 8837 and "root\virtualization\v2".
Could someone provide a build please ? I'm unable to compile this...


Feb 4, 2014 at 10:55 AM
Ok I managed to compile but it wasn't working for me, even when combining Workitem 8837 and "root\virtualization\v2".

My locale is french, so I had to modify the query in In IDictionary<string, string> GetVMNames(IEnumerable<string> vmNames, VMNameType nameType) as following :
// Include only items that have string "Virtual" in description 
string query = "SELECT Name, ElementName FROM Msvm_ComputerSystem WHERE Description like'%Virtuel%'";
I hope this could help someone...


Feb 5, 2014 at 4:46 PM
alexp wrote:
Here's a compiled version including the fix, can you please test it before I update the public download?


Thanks Alessandro! That got it working for me.
Feb 8, 2014 at 8:58 AM
Good afternoon.
windows 2012 r2 local is Russian
I run ,- I have same problem as couda.
If i run the, then tumbled errors:
Backing up all VMs on this server
Error: invalid class
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at Cloudbase.Titan.HyperV.Backup.BackupManager.GetVMNames(IEnumerable`1 vmNames, VMNameType nameType) в c:\Soft\Script
s\Backup\Hyper-V\HVBackup_Source\HyperVBackup\HyperVBackup\BackupManager.cs:line 323
   at Cloudbase.Titan.HyperV.Backup.BackupManager.VSSBackup(IEnumerable`1 vmNames, VMNameType nameType, String backupOutp
utPath, String backupOutputFormat, Boolean singleSnapshot, Int32 compressionLevel) в c:\Soft\Scripts\Backup\Hyper-V\HVBa
ckup_Source\HyperVBackup\HyperVBackup\BackupManager.cs:line 77
   at Cloudbase.Titan.HyperV.Backup.CLI.Program.Main(String[] args)
sorry for my english.
Mar 14, 2014 at 7:31 PM
I have compile a version for 2012R2 italy .. this is the link ..
Mar 14, 2014 at 10:32 PM
Here's a new version that solves the localization issue and includes support for Windows Server 2012 R2:

Let me know if it works for you!
Mar 17, 2014 at 6:54 PM
Thanks for your work! awesome!