Skip to content

Commit

Permalink
Added Support of vrdma ethernet card
Browse files Browse the repository at this point in the history
  • Loading branch information
cspngo authored and cspnanda007 committed Feb 22, 2022
1 parent 70388c7 commit e7713d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -114,7 +114,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 @@ -123,8 +123,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 e7713d6

Please # to comment.