Class DistributedPortGroup
The vsphere..DistributedPortGroup resource can be used to manage vSphere
distributed virtual port groups. These port groups are connected to distributed
virtual switches, which can be managed by the
vsphere..DistributedVirtualSwitch resource.
Distributed port groups can be used as networks for virtual machines, allowing VMs to use the networking supplied by a distributed virtual switch (DVS), with a set of policies that apply to that individual newtork, if desired.
For an overview on vSphere networking concepts, see this page. For more information on vSphere DVS portgroups, see this page.
NOTE: This resource requires vCenter and is not available on direct ESXi connections.
Example Usage
Overriding DVS policies
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",
},
});
var pg = new VSphere.DistributedPortGroup("pg", new VSphere.DistributedPortGroupArgs
{
ActiveUplinks =
{
"tfup1",
"tfup2",
},
DistributedVirtualSwitchUuid = dvs.Id,
StandbyUplinks = {},
VlanId = 1000,
});
}
}
Inherited Members
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class DistributedPortGroup : CustomResource
Constructors
View SourceDistributedPortGroup(String, DistributedPortGroupArgs, CustomResourceOptions)
Create a DistributedPortGroup resource with the given unique name, arguments, and options.
Declaration
public DistributedPortGroup(string name, DistributedPortGroupArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DistributedPortGroupArgs | 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
List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.
Declaration
public Output<ImmutableArray<string>> ActiveUplinks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
AllowForgedTransmits
Controls whether or not the 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> |
AutoExpand
Allows the port group to create additional ports
past the limit specified in number_of_ports if necessary. Default: true.
Declaration
public Output<bool?> AutoExpand { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
BlockAllPorts
Indicates whether to block all ports by default.
Declaration
public Output<bool> BlockAllPorts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
BlockOverrideAllowed
Allow the port shutdown policy to be overridden on an individual port.
Declaration
public Output<bool?> BlockOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
CheckBeacon
Enable beacon probing on the ports this policy applies to.
Declaration
public Output<bool> CheckBeacon { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
ConfigVersion
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> |
CustomAttributes
Map of custom attribute ids to attribute value string to set for port group.
Declaration
public Output<ImmutableDictionary<string, string>> CustomAttributes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Description
An optional description for the port group.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DirectpathGen2Allowed
Allow VMDirectPath Gen2 on the ports this policy applies to.
Declaration
public Output<bool> DirectpathGen2Allowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
DistributedVirtualSwitchUuid
The ID of the DVS to add the port group to. Forces a new resource if changed.
Declaration
public Output<string> DistributedVirtualSwitchUuid { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EgressShapingAverageBandwidth
The average egress bandwidth in bits per second if egress shaping is enabled on the port.
Declaration
public Output<int> EgressShapingAverageBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
EgressShapingBurstSize
The maximum egress burst size allowed in bytes if egress 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 for egress traffic on the port.
Declaration
public Output<bool> EgressShapingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
EgressShapingPeakBandwidth
The peak egress 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 interfaces higher in precedence when they come back up.
Declaration
public Output<bool> Failback { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
IngressShapingAverageBandwidth
The average ingress bandwidth in bits per second if ingress shaping is enabled on the port.
Declaration
public Output<int> IngressShapingAverageBandwidth { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
IngressShapingBurstSize
The maximum ingress burst size allowed in bytes if ingress 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 for ingress traffic on the port.
Declaration
public Output<bool> IngressShapingEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
IngressShapingPeakBandwidth
The peak ingress 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> |
Key
The generated UUID of the portgroup.
Declaration
public Output<string> Key { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LacpEnabled
Whether or not to enable LACP on all uplink ports.
Declaration
public Output<bool> LacpEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
LacpMode
The uplink LACP mode to use. Can be one of active or passive.
Declaration
public Output<string> LacpMode { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LivePortMovingAllowed
Allow a port in this port group to be moved to another port group while it is connected.
Declaration
public Output<bool?> LivePortMovingAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Name
The name of the port group.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetflowEnabled
Indicates whether to enable netflow on all ports.
Declaration
public Output<bool> NetflowEnabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
NetflowOverrideAllowed
Allow the Netflow policy on this port group to be overridden on an individual port.
Declaration
public Output<bool?> NetflowOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
NetworkResourcePoolKey
The key of a network resource pool
to associate with this port group. The default is -1, which implies no
association.
Declaration
public Output<string> NetworkResourcePoolKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkResourcePoolOverrideAllowed
Allow the network resource pool set on this port group to be overridden on an individual port.
Declaration
public Output<bool?> NetworkResourcePoolOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
NotifySwitches
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
Declaration
public Output<bool> NotifySwitches { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
NumberOfPorts
The number of ports available on this port group. Cannot be decreased below the amount of used ports on the port group.
Declaration
public Output<int> NumberOfPorts { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
PortConfigResetAtDisconnect
Reset a port's settings to the settings defined on this port group policy when the port disconnects.
Declaration
public Output<bool?> PortConfigResetAtDisconnect { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
PortNameFormat
An optional formatting policy for naming of
the ports in this port group. See the portNameFormat attribute listed
[here][ext-vsphere-portname-format] for details on the format syntax.
Declaration
public Output<string> PortNameFormat { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PortPrivateSecondaryVlanId
The secondary VLAN ID for this port.
Declaration
public Output<int> PortPrivateSecondaryVlanId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
SecurityPolicyOverrideAllowed
Allow the security policy settings defined in this port group policy to be overridden on an individual port.
Declaration
public Output<bool?> SecurityPolicyOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ShapingOverrideAllowed
Allow the traffic shaping options on this port group policy to be overridden on an individual port.
Declaration
public Output<bool?> ShapingOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
StandbyUplinks
List of active uplinks used for load balancing, matching the names of the uplinks assigned in the DVS.
Declaration
public Output<ImmutableArray<string>> StandbyUplinks { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Tags
A list of tag IDs to apply to this object.
Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
TeamingPolicy
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, failover_explicit, or loadbalance_loadbased.
Declaration
public Output<string> TeamingPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TrafficFilterOverrideAllowed
Allow any traffic filters on this port group to be overridden on an individual port.
Declaration
public Output<bool?> TrafficFilterOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
TxUplink
If true, a copy of packets sent to the switch will always be forwarded to an uplink in addition to the regular packet forwarded done by the switch.
Declaration
public Output<bool> TxUplink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Type
The port group type. Can be one of earlyBinding (static
binding) or ephemeral. Default: earlyBinding.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
UplinkTeamingOverrideAllowed
Allow the uplink teaming options on this port group to be overridden on an individual port.
Declaration
public Output<bool?> UplinkTeamingOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
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> |
VlanOverrideAllowed
Allow the VLAN settings on this port group to be overridden on an individual port.
Declaration
public Output<bool?> VlanOverrideAllowed { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
VlanRanges
The VLAN ID for single VLAN mode. 0 denotes no VLAN.
Declaration
public Output<ImmutableArray<DistributedPortGroupVlanRange>> VlanRanges { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<DistributedPortGroupVlanRange>> |
Methods
View SourceGet(String, Input<String>, DistributedPortGroupState, CustomResourceOptions)
Get an existing DistributedPortGroup resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static DistributedPortGroup Get(string name, Input<string> id, DistributedPortGroupState 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. |
| DistributedPortGroupState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| DistributedPortGroup |