Show / Hide Table of Contents

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",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
DistributedVirtualSwitch
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class DistributedVirtualSwitch : CustomResource

Constructors

View Source

DistributedVirtualSwitch(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 Source

ActiveUplinks

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>>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>
View Source

Description

A detailed description for the DVS.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

LacpEnabled

Enables LACP for the ports that this policy applies to.

Declaration
public Output<bool> LacpEnabled { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

LacpMode

The LACP mode. Can be one of active or passive.

Declaration
public Output<string> LacpMode { get; }
Property Value
Type Description
Output<System.String>
View Source

LinkDiscoveryOperation

Whether to advertise or listen for link discovery traffic.

Declaration
public Output<string> LinkDiscoveryOperation { get; }
Property Value
Type Description
Output<System.String>
View Source

LinkDiscoveryProtocol

The discovery protocol type. Valid types are cdp and lldp.

Declaration
public Output<string> LinkDiscoveryProtocol { get; }
Property Value
Type Description
Output<System.String>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

MaxMtu

The maximum transmission unit (MTU) for the virtual switch.

Declaration
public Output<int> MaxMtu { get; }
Property Value
Type Description
Output<System.Int32>
View Source

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>
View Source

Name

The name of the distributed virtual switch.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

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>
View Source

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>>
View Source

NetflowEnabled

Enables Netflow on all ports that this policy applies to.

Declaration
public Output<bool> NetflowEnabled { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

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>>
View Source

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>>
View Source

NetflowObservationDomainId

The observation domain ID for the Netflow collector.

Declaration
public Output<int?> NetflowObservationDomainId { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

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>>
View Source

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>>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.