CLOUDSTACK-7277: [Hyper-V] For vmsync first VMs are listed and their power state is

determined. To exclude hosted system we filter the result on Caption='Virtual Machine'
but this string is locale dependent so it may not not work properly for locales other
than english. To overcome this now we started using ProcessId >= 0 filter
This commit is contained in:
Anshul Gangwar 2014-08-07 11:36:45 +05:30 committed by Devdeep Singh
parent d1796c5f58
commit 1c688f40e1
2 changed files with 5 additions and 2 deletions

View File

@ -2434,7 +2434,10 @@ namespace HypervResource
logger.Error(details, sysEx);
}
return JArray.FromObject(hostVmStateReport);
var answer = JArray.FromObject(hostVmStateReport);
logger.Info(String.Format("{0}: {1}",CloudStackTypes.HostVmStateReportCommand, answer.ToString()));
return answer;
}
}

View File

@ -2315,7 +2315,7 @@ namespace HypervResource
public ComputerSystem.ComputerSystemCollection GetComputerSystemCollection()
{
var wmiQuery = String.Format("Caption=\"Virtual Machine\"");
var wmiQuery = String.Format("ProcessId >= 0");
return ComputerSystem.GetInstances(wmiQuery);
}