Sample Exchange

 View Only

AddVirtualNic 

Jun 27, 2016 08:51 PM

AddVirtualNic

This sample is used to add a Virtual Nic to a PortGroup

Parameters:
url              [required] : url of the web service
username         [required] : username for the authentication
password         [required] : password for the authentication
portgroupname    [required] : Name of the port group
ipaddress        [optional] : ipaddress for the nic, if not set DHCP
will be in affect for the nic
hostname         [optional] : Name of the host
datacentername   [optional] : Name of the datacenter

Command Line:
Add VirtualNic to a PortGroup on a Virtual Switch
run.bat com.vmware.host.AddVirtualNic --url [webserviceurl]
--username [username] --password  [password]
--hostname [hostname]  --datacentername [mydatacenter]
--portgroupname [myportgroup] --ipaddress [AAA.AAA.AAA.AAA]

Add VirtualNic to a PortGroup on a Virtual Switch without hostname
run.bat com.vmware.host.AddVirtualNic --url [webserviceurl]
--username [username] --password  [password]
--datacentername [mydatacenter]
--portgroupname [myportgroup] --ipaddress [AAA.AAA.AAA.AAA]

Add VirtualNic to a PortGroup on a Virtual Switch without datacentername
run.bat com.vmware.host.AddVirtualNic --url [webserviceurl]
--username [username] --password  [password]
--portgroupname [myportgroup] --ipaddress [AAA.AAA.AAA.AAA]

VMware vSphere Web Services Java Samples

This sample was originally released as a part of vSphere 6.0 under license terms that contained a provision that disallowed redistribution in source form. In order to encourage growth of community around VMware samples, these samples are being re-released under a commercially friendly open source license (BSD 3-Clause). See the file header for details.

The samples themselves are identical to the official release version with the exception of a changed copyright and license header on each file.

If you wish to run this sample, please download the official SDK from https://my.vmware.com/group/vmware/get-download?downloadGroup=MNGMTSDK600 and follow the provided instructions.

These samples are provided for reference with no warranty expressed or implied.
#BSD3-Clause
#vSphereManagementSDK
#Java
#vSphereManagementOSS

Statistics
0 Favorited
0 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
java file
AddVirtualNic.java   7 KB   1 version
Uploaded - Apr 09, 2024

Tags and Keywords

Related Entries and Links

No Related Resource entered.