Add a new VM network adapter and assign the nic to specified standard switch portgroup
AddandReconfigVMNicsToVSS.java
Add a new network adapter and assign the nic to specified distributed switch portgroup How to run this sample: http://vthinkbeyondvm.com/getting-started-with-yavi-java-opensource-java-sdk-for-vmware-vsphere-step-by-step-guide-for-beginners/ #vSpherejavasdk #vSphereAPI #Java #addnictodvs #MIT #addvmnic #vSphereManagementSDK
AddandReconfigVMNicsToDVS.java
2 Comments - >>> How could i assign distibuted port group to VM using java? https://code.vmware.com/samples/1824/assign-dvswitch-portgroup-to-the-specified-vm-network-adapter?...How could i assign distibuted port group to VM using java?
* Description : Adds the VMkernel network adapter for all the hosts in the dvSwitch and assign them to dvPortgroup ports and also enable vMotion service in vmkernel nics using vSphere java API
AddVMkernelToHostsInDVS.java
*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
AddHostsintoDVSwitch.java
Add new virtual harddisk with specified capacity and disk provisioning type for a VM using vSphere API
AddHardDisk.java