VMware Cloud Community
FrankFrankster
Contributor
Contributor
Jump to solution

Trigger/Force Refresh of ExtensionData.Guest.Net

dear all,

I'm trying to implement an automated workaround with PowerCLI for an issue we have with vCenter and a third party plugin.

Basically my question is: Is there a way to force a refresh of the data in $MyVM.ExtensionData.Guest.Net with PowerCLI? Using the web client, it seems that this is triggered by opening the web console of $MyVM.

More details about my question:

Problem:

vCenter obviously seems to have a glitch that when creating a virtual machine with multiple virtual network adapters, it only displays the IP address of the last network adapter in the Summary tab.

For example, I have a VM with three virtual NICs, and vCenter only displays the IP address of the third NIC.

In PowerCLI, this issue looks like this:

$MyVM = get-vm -Name "MyVM"

$MyVM.ExtensionData.Guest.Net

Network        : PortGroup1

IpAddress      : {172.16.1.1}

MacAddress     : 00:50:56:a8:d3:5a

Connected      : True

DeviceConfigId : 4001

DnsConfig      :

IpConfig       : VMware.Vim.NetIpConfigInfo

NetBIOSConfig  :

Network        : PortGroup2

IpAddress      : {172.16.1.1}

MacAddress     : 00:50:56:a8:b5:b0

Connected      : True

DeviceConfigId : 4001

DnsConfig      :

IpConfig       : VMware.Vim.NetIpConfigInfo

NetBIOSConfig  :

Network        : PortGroup3

IpAddress      : {172.16.1.1}

MacAddress     : 00:50:56:a8:88:9e

Connected      : True

DeviceConfigId : 4001

DnsConfig      :

IpConfig       : VMware.Vim.NetIpConfigInfo

NetBIOSConfig  :

As you can see, the IpAddress is the same on all vNICs. However, all vNICs are of course configured with a different IP. According to support of the third party plugin, all 6.7.x versions are affected by this glitch.

Workaround (GUI):

The workaround for this issue in the GUI is simply to open the web console of the affected VM...This seems to trigger a refresh of this information, and after that all three IPs are showed correctly both in the GUI as well as in $MyVM.ExtensionData.Guest.Net. However after a few days, the issue returns and we need to open the web console again. Therefore I'm searching a way to work around this by running a powerCLI script regularly.

Thanks in advance for your support!

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try with

$MyVM.ExtensionData.UpdateViewData('Guest.Net')

But be aware that this refreshes the content of Guest.Net, it does not cause a refresh of the VMware Tools in the Guest OS refreshing this data and passing it to the vSphere server.

Not sure if that possibility exists and is a public API.

The 'heavy' solution is to restart the VMware Tools service in the Guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

6 Replies
LucD
Leadership
Leadership
Jump to solution

Try with

$MyVM.ExtensionData.UpdateViewData('Guest.Net')

But be aware that this refreshes the content of Guest.Net, it does not cause a refresh of the VMware Tools in the Guest OS refreshing this data and passing it to the vSphere server.

Not sure if that possibility exists and is a public API.

The 'heavy' solution is to restart the VMware Tools service in the Guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

FrankFrankster
Contributor
Contributor
Jump to solution

Thanks for the quick response, Luc!

Unfortunately it does not seem to fix it, it still returns the same three IPs. The VM in my particular case is a virtual appliance, so I need to check if I can schedule/trigger a VMware tools restart in it, but thanks for the hint!

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

It seems there is a way to refresh the information.

In William's post How to immediately refresh the network GuestInfo using VMware Tools? he shows the commands to do that.

These commands could be run inside the Guest OS via Invoke-VMScript.

That should allow you to bypass the 30-second refresh window.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

FrankFrankster
Contributor
Contributor
Jump to solution

"/usr/bin/vmware-toolbox-cmd info update network" did not do the trick, but your posts still brought me to a solution Smiley Happy

I've now chosen the "heavy solution" (restarting vmware tools) of your first post, and I'm doing that through Invoke-VMScript you mentioned in your second post:

Invoke-VMScript -VM $MyVM -ScriptText "sudo systemctl restart open-vm-tools.service" -GuestUser "User" -GuestPassword "Password"

This refreshes the information and I now get all 3 IPs. What a great community experience, thanks Luc! :smileylaugh:

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Great, and thanks for sharing that.

Btw, you checked that the VMware Tools are 10.1 or newer?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
FrankFrankster
Contributor
Contributor
Jump to solution

Not sure what's the correct way for Linux and open VMTools, but the vCenter web client is telling me "version:2147483647 (Guest Managed)" for that particular VM. In guest, I get the following output for vmware-toolbox-cmd -v :  10.3.5.7752 (build-10430147).

Reply
0 Kudos