Object cmobj = cb.getServiceUtil3().getDynamicProperty(morHost, "configManager");
HostConfigManager configMgr = (HostConfigManager)cmobj;
ManagedObjectReference nwSystem = configMgr.getNetworkSystem();
HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec();
HostIpConfig ipConfig = new HostIpConfig();
ipConfig.setDhcp(false);
ipConfig.setIpAddress("192.168.26.177");
ipConfig.setSubnetMask("255.255.255.0");
vNicSpec.setIp(ipConfig);
vNicSpec.setPortgroup("VM Network vlan26");
cb.getServiceConnection3().getService().addVirtualNic(nwSystem,
"dvPortGroup-vlan26", vNicSpec);
}