VMware Cloud Community
Chin39
Contributor
Contributor
Jump to solution

PowerCLI and RDMA NICs?

Does anyone know that if it is possible to add RDMA NICs via PowerCLI?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In the current PowerCLI version, the New-NetworkAdapter cmdlet doesn't have the PVRDMA option on the Type parameter.

You will have to use the ReconfigVM_Task API method to a RDMA NIC. Use the VirtualVmxnet3Vrdma device.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

With the Get-EsxCli cmdlet you can access all esxcli functionality, also the rdma commands.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Chin39
Contributor
Contributor
Jump to solution

Thanks, and could PowerCLI attaches RDMA NICs to a VM? Does PowerCLI has a specific data type like SR IOV? Smiley Happy

0 Kudos
LucD
Leadership
Leadership
Jump to solution

In the current PowerCLI version, the New-NetworkAdapter cmdlet doesn't have the PVRDMA option on the Type parameter.

You will have to use the ReconfigVM_Task API method to a RDMA NIC. Use the VirtualVmxnet3Vrdma device.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Chin39
Contributor
Contributor
Jump to solution

Post my code here for who may use this

    $vmObj = Get-VMHost -Name $hvServer | Get-VM -Name $vmName

    if (-not $vmObj) {

        Write-ERROR -Message "CheckModules: Unable to create VM object for VM $vmName" -Category ObjectNotFound -ERRORAction SilentlyContinue

        return $false

    }

    try {

        # Get Switch INFO

        $DVS = Get-VDSwitch -VMHost $vmObj.VMHost

   

        # This is hard code DPortGroup Name This may change

        $PG = $DVS | Get-VDPortgroup -Name "DPortGroup"

        # Add new nic into config file

        $Spec = New-Object VMware.Vim.VirtualMachineConfigSpec

        $Dev = New-Object Vmware.Vim.VirtualDeviceConfigSpec

        $Dev.Operation = "add"

        $Dev.Device = New-Object VMware.Vim.VirtualVmxnet3Vrdma

        $Spec.DeviceChange += $dev

        $Spec.DeviceChange.Device.Backing = New-Object VMware.Vim.VirtualEthernetCardDistributedVirtualPortBackingINFO

        $Spec.DeviceChange.Device.Backing.Port = New-Object VMware.Vim.DistributedVirtualSwitchPortConnection

   

        # This is currently UNKNOWN function from SR-IOV case

        $Spec.DeviceChange.Device.Backing.Port.PortgroupKey = $PG.Key

        $Spec.DeviceChange.Device.Backing.Port.SwitchUuid = $DVS.Key

        # Apply the new config

        $View = $vmObj | Get-View

        $View.ReconfigVM($Spec)

    }

    catch {

        $ERRORMessage = $_ | Out-String

        LogPrint "ERROR: RDMA config ERROR, $ERRORMessage"

        return $false

    }

0 Kudos