VM operating system identification


#1

Hello,

I like to ask, where to find identification of operating system.

For example user interface tells “Operating System” = "Microsoft Windows Server 2008 R2 (64-bit)"
But using ObjectWalker I found only “$evm.root[‘vm’].os_image_name = windows_generic (type: String)”,
there is missing version.

Is there some other attribute to identify OS?

Additionally, we are missing for OpenStack information about Operating System of virtual machines. Is it correct behavior?

I like to add that we are using just “discovery”, not using smart state analysis.

Thanks,
Vaclav


#2

Hi Vaclav

What you’re looking for is $evm.root['vm'].operating_system.product_name

You might need to add a couple more associations to your walk_association_whitelist hash for object_walker to traverse what you’re after.

If you look at the object_walker_reader output you’ll probably see something that starts:

“*** not walking: ‘operating_system’ isn’t in the walk_association_whitelist hash for …”

Depending on your provider type the actual object name for your VM will be different, for example “MiqAeServiceManageIQ_Providers_Redhat_InfraManager_Vm” is the object name for a RHV virtual machine. You need to find the corresponding entry in the instance walk_association_whitelist attribute value and add ‘operating_system’, for example:

"MiqAeServiceManageIQ_Providers_Redhat_InfraManager_Vm":["operating_system"]

If you’re using the git imported version of object_walker then the instance is read-only, so you’d have to copy the instance to your own domain to edit it. Unfortunately editing a long attribute value in-place in the instance editor is fairly unwieldy. I find it easier to double-click the whitelist value, copy it, then paste into an editor to change. Then just paste your updated value back into the instance editor.

Hope this helps,
pemcg


#3

Hi Peter,

I overlooked $evm.root['vm'].operating_system part in object_walker output…

Thanks for pointing me there,
Vaclav