Skip to content

Commit 1c688f4

Browse files
anshulgangwardevdeep
authored andcommitted
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
1 parent d1796c5 commit 1c688f4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,10 @@ public JContainer HostVmStateReportCommand([FromBody]dynamic cmd)
24342434
logger.Error(details, sysEx);
24352435
}
24362436

2437-
return JArray.FromObject(hostVmStateReport);
2437+
var answer = JArray.FromObject(hostVmStateReport);
2438+
logger.Info(String.Format("{0}: {1}",CloudStackTypes.HostVmStateReportCommand, answer.ToString()));
2439+
2440+
return answer;
24382441
}
24392442
}
24402443

plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ public ComputerSystem GetComputerSystem(string displayName)
23152315

23162316
public ComputerSystem.ComputerSystemCollection GetComputerSystemCollection()
23172317
{
2318-
var wmiQuery = String.Format("Caption=\"Virtual Machine\"");
2318+
var wmiQuery = String.Format("ProcessId >= 0");
23192319
return ComputerSystem.GetInstances(wmiQuery);
23202320
}
23212321

0 commit comments

Comments
 (0)