简体   繁体   中英

chef ohai does not fetch any os attributes

I am running command ohai -l debug on Windows server 2016 which should output server attributes.

On one VM it returns empty arrays on most important attributes:

"kernel": {

},
"memory": {
  "swap": {

  }
},
"network": {
  "interfaces": {

  }
},
"counters": {
  "network": {

  }
},
"os": "windows",
"os_version": null,
"platform": "windows",
"platform_version": null,
"platform_family": "windows",
"dmi": {

},
"virtualization": {
  "systems": {

  }
},

Virtual machine is Windows in Microsoft Azure cloud. Azure instance metadata API returns necessary values. Others Azure windows servers works fine, the problem is only with one server.

I am not very familiar with ruby. However, I assume that ohai code responsible for kernel data retrieval is here : collect_data(:windows) . So I wanted to diagnose WMI with WMI Diag tool , but this tool seems not available anymore.

It is kind of dead-end to me. Is there any way to check why ohai does not return attributes? And if it is related to WMI, to debug it or see output in Powershell?

I tried these versions of ohai:

  • 15.16.4
  • 16.4.41
  • 16.13.0

Data was not collected due to failure in WMI service in Azure.

Problem was fixed after WMI repository has been rebuilt.

More info here: https://community.spiceworks.com/how_to/21413-rebuilding-the-wmi-repository .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM