open-vm-tools icon indicating copy to clipboard operation
open-vm-tools copied to clipboard

IP Address origin always remain unset for linux guests.

Open namra98 opened this issue 2 years ago • 2 comments

Describe the bug

After installing open-vm-tools on a guest os, it is expected that all the guest properties will be populated in vm object on VCenter. Specifically, properties under guest.net which is of type GuestNicInfo[].

However, for linux vms, the IPAddress origin property always remains unset and this leads to no information regarding if guest is using dhcp or static ip address.

image

For windows VMs with vmware tools installed, this property gets populated correctly.

image

Reproduction steps

  1. Install open-vm-tools on VSphere VM with any linux distribution.
  2. Expected property is not populated.

Expected behavior

IP address origin should be populated for linux VMs.

Additional context

Same behaviour of empty or unset property is observed from PowerCLI and APIs.

namra98 avatar Oct 17 '23 07:10 namra98

For linux guest, we do not record the origin and status info for the nicinfo. https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/nicInfo/nicInfoPosix.c#L641 https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/nicInfo/nicInfo.c#L440

According for the current guest info api design, these two fields are optional. https://vdc-download.vmware.com/vmwb-repository/dcr-public/790263bc-bd30-48f1-af12-ed36055d718b/e5f17bfc-ecba-40bf-a04f-376bbb11e811/vim.net.IpConfigInfo.IpAddress.html

pengzhencao avatar Oct 18 '23 08:10 pengzhencao

I filed an enhancement PR to collect the optional 'origin' and 'state' fields if available from the Linux guest.

These two fields are optional information as pointed out by @pengzhencao; there is no expectations the information needs to be consistent across guest OSes.

No guarantee when or if it is possible to implement.

PaTHml avatar Oct 24 '23 15:10 PaTHml