Sample Exchange

 View Only

Add Hosts into DVSwitch using vSphere java api 

Apr 26, 2017 12:02 PM

Description: Adds specified number of ESXi hosts into dvSwitch using vSphere java API. 
Here it will find the first free pnic from each ESXi host and then add it to Uplink1 otherwise it will skip that host.

 *Input & Steps::
 1) Provide the dvSwitch name(in dvsName) and list of host to add (in hostNames) -- addHostsintoDVS(dvsName,hostNames)
 2) It gets DVSwitch object from the dvsName
 3) For each host finds the free physical nics.(it will find the free pnics from the hosts vSwitch & proxy switch)
 4) Associate first free pnic to the the dvs Uplink1
 5) ReconfigureDvs to add above free pnic to the dvs Uplink1. -- reconfigureDvs_Task(dvsConfigSpec)



 


#vSphereAPI
#Java
#vSphereManagementSDK
#VIJavaAPI
#yavijavaapi
#dvSwitchhost
#addhostindvs
#MIT

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

Tags and Keywords

Related Entries and Links

No Related Resource entered.