Hello, I wrote the below script and the goal is to get network related information from customization spec of window 64bits vm. I can get most of attributes set up in custom spec, such as: ip address, DNS server list etc, but NOT "dnsDomain"(it shows as null). The script for getting dnsDomain is underlined below. I also attach few screenshots of my customization spec which shows that dns domain is configured.
Can someone share the light on this issue?
Thanks,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var custspec = new VcCustomizationSpec();
var con = vm.sdkConnection;
var cms = con.customizationSpecManager;
var customSpecExists = cms.doesCustomizationSpecExist(specName);
if (customSpecExists) {
var customSpecItem = cms.getCustomizationSpec(specName);
custspec = customSpecItem.spec;
var name = customSpecItem.info.name;
} else throw "customspec not found";
var ip = custspec.nicSettingMap[0].adapter.ip.ipAddress;
var dnsServerList = custspec.nicSettingMap[0].adapter.dnsServerList;
dnsDomain = custspec.nicSettingMap[0].adapter.dnsDomain;
netmask = custspec.nicSettingMap[0].adapter.subnetMask;
gateway = custspec.nicSettingMap[0].adapter.gateway;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~