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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1c688f40
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1c688f40
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1c688f40

Branch: refs/heads/master
Commit: 1c688f40e134e2f65fe11bb37946e550feb896ca
Parents: d1796c5
Author: Anshul Gangwar <anshul.gang...@citrix.com>
Authored: Thu Aug 7 11:36:45 2014 +0530
Committer: Devdeep Singh <devd...@gmail.com>
Committed: Mon Aug 18 11:38:29 2014 +0530

----------------------------------------------------------------------
 .../ServerResource/HypervResource/HypervResourceController.cs   | 5 ++++-
 .../hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs   | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c688f40/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
 
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
index 62f5355..6c6ec56 100644
--- 
a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ 
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -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;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c688f40/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
----------------------------------------------------------------------
diff --git 
a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs 
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
index b2a7b45..f9b6e34 100644
--- 
a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
+++ 
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
@@ -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);
         }
 

Reply via email to