Merge pull request #8041 from zhaoxiangchun/bugfix/zxc-tk-vmware-master

bugfix:esxi collect metric
This commit is contained in:
yunion-ci-robot
2020-09-23 20:42:21 +08:00
committed by GitHub
+6
View File
@@ -187,6 +187,9 @@ func (cli *SESXiClient) getManagerEntityofVm(server jsonutils.JSONObject) (*mo.M
}
for _, virtualMachine := range virtualMachines {
guest := NewVirtualMachine(cli, &virtualMachine, nil)
if guest == nil {
continue
}
ip := guest.GetGlobalId()
if ip == extId {
return virtualMachine.Entity(), nil
@@ -204,6 +207,9 @@ func (cli *SESXiClient) getManagerEntityofHost(host jsonutils.JSONObject) (*mo.M
}
for _, hostSystem := range hostSystems {
host := NewHost(cli, &hostSystem, nil)
if host == nil {
continue
}
ip := host.GetGlobalId()
if ip == extId {
return hostSystem.Entity(), nil