Skip to content

Commit

Permalink
feat: Add support for paravirtual RDMA (#1598)
Browse files Browse the repository at this point in the history
* Added Support of vrdma ethernet card
* Apply Oxford comma style formatting.

Signed-off-by: C S P Nanda <cspnanda@gmail.com>
Co-authored-by: Choudhury Sarada Prasanna Nanda <cspn@google.com>
Co-authored-by: Ryan Johnson <johnsonryan@vmware.com>
  • Loading branch information
3 people authored Aug 9, 2022
1 parent 683628f commit f879427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
networkInterfaceSubresourceTypeE1000e = "e1000e"
networkInterfaceSubresourceTypePCNet32 = "pcnet32"
networkInterfaceSubresourceTypeSriov = "sriov"
networkInterfaceSubresourceTypeVRdma = "vmxnet3vrdma"
networkInterfaceSubresourceTypeVmxnet2 = "vmxnet2"
networkInterfaceSubresourceTypeVmxnet3 = "vmxnet3"
networkInterfaceSubresourceTypeUnknown = "unknown"
Expand All @@ -39,6 +40,7 @@ var networkInterfaceSubresourceTypeAllowedValues = []string{
networkInterfaceSubresourceTypeE1000,
networkInterfaceSubresourceTypeE1000e,
networkInterfaceSubresourceTypeVmxnet3,
networkInterfaceSubresourceTypeVRdma,
}

// NetworkInterfaceSubresourceSchema returns the schema for the disk
Expand Down Expand Up @@ -86,7 +88,7 @@ func NetworkInterfaceSubresourceSchema() map[string]*schema.Schema {
Type: schema.TypeString,
Optional: true,
Default: networkInterfaceSubresourceTypeVmxnet3,
Description: "The controller type. Can be one of e1000, e1000e, or vmxnet3.",
Description: "The controller type. Can be one of e1000, e1000e, vmxnet3, or vrdma.",
ValidateFunc: validation.StringInSlice(networkInterfaceSubresourceTypeAllowedValues, false),
},
"use_static_mac": {
Expand Down Expand Up @@ -605,6 +607,8 @@ func baseVirtualEthernetCardToBaseVirtualDevice(v types.BaseVirtualEthernetCard)
return types.BaseVirtualDevice(t)
case *types.VirtualVmxnet3:
return types.BaseVirtualDevice(t)
case *types.VirtualVmxnet3Vrdma:
return types.BaseVirtualDevice(t)
}
panic(fmt.Errorf("unknown ethernet card type %T", v))
}
Expand Down Expand Up @@ -633,6 +637,8 @@ func virtualEthernetCardString(d types.BaseVirtualEthernetCard) string {
return networkInterfaceSubresourceTypeVmxnet2
case *types.VirtualVmxnet3:
return networkInterfaceSubresourceTypeVmxnet3
case *types.VirtualVmxnet3Vrdma:
return networkInterfaceSubresourceTypeVRdma
}
return networkInterfaceSubresourceTypeUnknown
}
Expand Down
6 changes: 3 additions & 3 deletions website/docs/d/virtual_machine.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The following attributes are exported:
* `unit_number` - The disk number on the storage bus.
* `network_interface_types` - The network interface types for each network
interface found on the virtual machine, in device bus order. Will be one of
`e1000`, `e1000e`, `pcnet32`, `sriov`, `vmxnet2`, or `vmxnet3`.
`e1000`, `e1000e`, `pcnet32`, `sriov`, `vmxnet2`, `vmxnet3vrdma`, or `vmxnet3`.
* `network_interfaces` - Information about each of the network interfaces on this
virtual machine or template. These are sorted by device bus order so that they
can be applied to a `vsphere_virtual_machine` resource in the order the resource
Expand All @@ -127,8 +127,8 @@ The following attributes are exported:
data source must be the same on the destination virtual machine as the source.
The sub-attributes are:
* `adapter_type` - The network interface types for each network interface found
on the virtual machine, in device bus order. Will be one of `e1000`, `e1000e` or
`vmxnet3`.
on the virtual machine, in device bus order. Will be one of `e1000`, `e1000e`,
`vmxnet3vrdma`, or `vmxnet3`.
* `bandwidth_limit` - The upper bandwidth limit of this network interface,
in Mbits/sec.
* `bandwidth_reservation` - The bandwidth reservation of this network interface,
Expand Down

0 comments on commit f879427

Please # to comment.