vro not detecting newly added nic on a vm

I'm running vRO 7.4 and it's connected to a vcenter 6.5

I've got a workflow that adds a new vmxnet3 adapter to a vm and then runs a powershell script inside the guest. To run successfully I need to get the mac address of the newly added card so I can be sure I target the right one with the script.

Everything works fine except sometimes vro doesn't detect the new network card on the vm. The code I use to find the new nic is given below (found it online or used from something else, don't recall where I got it). I run it once before I add the nic and once after and compare to find the mac address of the new card. Sometimes the macAddresses array doesn't have the new card in it though, only the old one. I looked in the scripting.log file on the vro server and indeed, it's only showing the original card in the list of devices.

I've been able to reproduce this twice when reverting the vm but it doesn't happen every time and I think it's happened without a revert at least once. If I use powercli and go a get-vm | get-networkadapter it lists all the nics as expected.

A reboot of the vRO appliance seems to fix the problem.

If there some kind of cache that's getting corrupt or a way to force a refresh so I can recover from this problem without having to reboot and kill any in progress workflows?

macAddresses = new Array(); 

var deviceArray = vm.config.hardware.device; 

if (!deviceArray) throw "Error getting hardware config array of VM"; 

    System.debug("deviceArray: " + deviceArray); 

//loop through array, find NICs and retrieve there MACs 

for (var i in deviceArray) { 

    var currentDevice = deviceArray.pop(); 

    if (currentDevice) { 

        //System.log("currentDevice: " + currentDevice); 

        if (currentDevice instanceof VcVirtualE1000 || 

            currentDevice instanceof VcVirtualPCNet32 ||  

            currentDevice instanceof VcVirtualVmxnet ||  

            currentDevice instanceof VcVirtualVmxnet2 ||  

            currentDevice instanceof VcVirtualVmxnet3) { 

                //System.log("found network card on " + currentDevice); 

                macAddresses.push(currentDevice.macAddress) ; 



0 Kudos
5 Replies
VMware Employee
VMware Employee


What about the code which adds the new vmxnet3 adapter? Does the rest of the code wait for the corresponding vCenter task to complete before trying the get mac address?

There is a cache in vCenter plug-in, which is updated/refreshed on events received from vCenter property collector, but I'm not sure if there is a way to force its refresh from scripting.

0 Kudos

Hi Ilian,

I do have a vim3WaitTaskEnd after the reconfig part of the workflow.

After getting the failure I tried my workflow against another test vm I'm using and it worked fine. Switched back to the problem vm and it would still fail.

I left things alone overnight and upon trying again in the morning (maybe 19-20 hours later), the problem vm is now working fine. I was able to run the workflow, add a new nic, and vro detected the change this time.

Does this mean this is a cache issue?

0 Kudos
VMware Employee
VMware Employee

Could be a cache issue.

I recall we had another bug report earlier this year (initial report https://communities.vmware.com/thread/580828). The customer was able to workaround it by using a custom scripting action to retrieve VM properties directly from property collector, bypassing vCenter plug-in cache. The downside was that the customer had to modify his workflows/actions code to replace vm.<something> calls with calls to this custom action.

0 Kudos

I see there's a couple of property collector workflows in vRO already and one of then returns an array of vms so might be ab option for me if I detect I'm in this problematic state.

The thread you linked to is interesting because I think I've run into a similar problem before (most recent occurrence was last week). Basically my vm deploy workflow times out at WaitDnsNameInTools but if I checked in vcenter the name was was displayed. It's not a common occurrence but it does happen.

When using the property collector workflow, do I then need to work with the object it returns going forward or does running that workflow force vRO to update it's cache for said object?

0 Kudos

I have the exact same issue, except in my instance it's after adding a new disk.

We're configuring RAC clusters, so when I add the disk to the Primary. I need to get the disk info so that I can add the same disk (with multiwriter set) to the other VM's.. Randomly it fails to update , and thus the secondary nodes fail to update because they can't find the disk. As with other poster, restart of vco-server appears to clear it , or waiting X hours it  seems to have re-inventoried, and will work.

We have 2 vro instances in the env. When 1 fails like this , I can switch over to the other , and it will work, for a while, then it hits the same issue...Very frustrating.. Is there some mechanism we can use to 'refresh' the vro vCenter plugin data ? ( hitting the 'reload' button on the inventory tab does not work....).



0 Kudos