private HostVirtualNicSpec createVNicSpecification() {
    HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec();
    HostIpConfig ipConfig = new HostIpConfig();
    ipConfig.dhcp=false;
    ipAddr = cb.get_option("ipaddress");
    ipConfig.ipAddress=ipAddr;
    ipConfig.subnetMask="255.255.255.0";      
    vNicSpec.ip=ipConfig;
    return vNicSpec;
 }
Example #2
0
        private HostVirtualNicSpec createVNicSpecification()
        {
            HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec();
            HostIpConfig       ipConfig = new HostIpConfig();

            ipConfig.dhcp       = false;
            ipAddr              = cb.get_option("ipaddress");
            ipConfig.ipAddress  = ipAddr;
            ipConfig.subnetMask = "255.255.255.0";
            vNicSpec.ip         = ipConfig;
            return(vNicSpec);
        }
Example #3
0
        public void AddVirtualNic(VMware.Vim.HostConfigManager configMgr, string portGroupName, string IPaddress, string subNetmask)
        {
            VMware.Vim.ManagedObjectReference nwSystem = configMgr.NetworkSystem;

            HostVirtualNicSpec vNicSpec = new HostVirtualNicSpec();
            HostIpConfig       ipConfig = new HostIpConfig();

            ipConfig.dhcp       = false;
            ipConfig.ipAddress  = IPaddress;
            ipConfig.subnetMask = subNetmask;
            vNicSpec.ip         = ipConfig;

            vimService.AddVirtualNic(nwSystem != null ? new VimApi_55.ManagedObjectReference()
            {
                type  = nwSystem.Type,
                Value = nwSystem.Value
            } : null, portGroupName, vNicSpec);
        }