Class DistributedVirtualSwitch
The vsphere..DistributedVirtualSwitch resource can be used to manage VMware
Distributed Virtual Switches.
An essential component of a distributed, scalable VMware datacenter, the
vSphere Distributed Virtual Switch (DVS) provides centralized management and
monitoring of the networking configuration of all the hosts that are associated
with the switch. In addition to adding port groups (see the
vsphere..DistributedPortGroup resource) that can
be used as networks for virtual machines, a DVS can be configured to perform
advanced high availability, traffic shaping, network monitoring, and more.
For an overview on vSphere networking concepts, see this page. For more information on vSphere DVS, see this page.
NOTE: This resource requires vCenter and is not available on direct ESXi connections.
Example Usage
Uplink name and count control
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var dvs = new VSphere.DistributedVirtualSwitch("dvs", new VSphere.DistributedVirtualSwitchArgs
{
ActiveUplinks =
{
"tfup1",
},
DatacenterId = data.Vsphere_datacenter.Dc.Id,
StandbyUplinks =
{
"tfup2",
},
Uplinks =
{
"tfup1",
"tfup2",
},
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class DistributedVirtualSwitch : CustomResource
Constructors
View SourceDistributedVirtualSwitch(String, DistributedVirtualSwitchArgs, CustomResourceOptions)
Create a DistributedVirtualSwitch resource with the given unique name, arguments, and options.
Declaration
public DistributedVirtualSwitch(string name, DistributedVirtualSwitchArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DistributedVirtualSwitchArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceActiveUplinks
A list of active uplinks to be used in load
balancing. These uplinks need to match the definitions in the
uplinks DVS argument. See
here for more details.
Declaration
public Output<ImmutableArray<string>> ActiveUplinks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AllowForgedTransmits
Controls whether or not a virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
Declaration
public Output<bool> AllowForgedTransmits { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
AllowMacChanges
Controls whether or not the Media Access Control (MAC) address can be changed.
Declaration
public Output<bool> AllowMacChanges { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
AllowPromiscuous
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
Declaration
public Output<bool> AllowPromiscuous { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
BlockAllPorts
Shuts down all ports in the port groups that this policy applies to, effectively blocking all network access to connected virtual devices.
Declaration
public Output<bool> BlockAllPorts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
CheckBeacon
Enables beacon probing as an additional measure to detect NIC failure.
Declaration
public Output<bool> CheckBeacon { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
ConfigVersion
The version string of the configuration that this spec is trying to change.
Declaration
public Output<string> ConfigVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContactDetail
The detailed contact information for the person who is responsible for the DVS.
Declaration
public Output<string> ContactDetail { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ContactName
The name of the person who is responsible for the DVS.
Declaration
public Output<string> ContactName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CustomAttributes
Map of custom attribute ids to attribute value strings to set for virtual switch.
Declaration
public Output<ImmutableDictionary<string, string>> CustomAttributes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
DatacenterId
The ID of the datacenter where the distributed virtual switch will be created. Forces a new resource if changed.
Declaration
public Output<string> DatacenterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
A detailed description for the DVS.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DirectpathGen2Allowed
Allow VMDirectPath Gen2 for the ports for which this policy applies to.
Declaration
public Output<bool> DirectpathGen2Allowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
EgressShapingAverageBandwidth
The average bandwidth in bits per second if egress traffic shaping is enabled on the port.
Declaration
public Output<int> EgressShapingAverageBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
EgressShapingBurstSize
The maximum burst size allowed in bytes if egress traffic shaping is enabled on the port.
Declaration
public Output<int> EgressShapingBurstSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
EgressShapingEnabled
true if the traffic shaper is enabled
on the port for egress traffic.
Declaration
public Output<bool> EgressShapingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
EgressShapingPeakBandwidth
The peak bandwidth during bursts in bits per second if egress traffic shaping is enabled on the port.
Declaration
public Output<int> EgressShapingPeakBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Failback
If true, the teaming policy will re-activate failed
uplinks higher in precedence when they come back up.
Declaration
public Output<bool> Failback { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
FaulttoleranceMaximumMbit
The maximum allowed usage for the faultTolerance traffic class, in Mbits/sec.
Declaration
public Output<int> FaulttoleranceMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
FaulttoleranceReservationMbit
The amount of guaranteed bandwidth for the faultTolerance traffic class, in Mbits/sec.
Declaration
public Output<int> FaulttoleranceReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
FaulttoleranceShareCount
The amount of shares to allocate to the faultTolerance traffic class for a custom share level.
Declaration
public Output<int> FaulttoleranceShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
FaulttoleranceShareLevel
The allocation level for the faultTolerance traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> FaulttoleranceShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Folder
The folder to create the DVS in. Forces a new resource if changed.
Declaration
public Output<string> Folder { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
HbrMaximumMbit
The maximum allowed usage for the hbr traffic class, in Mbits/sec.
Declaration
public Output<int> HbrMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
HbrReservationMbit
The amount of guaranteed bandwidth for the hbr traffic class, in Mbits/sec.
Declaration
public Output<int> HbrReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
HbrShareCount
The amount of shares to allocate to the hbr traffic class for a custom share level.
Declaration
public Output<int> HbrShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
HbrShareLevel
The allocation level for the hbr traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> HbrShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Hosts
Use the host block to declare a host specification. The
options are:
Declaration
public Output<ImmutableArray<DistributedVirtualSwitchHost>> Hosts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<DistributedVirtualSwitchHost>> |
IngressShapingAverageBandwidth
The average bandwidth in bits per second if ingress traffic shaping is enabled on the port.
Declaration
public Output<int> IngressShapingAverageBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IngressShapingBurstSize
The maximum burst size allowed in bytes if ingress traffic shaping is enabled on the port.
Declaration
public Output<int> IngressShapingBurstSize { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IngressShapingEnabled
true if the traffic shaper is
enabled on the port for ingress traffic.
Declaration
public Output<bool> IngressShapingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
IngressShapingPeakBandwidth
The peak bandwidth during bursts in bits per second if ingress traffic shaping is enabled on the port.
Declaration
public Output<int> IngressShapingPeakBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Ipv4Address
An IPv4 address to identify the switch. This is mostly useful when used with the Netflow arguments found below.
Declaration
public Output<string> Ipv4Address { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IscsiMaximumMbit
The maximum allowed usage for the iSCSI traffic class, in Mbits/sec.
Declaration
public Output<int> IscsiMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IscsiReservationMbit
The amount of guaranteed bandwidth for the iSCSI traffic class, in Mbits/sec.
Declaration
public Output<int> IscsiReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IscsiShareCount
The amount of shares to allocate to the iSCSI traffic class for a custom share level.
Declaration
public Output<int> IscsiShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IscsiShareLevel
The allocation level for the iSCSI traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> IscsiShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LacpApiVersion
The Link Aggregation Control Protocol group
version to use with the switch. Possible values are singleLag and
multipleLag.
Declaration
public Output<string> LacpApiVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LacpEnabled
Enables LACP for the ports that this policy applies to.
Declaration
public Output<bool> LacpEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
LacpMode
The LACP mode. Can be one of active or passive.
Declaration
public Output<string> LacpMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LinkDiscoveryOperation
Whether to advertise or listen
for link discovery traffic.
Declaration
public Output<string> LinkDiscoveryOperation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LinkDiscoveryProtocol
The discovery protocol type. Valid
types are cdp and lldp.
Declaration
public Output<string> LinkDiscoveryProtocol { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ManagementMaximumMbit
The maximum allowed usage for the management traffic class, in Mbits/sec.
Declaration
public Output<int> ManagementMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
ManagementReservationMbit
The amount of guaranteed bandwidth for the management traffic class, in Mbits/sec.
Declaration
public Output<int> ManagementReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
ManagementShareCount
The amount of shares to allocate to the management traffic class for a custom share level.
Declaration
public Output<int> ManagementShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
ManagementShareLevel
The allocation level for the management traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> ManagementShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaxMtu
The maximum transmission unit (MTU) for the virtual switch.
Declaration
public Output<int> MaxMtu { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
MulticastFilteringMode
The multicast filtering mode to use
with the switch. Can be one of legacyFiltering or snooping.
Declaration
public Output<string> MulticastFilteringMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the distributed virtual switch.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetflowActiveFlowTimeout
The number of seconds after which
active flows are forced to be exported to the collector. Allowed range is
60 to 3600. Default: 60.
Declaration
public Output<int?> NetflowActiveFlowTimeout { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
NetflowCollectorIpAddress
IP address for the Netflow collector, using IPv4 or IPv6. IPv6 is supported in vSphere Distributed Switch Version 6.0 or later. Must be set before Netflow can be enabled.
Declaration
public Output<string> NetflowCollectorIpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetflowCollectorPort
Port for the Netflow collector. This must be set before Netflow can be enabled.
Declaration
public Output<int?> NetflowCollectorPort { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
NetflowEnabled
Enables Netflow on all ports that this policy applies to.
Declaration
public Output<bool> NetflowEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
NetflowIdleFlowTimeout
The number of seconds after which
idle flows are forced to be exported to the collector. Allowed range is 10
to 600. Default: 15.
Declaration
public Output<int?> NetflowIdleFlowTimeout { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
NetflowInternalFlowsOnly
Whether to limit analysis to
traffic that has both source and destination served by the same host.
Default: false.
Declaration
public Output<bool?> NetflowInternalFlowsOnly { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
NetflowObservationDomainId
The observation domain ID for the Netflow collector.
Declaration
public Output<int?> NetflowObservationDomainId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
NetflowSamplingRate
The ratio of total number of packets to
the number of packets analyzed. The default is 0, which indicates that the
switch should analyze all packets. The maximum value is 1000, which
indicates an analysis rate of 0.001%.
Declaration
public Output<int?> NetflowSamplingRate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
NetworkResourceControlEnabled
Set to true to enable
network I/O control. Default: false.
Declaration
public Output<bool?> NetworkResourceControlEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
NetworkResourceControlVersion
The version of network I/O
control to use. Can be one of version2 or version3. Default: version2.
Declaration
public Output<string> NetworkResourceControlVersion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NfsMaximumMbit
The maximum allowed usage for the nfs traffic class, in Mbits/sec.
Declaration
public Output<int> NfsMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
NfsReservationMbit
The amount of guaranteed bandwidth for the nfs traffic class, in Mbits/sec.
Declaration
public Output<int> NfsReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
NfsShareCount
The amount of shares to allocate to the nfs traffic class for a custom share level.
Declaration
public Output<int> NfsShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
NfsShareLevel
The allocation level for the nfs traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> NfsShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NotifySwitches
If true, the teaming policy will notify the
broadcast network of an uplink failover, triggering cache updates.
Declaration
public Output<bool> NotifySwitches { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
PortPrivateSecondaryVlanId
Used to define a secondary VLAN ID when using private VLANs.
Declaration
public Output<int> PortPrivateSecondaryVlanId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
StandbyUplinks
A list of standby uplinks to be used in
failover. These uplinks need to match the definitions in the
uplinks DVS argument. See
here for more details.
Declaration
public Output<ImmutableArray<string>> StandbyUplinks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
The IDs of any tags to attach to this resource.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TeamingPolicy
The uplink teaming policy. Can be one of
loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or
failover_explicit.
Declaration
public Output<string> TeamingPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TxUplink
Forward all traffic transmitted by ports for which this policy applies to its DVS uplinks.
Declaration
public Output<bool> TxUplink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Uplinks
A list of strings that uniquely identifies the names of the uplinks on the DVS across hosts. The number of items in this list controls the number of uplinks that exist on the DVS, in addition to the names. See here for an example on how to use this option.
Declaration
public Output<ImmutableArray<string>> Uplinks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
VdpMaximumMbit
The maximum allowed usage for the vdp traffic class, in Mbits/sec.
Declaration
public Output<int> VdpMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VdpReservationMbit
The amount of guaranteed bandwidth for the vdp traffic class, in Mbits/sec.
Declaration
public Output<int> VdpReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VdpShareCount
The amount of shares to allocate to the vdp traffic class for a custom share level.
Declaration
public Output<int> VdpShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VdpShareLevel
The allocation level for the vdp traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> VdpShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Version
- The version of the DVS to create. The default is to create the DVS at the latest version supported by the version of vSphere being used. A DVS can be upgraded to another version, but cannot be downgraded.
Declaration
public Output<string> Version { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VirtualmachineMaximumMbit
The maximum allowed usage for the virtualMachine traffic class, in Mbits/sec.
Declaration
public Output<int> VirtualmachineMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VirtualmachineReservationMbit
The amount of guaranteed bandwidth for the virtualMachine traffic class, in Mbits/sec.
Declaration
public Output<int> VirtualmachineReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VirtualmachineShareCount
The amount of shares to allocate to the virtualMachine traffic class for a custom share level.
Declaration
public Output<int> VirtualmachineShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VirtualmachineShareLevel
The allocation level for the virtualMachine traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> VirtualmachineShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VlanId
The VLAN ID for single VLAN mode. 0 denotes no VLAN.
Declaration
public Output<int> VlanId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VlanRanges
Used to denote VLAN trunking. Use the min_vlan
and max_vlan sub-arguments to define the tagged VLAN range. Multiple
vlan_range definitions are allowed, but they must not overlap. Example
below:
Declaration
public Output<ImmutableArray<DistributedVirtualSwitchVlanRange>> VlanRanges { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<DistributedVirtualSwitchVlanRange>> |
VmotionMaximumMbit
The maximum allowed usage for the vmotion traffic class, in Mbits/sec.
Declaration
public Output<int> VmotionMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VmotionReservationMbit
The amount of guaranteed bandwidth for the vmotion traffic class, in Mbits/sec.
Declaration
public Output<int> VmotionReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VmotionShareCount
The amount of shares to allocate to the vmotion traffic class for a custom share level.
Declaration
public Output<int> VmotionShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VmotionShareLevel
The allocation level for the vmotion traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> VmotionShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VsanMaximumMbit
The maximum allowed usage for the vsan traffic class, in Mbits/sec.
Declaration
public Output<int> VsanMaximumMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VsanReservationMbit
The amount of guaranteed bandwidth for the vsan traffic class, in Mbits/sec.
Declaration
public Output<int> VsanReservationMbit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VsanShareCount
The amount of shares to allocate to the vsan traffic class for a custom share level.
Declaration
public Output<int> VsanShareCount { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
VsanShareLevel
The allocation level for the vsan traffic class. Can be one of high, low, normal, or custom.
Declaration
public Output<string> VsanShareLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DistributedVirtualSwitchState, CustomResourceOptions)
Get an existing DistributedVirtualSwitch resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static DistributedVirtualSwitch Get(string name, Input<string> id, DistributedVirtualSwitchState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DistributedVirtualSwitchState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| DistributedVirtualSwitch |