1 2 Previous Next 25 Replies Latest reply on Feb 11, 2019 7:59 PM by jvm2016

    creating vmkernel port group_powercli

    jvm2016 Hot Shot

      Hi luc,

      good morning .


      there is a requirement of

      1:creating two distributed port groups

      2:and two vmkernel adapters (for vmotion and replication) per esxi in three node cluster.


      i thought of doing as below .could you modify orange code so that we can iterate over ips of vmotion and replication .


      function create-vmkernelport































          $cluster=Get-Cluster $clustername



          $vmhosts=get-vmhost -Location $cluster

          $ipvmotion = "","",""

          $ipreplication = "","",""



          $vmotion=New-VDPortgroup -name "vmotion_112" -VDSwitch $distributedswitch -VlanId 112 -PortBinding Static -NumPorts 8

           $replication=New-VDPortgroup -name "replication_113" -VDSwitch $distributedswitch -VlanId 113 -PortBinding Static -NumPorts 8





          foreach($vmhost in $vmhosts)



        New-VMHostNetworkAdapter -VMHost $vmhost -PortGroup $vmotion

        -VirtualSwitch $distributedswitch -IP $ipvmotion[$i] -SubnetMask $subnetmask



        New-VMHostNetworkAdapter -VMHost $vmhost -PortGroup $replication

        -VirtualSwitch $distributedswitch -IP $ipreplication [$i] -SubnetMask $subnetmask









        1 2 Previous Next