After upgrading vCO 5.5 to 5.5.1 I discovered to my dismay that it is now impossible to retrieve the vlan ID for a traditional portgroup; the reported vlanId is now always '0' (not null or undefined).
This is clearly a bug, and in my case it breaks all sorts of things.
I use the following code, which worked in 5.5:
var hosts=Server.findAllForType("VC:HostSystem");
var host=hosts[0];
allpg=host.config.network.portgroup
for (var n=0; n<allpg.length;n++) {
spec=allpg[n].spec;
var pgvlan=spec.vlanId
pgname=spec.name
System.log("Portgroup "+pgname+" has vlan "+pgvlan)
}
As of version 5.5.1, the vlan ID returned is always 0.