When backing up multiple turned off vms, one of them will not be backed up, because of the incorrect wmi query built in BackupManager.cs
backing up 3 machines: vm1, vm2, vm3 creates the below query:
query = SELECT Name, ElementName FROM Msvm_ComputerSystem WHERE ProcessID >= 0 AND ElementName = 'vm1' OR ElementName = 'vm2' OR ElementName = 'vm3'
logical operator precendence
AND is above
OR this means: select vm2, vm3 but select vm1 only if processid is exists, which is for turned off machines always missing (null).
Anyways, adventuring through the source code I'm wondering why ProcessID is needed at all?
(ProcessID >= 0 AND ElementName = 'vm1') OR (ElementName = 'vm2') OR (ElementName = 'vm3')
I modified this source file a bit:
string query = "SELECT Name, ElementName FROM Msvm_ComputerSystem WHERE ";
//"ProcessID >= 0";
if(vmNames != null && vmNames.Count() > 0)
query += GetORStr(inField, vmNames);
//query += " AND " + GetORStr(inField, vmNames);
And now it's working perfectly for me.