My VM has multiple NIC and I want to fetch details by having network label and Mac address for each network card of VM
Eg.
Network Adapter 1 : 00:50:63:aa:0C:01
Network Adapter 2 : 00:50:63:aa:24:D5
Network Adapter 3 : 00:50:63:aa:3F:23
All this is to be fetched using VRO and VM properties vm.config.hardware.device
Try this:
var modnet = System.getModule("com.vmware.library.vc.vm.network");
for each (var device in vm.config.hardware.device) {
if (!modnet.isSupportedNic(device)) {
// device is not a network card; skip it
continue;
}
System.log("Label: '" + device.deviceInfo.label + "' MAC Address: " + device.macAddress);
}
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Try this:
var modnet = System.getModule("com.vmware.library.vc.vm.network");
for each (var device in vm.config.hardware.device) {
if (!modnet.isSupportedNic(device)) {
// device is not a network card; skip it
continue;
}
System.log("Label: '" + device.deviceInfo.label + "' MAC Address: " + device.macAddress);
}
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Appreciate it !!!
Thanks for your input. it was really helpful.