Does anyone know that if it is possible to add RDMA NICs via PowerCLI?
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
With the Get-EsxCli cmdlet you can access all esxcli functionality, also the rdma commands.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks, and could PowerCLI attaches RDMA NICs to a VM? Does PowerCLI has a specific data type like SR IOV?
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
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
}