if (netConf == null)
{
netConf = new NetworkConfiguration();
}
final VirtualNIC nic = new VirtualNIC();
nic.setMacAddress(macAddress);
nic.setIp(ip);
nic.setVSwitchName(vSwitchName);
nic.setNetworkName(networkName);
nic.setVlanTag(vlanTag);
nic.setSequence(sequence);
nic.setLeaseName(leaseName);
nic.setForwardMode(forwardMode);
nic.setNetAddress(netAddress);
nic.setGateway(gateway);
nic.setMask(mask);
nic.setPrimaryDNS(primaryDNS);
nic.setSecondaryDNS(secondaryDNS);
nic.setSufixDNS(sufixDNS);
nic.setDhcpOptions(list);
nic.setConfigureGateway(configureGateway);
nic.setUnmanaged(isUnmanaged);
nic.setProviderId(providerId);
nic.setNetworkProviderId(networkProviderId);
if (driver != null)
{
nic.setEthernetDriver(driver);
}
nic.setIpv6(ipv6);
netConf.getVirtualNICs().add(nic);
return this;
}