1. Packages
  2. Vsphere Provider
  3. API Docs
  4. HostVirtualSwitch
vSphere v4.13.2 published on Wednesday, Apr 9, 2025 by Pulumi

vsphere.HostVirtualSwitch

Explore with Pulumi AI

The vsphere.HostVirtualSwitch resource can be used to manage vSphere standard switches on an ESXi host. These switches can be used as a backing for standard port groups, which can be managed by the vsphere.HostPortGroup resource.

For an overview on vSphere networking concepts, see this page.

Example Usage

Create a virtual switch with one active and one standby NIC

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = vsphere.getDatacenter({
    name: "dc-01",
});
const host = datacenter.then(datacenter => vsphere.getHost({
    name: "esxi-01.example.com",
    datacenterId: datacenter.id,
}));
const _switch = new vsphere.HostVirtualSwitch("switch", {
    name: "vSwitchTest",
    hostSystemId: host.then(host => host.id),
    networkAdapters: [
        "vmnic0",
        "vmnic1",
    ],
    activeNics: ["vmnic0"],
    standbyNics: ["vmnic1"],
});
Copy
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc-01")
host = vsphere.get_host(name="esxi-01.example.com",
    datacenter_id=datacenter.id)
switch = vsphere.HostVirtualSwitch("switch",
    name="vSwitchTest",
    host_system_id=host.id,
    network_adapters=[
        "vmnic0",
        "vmnic1",
    ],
    active_nics=["vmnic0"],
    standby_nics=["vmnic1"])
Copy
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
			Name: pulumi.StringRef("dc-01"),
		}, nil)
		if err != nil {
			return err
		}
		host, err := vsphere.LookupHost(ctx, &vsphere.LookupHostArgs{
			Name:         pulumi.StringRef("esxi-01.example.com"),
			DatacenterId: datacenter.Id,
		}, nil)
		if err != nil {
			return err
		}
		_, err = vsphere.NewHostVirtualSwitch(ctx, "switch", &vsphere.HostVirtualSwitchArgs{
			Name:         pulumi.String("vSwitchTest"),
			HostSystemId: pulumi.String(host.Id),
			NetworkAdapters: pulumi.StringArray{
				pulumi.String("vmnic0"),
				pulumi.String("vmnic1"),
			},
			ActiveNics: pulumi.StringArray{
				pulumi.String("vmnic0"),
			},
			StandbyNics: pulumi.StringArray{
				pulumi.String("vmnic1"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;

return await Deployment.RunAsync(() => 
{
    var datacenter = VSphere.GetDatacenter.Invoke(new()
    {
        Name = "dc-01",
    });

    var host = VSphere.GetHost.Invoke(new()
    {
        Name = "esxi-01.example.com",
        DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
    });

    var @switch = new VSphere.HostVirtualSwitch("switch", new()
    {
        Name = "vSwitchTest",
        HostSystemId = host.Apply(getHostResult => getHostResult.Id),
        NetworkAdapters = new[]
        {
            "vmnic0",
            "vmnic1",
        },
        ActiveNics = new[]
        {
            "vmnic0",
        },
        StandbyNics = new[]
        {
            "vmnic1",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetHostArgs;
import com.pulumi.vsphere.HostVirtualSwitch;
import com.pulumi.vsphere.HostVirtualSwitchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
            .name("dc-01")
            .build());

        final var host = VsphereFunctions.getHost(GetHostArgs.builder()
            .name("esxi-01.example.com")
            .datacenterId(datacenter.id())
            .build());

        var switch_ = new HostVirtualSwitch("switch", HostVirtualSwitchArgs.builder()
            .name("vSwitchTest")
            .hostSystemId(host.id())
            .networkAdapters(            
                "vmnic0",
                "vmnic1")
            .activeNics("vmnic0")
            .standbyNics("vmnic1")
            .build());

    }
}
Copy
resources:
  switch:
    type: vsphere:HostVirtualSwitch
    properties:
      name: vSwitchTest
      hostSystemId: ${host.id}
      networkAdapters:
        - vmnic0
        - vmnic1
      activeNics:
        - vmnic0
      standbyNics:
        - vmnic1
variables:
  datacenter:
    fn::invoke:
      function: vsphere:getDatacenter
      arguments:
        name: dc-01
  host:
    fn::invoke:
      function: vsphere:getHost
      arguments:
        name: esxi-01.example.com
        datacenterId: ${datacenter.id}
Copy

Create a virtual switch with extra networking policy options

import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = vsphere.getDatacenter({
    name: "dc-01",
});
const host = datacenter.then(datacenter => vsphere.getHost({
    name: "esxi-01.example.com",
    datacenterId: datacenter.id,
}));
const _switch = new vsphere.HostVirtualSwitch("switch", {
    name: "vSwitchTest",
    hostSystemId: host.then(host => host.id),
    networkAdapters: [
        "vmnic0",
        "vmnic1",
    ],
    activeNics: ["vmnic0"],
    standbyNics: ["vmnic1"],
    teamingPolicy: "failover_explicit",
    allowPromiscuous: false,
    allowForgedTransmits: false,
    allowMacChanges: false,
    shapingEnabled: true,
    shapingAverageBandwidth: 50000000,
    shapingPeakBandwidth: 100000000,
    shapingBurstSize: 1000000000,
});
Copy
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc-01")
host = vsphere.get_host(name="esxi-01.example.com",
    datacenter_id=datacenter.id)
switch = vsphere.HostVirtualSwitch("switch",
    name="vSwitchTest",
    host_system_id=host.id,
    network_adapters=[
        "vmnic0",
        "vmnic1",
    ],
    active_nics=["vmnic0"],
    standby_nics=["vmnic1"],
    teaming_policy="failover_explicit",
    allow_promiscuous=False,
    allow_forged_transmits=False,
    allow_mac_changes=False,
    shaping_enabled=True,
    shaping_average_bandwidth=50000000,
    shaping_peak_bandwidth=100000000,
    shaping_burst_size=1000000000)
Copy
package main

import (
	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
			Name: pulumi.StringRef("dc-01"),
		}, nil)
		if err != nil {
			return err
		}
		host, err := vsphere.LookupHost(ctx, &vsphere.LookupHostArgs{
			Name:         pulumi.StringRef("esxi-01.example.com"),
			DatacenterId: datacenter.Id,
		}, nil)
		if err != nil {
			return err
		}
		_, err = vsphere.NewHostVirtualSwitch(ctx, "switch", &vsphere.HostVirtualSwitchArgs{
			Name:         pulumi.String("vSwitchTest"),
			HostSystemId: pulumi.String(host.Id),
			NetworkAdapters: pulumi.StringArray{
				pulumi.String("vmnic0"),
				pulumi.String("vmnic1"),
			},
			ActiveNics: pulumi.StringArray{
				pulumi.String("vmnic0"),
			},
			StandbyNics: pulumi.StringArray{
				pulumi.String("vmnic1"),
			},
			TeamingPolicy:           pulumi.String("failover_explicit"),
			AllowPromiscuous:        pulumi.Bool(false),
			AllowForgedTransmits:    pulumi.Bool(false),
			AllowMacChanges:         pulumi.Bool(false),
			ShapingEnabled:          pulumi.Bool(true),
			ShapingAverageBandwidth: pulumi.Int(50000000),
			ShapingPeakBandwidth:    pulumi.Int(100000000),
			ShapingBurstSize:        pulumi.Int(1000000000),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;

return await Deployment.RunAsync(() => 
{
    var datacenter = VSphere.GetDatacenter.Invoke(new()
    {
        Name = "dc-01",
    });

    var host = VSphere.GetHost.Invoke(new()
    {
        Name = "esxi-01.example.com",
        DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
    });

    var @switch = new VSphere.HostVirtualSwitch("switch", new()
    {
        Name = "vSwitchTest",
        HostSystemId = host.Apply(getHostResult => getHostResult.Id),
        NetworkAdapters = new[]
        {
            "vmnic0",
            "vmnic1",
        },
        ActiveNics = new[]
        {
            "vmnic0",
        },
        StandbyNics = new[]
        {
            "vmnic1",
        },
        TeamingPolicy = "failover_explicit",
        AllowPromiscuous = false,
        AllowForgedTransmits = false,
        AllowMacChanges = false,
        ShapingEnabled = true,
        ShapingAverageBandwidth = 50000000,
        ShapingPeakBandwidth = 100000000,
        ShapingBurstSize = 1000000000,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetHostArgs;
import com.pulumi.vsphere.HostVirtualSwitch;
import com.pulumi.vsphere.HostVirtualSwitchArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
            .name("dc-01")
            .build());

        final var host = VsphereFunctions.getHost(GetHostArgs.builder()
            .name("esxi-01.example.com")
            .datacenterId(datacenter.id())
            .build());

        var switch_ = new HostVirtualSwitch("switch", HostVirtualSwitchArgs.builder()
            .name("vSwitchTest")
            .hostSystemId(host.id())
            .networkAdapters(            
                "vmnic0",
                "vmnic1")
            .activeNics("vmnic0")
            .standbyNics("vmnic1")
            .teamingPolicy("failover_explicit")
            .allowPromiscuous(false)
            .allowForgedTransmits(false)
            .allowMacChanges(false)
            .shapingEnabled(true)
            .shapingAverageBandwidth(50000000)
            .shapingPeakBandwidth(100000000)
            .shapingBurstSize(1000000000)
            .build());

    }
}
Copy
resources:
  switch:
    type: vsphere:HostVirtualSwitch
    properties:
      name: vSwitchTest
      hostSystemId: ${host.id}
      networkAdapters:
        - vmnic0
        - vmnic1
      activeNics:
        - vmnic0
      standbyNics:
        - vmnic1
      teamingPolicy: failover_explicit
      allowPromiscuous: false
      allowForgedTransmits: false
      allowMacChanges: false
      shapingEnabled: true
      shapingAverageBandwidth: 5e+07
      shapingPeakBandwidth: 1e+08
      shapingBurstSize: 1e+09
variables:
  datacenter:
    fn::invoke:
      function: vsphere:getDatacenter
      arguments:
        name: dc-01
  host:
    fn::invoke:
      function: vsphere:getHost
      arguments:
        name: esxi-01.example.com
        datacenterId: ${datacenter.id}
Copy

Create HostVirtualSwitch Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new HostVirtualSwitch(name: string, args: HostVirtualSwitchArgs, opts?: CustomResourceOptions);
@overload
def HostVirtualSwitch(resource_name: str,
                      args: HostVirtualSwitchArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def HostVirtualSwitch(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      host_system_id: Optional[str] = None,
                      network_adapters: Optional[Sequence[str]] = None,
                      active_nics: Optional[Sequence[str]] = None,
                      mtu: Optional[int] = None,
                      allow_forged_transmits: Optional[bool] = None,
                      check_beacon: Optional[bool] = None,
                      failback: Optional[bool] = None,
                      allow_promiscuous: Optional[bool] = None,
                      link_discovery_operation: Optional[str] = None,
                      link_discovery_protocol: Optional[str] = None,
                      allow_mac_changes: Optional[bool] = None,
                      name: Optional[str] = None,
                      beacon_interval: Optional[int] = None,
                      notify_switches: Optional[bool] = None,
                      number_of_ports: Optional[int] = None,
                      shaping_average_bandwidth: Optional[int] = None,
                      shaping_burst_size: Optional[int] = None,
                      shaping_enabled: Optional[bool] = None,
                      shaping_peak_bandwidth: Optional[int] = None,
                      standby_nics: Optional[Sequence[str]] = None,
                      teaming_policy: Optional[str] = None)
func NewHostVirtualSwitch(ctx *Context, name string, args HostVirtualSwitchArgs, opts ...ResourceOption) (*HostVirtualSwitch, error)
public HostVirtualSwitch(string name, HostVirtualSwitchArgs args, CustomResourceOptions? opts = null)
public HostVirtualSwitch(String name, HostVirtualSwitchArgs args)
public HostVirtualSwitch(String name, HostVirtualSwitchArgs args, CustomResourceOptions options)
type: vsphere:HostVirtualSwitch
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. HostVirtualSwitchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. HostVirtualSwitchArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. HostVirtualSwitchArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. HostVirtualSwitchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. HostVirtualSwitchArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var hostVirtualSwitchResource = new VSphere.HostVirtualSwitch("hostVirtualSwitchResource", new()
{
    HostSystemId = "string",
    NetworkAdapters = new[]
    {
        "string",
    },
    ActiveNics = new[]
    {
        "string",
    },
    Mtu = 0,
    AllowForgedTransmits = false,
    CheckBeacon = false,
    Failback = false,
    AllowPromiscuous = false,
    LinkDiscoveryOperation = "string",
    LinkDiscoveryProtocol = "string",
    AllowMacChanges = false,
    Name = "string",
    BeaconInterval = 0,
    NotifySwitches = false,
    NumberOfPorts = 0,
    ShapingAverageBandwidth = 0,
    ShapingBurstSize = 0,
    ShapingEnabled = false,
    ShapingPeakBandwidth = 0,
    StandbyNics = new[]
    {
        "string",
    },
    TeamingPolicy = "string",
});
Copy
example, err := vsphere.NewHostVirtualSwitch(ctx, "hostVirtualSwitchResource", &vsphere.HostVirtualSwitchArgs{
	HostSystemId: pulumi.String("string"),
	NetworkAdapters: pulumi.StringArray{
		pulumi.String("string"),
	},
	ActiveNics: pulumi.StringArray{
		pulumi.String("string"),
	},
	Mtu:                     pulumi.Int(0),
	AllowForgedTransmits:    pulumi.Bool(false),
	CheckBeacon:             pulumi.Bool(false),
	Failback:                pulumi.Bool(false),
	AllowPromiscuous:        pulumi.Bool(false),
	LinkDiscoveryOperation:  pulumi.String("string"),
	LinkDiscoveryProtocol:   pulumi.String("string"),
	AllowMacChanges:         pulumi.Bool(false),
	Name:                    pulumi.String("string"),
	BeaconInterval:          pulumi.Int(0),
	NotifySwitches:          pulumi.Bool(false),
	NumberOfPorts:           pulumi.Int(0),
	ShapingAverageBandwidth: pulumi.Int(0),
	ShapingBurstSize:        pulumi.Int(0),
	ShapingEnabled:          pulumi.Bool(false),
	ShapingPeakBandwidth:    pulumi.Int(0),
	StandbyNics: pulumi.StringArray{
		pulumi.String("string"),
	},
	TeamingPolicy: pulumi.String("string"),
})
Copy
var hostVirtualSwitchResource = new HostVirtualSwitch("hostVirtualSwitchResource", HostVirtualSwitchArgs.builder()
    .hostSystemId("string")
    .networkAdapters("string")
    .activeNics("string")
    .mtu(0)
    .allowForgedTransmits(false)
    .checkBeacon(false)
    .failback(false)
    .allowPromiscuous(false)
    .linkDiscoveryOperation("string")
    .linkDiscoveryProtocol("string")
    .allowMacChanges(false)
    .name("string")
    .beaconInterval(0)
    .notifySwitches(false)
    .numberOfPorts(0)
    .shapingAverageBandwidth(0)
    .shapingBurstSize(0)
    .shapingEnabled(false)
    .shapingPeakBandwidth(0)
    .standbyNics("string")
    .teamingPolicy("string")
    .build());
Copy
host_virtual_switch_resource = vsphere.HostVirtualSwitch("hostVirtualSwitchResource",
    host_system_id="string",
    network_adapters=["string"],
    active_nics=["string"],
    mtu=0,
    allow_forged_transmits=False,
    check_beacon=False,
    failback=False,
    allow_promiscuous=False,
    link_discovery_operation="string",
    link_discovery_protocol="string",
    allow_mac_changes=False,
    name="string",
    beacon_interval=0,
    notify_switches=False,
    number_of_ports=0,
    shaping_average_bandwidth=0,
    shaping_burst_size=0,
    shaping_enabled=False,
    shaping_peak_bandwidth=0,
    standby_nics=["string"],
    teaming_policy="string")
Copy
const hostVirtualSwitchResource = new vsphere.HostVirtualSwitch("hostVirtualSwitchResource", {
    hostSystemId: "string",
    networkAdapters: ["string"],
    activeNics: ["string"],
    mtu: 0,
    allowForgedTransmits: false,
    checkBeacon: false,
    failback: false,
    allowPromiscuous: false,
    linkDiscoveryOperation: "string",
    linkDiscoveryProtocol: "string",
    allowMacChanges: false,
    name: "string",
    beaconInterval: 0,
    notifySwitches: false,
    numberOfPorts: 0,
    shapingAverageBandwidth: 0,
    shapingBurstSize: 0,
    shapingEnabled: false,
    shapingPeakBandwidth: 0,
    standbyNics: ["string"],
    teamingPolicy: "string",
});
Copy
type: vsphere:HostVirtualSwitch
properties:
    activeNics:
        - string
    allowForgedTransmits: false
    allowMacChanges: false
    allowPromiscuous: false
    beaconInterval: 0
    checkBeacon: false
    failback: false
    hostSystemId: string
    linkDiscoveryOperation: string
    linkDiscoveryProtocol: string
    mtu: 0
    name: string
    networkAdapters:
        - string
    notifySwitches: false
    numberOfPorts: 0
    shapingAverageBandwidth: 0
    shapingBurstSize: 0
    shapingEnabled: false
    shapingPeakBandwidth: 0
    standbyNics:
        - string
    teamingPolicy: string
Copy

HostVirtualSwitch Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The HostVirtualSwitch resource accepts the following input properties:

ActiveNics This property is required. List<string>
List of active network adapters used for load balancing.
HostSystemId
This property is required.
Changes to this property will trigger replacement.
string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
NetworkAdapters This property is required. List<string>
The list of network adapters to bind to this virtual switch.
AllowForgedTransmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
AllowMacChanges bool
Controls whether or not the Media Access Control (MAC) address can be changed.
AllowPromiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
BeaconInterval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
CheckBeacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
Failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
LinkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
LinkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
Mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
Name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
NotifySwitches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
NumberOfPorts int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

ShapingAverageBandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
ShapingBurstSize int
The maximum burst size allowed in bytes if traffic shaping is enabled.
ShapingEnabled bool
Enable traffic shaping on this virtual switch or port group.
ShapingPeakBandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
StandbyNics List<string>
List of standby network adapters used for failover.
TeamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
ActiveNics This property is required. []string
List of active network adapters used for load balancing.
HostSystemId
This property is required.
Changes to this property will trigger replacement.
string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
NetworkAdapters This property is required. []string
The list of network adapters to bind to this virtual switch.
AllowForgedTransmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
AllowMacChanges bool
Controls whether or not the Media Access Control (MAC) address can be changed.
AllowPromiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
BeaconInterval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
CheckBeacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
Failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
LinkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
LinkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
Mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
Name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
NotifySwitches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
NumberOfPorts int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

ShapingAverageBandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
ShapingBurstSize int
The maximum burst size allowed in bytes if traffic shaping is enabled.
ShapingEnabled bool
Enable traffic shaping on this virtual switch or port group.
ShapingPeakBandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
StandbyNics []string
List of standby network adapters used for failover.
TeamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics This property is required. List<String>
List of active network adapters used for load balancing.
hostSystemId
This property is required.
Changes to this property will trigger replacement.
String
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
networkAdapters This property is required. List<String>
The list of network adapters to bind to this virtual switch.
allowForgedTransmits Boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges Boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous Boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval Integer
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon Boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback Boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
linkDiscoveryOperation String
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol String
The discovery protocol type. Valid values are cdp and lldp.
mtu Integer
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. String
The name of the virtual switch. Forces a new resource if changed.
notifySwitches Boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts Integer

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth Integer
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize Integer
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled Boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth Integer
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics List<String>
List of standby network adapters used for failover.
teamingPolicy String
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics This property is required. string[]
List of active network adapters used for load balancing.
hostSystemId
This property is required.
Changes to this property will trigger replacement.
string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
networkAdapters This property is required. string[]
The list of network adapters to bind to this virtual switch.
allowForgedTransmits boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval number
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
linkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
mtu number
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
notifySwitches boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts number

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth number
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize number
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth number
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics string[]
List of standby network adapters used for failover.
teamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
active_nics This property is required. Sequence[str]
List of active network adapters used for load balancing.
host_system_id
This property is required.
Changes to this property will trigger replacement.
str
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
network_adapters This property is required. Sequence[str]
The list of network adapters to bind to this virtual switch.
allow_forged_transmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allow_mac_changes bool
Controls whether or not the Media Access Control (MAC) address can be changed.
allow_promiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beacon_interval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
check_beacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
link_discovery_operation str
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
link_discovery_protocol str
The discovery protocol type. Valid values are cdp and lldp.
mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. str
The name of the virtual switch. Forces a new resource if changed.
notify_switches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
number_of_ports int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shaping_average_bandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
shaping_burst_size int
The maximum burst size allowed in bytes if traffic shaping is enabled.
shaping_enabled bool
Enable traffic shaping on this virtual switch or port group.
shaping_peak_bandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standby_nics Sequence[str]
List of standby network adapters used for failover.
teaming_policy str
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics This property is required. List<String>
List of active network adapters used for load balancing.
hostSystemId
This property is required.
Changes to this property will trigger replacement.
String
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
networkAdapters This property is required. List<String>
The list of network adapters to bind to this virtual switch.
allowForgedTransmits Boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges Boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous Boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval Number
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon Boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback Boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
linkDiscoveryOperation String
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol String
The discovery protocol type. Valid values are cdp and lldp.
mtu Number
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. String
The name of the virtual switch. Forces a new resource if changed.
notifySwitches Boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts Number

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth Number
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize Number
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled Boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth Number
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics List<String>
List of standby network adapters used for failover.
teamingPolicy String
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.

Outputs

All input properties are implicitly available as output properties. Additionally, the HostVirtualSwitch resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing HostVirtualSwitch Resource

Get an existing HostVirtualSwitch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: HostVirtualSwitchState, opts?: CustomResourceOptions): HostVirtualSwitch
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        active_nics: Optional[Sequence[str]] = None,
        allow_forged_transmits: Optional[bool] = None,
        allow_mac_changes: Optional[bool] = None,
        allow_promiscuous: Optional[bool] = None,
        beacon_interval: Optional[int] = None,
        check_beacon: Optional[bool] = None,
        failback: Optional[bool] = None,
        host_system_id: Optional[str] = None,
        link_discovery_operation: Optional[str] = None,
        link_discovery_protocol: Optional[str] = None,
        mtu: Optional[int] = None,
        name: Optional[str] = None,
        network_adapters: Optional[Sequence[str]] = None,
        notify_switches: Optional[bool] = None,
        number_of_ports: Optional[int] = None,
        shaping_average_bandwidth: Optional[int] = None,
        shaping_burst_size: Optional[int] = None,
        shaping_enabled: Optional[bool] = None,
        shaping_peak_bandwidth: Optional[int] = None,
        standby_nics: Optional[Sequence[str]] = None,
        teaming_policy: Optional[str] = None) -> HostVirtualSwitch
func GetHostVirtualSwitch(ctx *Context, name string, id IDInput, state *HostVirtualSwitchState, opts ...ResourceOption) (*HostVirtualSwitch, error)
public static HostVirtualSwitch Get(string name, Input<string> id, HostVirtualSwitchState? state, CustomResourceOptions? opts = null)
public static HostVirtualSwitch get(String name, Output<String> id, HostVirtualSwitchState state, CustomResourceOptions options)
resources:  _:    type: vsphere:HostVirtualSwitch    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ActiveNics List<string>
List of active network adapters used for load balancing.
AllowForgedTransmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
AllowMacChanges bool
Controls whether or not the Media Access Control (MAC) address can be changed.
AllowPromiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
BeaconInterval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
CheckBeacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
Failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
HostSystemId Changes to this property will trigger replacement. string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
LinkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
LinkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
Mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
Name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
NetworkAdapters List<string>
The list of network adapters to bind to this virtual switch.
NotifySwitches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
NumberOfPorts int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

ShapingAverageBandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
ShapingBurstSize int
The maximum burst size allowed in bytes if traffic shaping is enabled.
ShapingEnabled bool
Enable traffic shaping on this virtual switch or port group.
ShapingPeakBandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
StandbyNics List<string>
List of standby network adapters used for failover.
TeamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
ActiveNics []string
List of active network adapters used for load balancing.
AllowForgedTransmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
AllowMacChanges bool
Controls whether or not the Media Access Control (MAC) address can be changed.
AllowPromiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
BeaconInterval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
CheckBeacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
Failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
HostSystemId Changes to this property will trigger replacement. string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
LinkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
LinkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
Mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
Name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
NetworkAdapters []string
The list of network adapters to bind to this virtual switch.
NotifySwitches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
NumberOfPorts int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

ShapingAverageBandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
ShapingBurstSize int
The maximum burst size allowed in bytes if traffic shaping is enabled.
ShapingEnabled bool
Enable traffic shaping on this virtual switch or port group.
ShapingPeakBandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
StandbyNics []string
List of standby network adapters used for failover.
TeamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics List<String>
List of active network adapters used for load balancing.
allowForgedTransmits Boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges Boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous Boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval Integer
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon Boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback Boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
hostSystemId Changes to this property will trigger replacement. String
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
linkDiscoveryOperation String
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol String
The discovery protocol type. Valid values are cdp and lldp.
mtu Integer
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. String
The name of the virtual switch. Forces a new resource if changed.
networkAdapters List<String>
The list of network adapters to bind to this virtual switch.
notifySwitches Boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts Integer

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth Integer
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize Integer
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled Boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth Integer
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics List<String>
List of standby network adapters used for failover.
teamingPolicy String
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics string[]
List of active network adapters used for load balancing.
allowForgedTransmits boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval number
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
hostSystemId Changes to this property will trigger replacement. string
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
linkDiscoveryOperation string
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol string
The discovery protocol type. Valid values are cdp and lldp.
mtu number
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. string
The name of the virtual switch. Forces a new resource if changed.
networkAdapters string[]
The list of network adapters to bind to this virtual switch.
notifySwitches boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts number

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth number
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize number
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth number
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics string[]
List of standby network adapters used for failover.
teamingPolicy string
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
active_nics Sequence[str]
List of active network adapters used for load balancing.
allow_forged_transmits bool
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allow_mac_changes bool
Controls whether or not the Media Access Control (MAC) address can be changed.
allow_promiscuous bool
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beacon_interval int
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
check_beacon bool
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback bool
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
host_system_id Changes to this property will trigger replacement. str
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
link_discovery_operation str
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
link_discovery_protocol str
The discovery protocol type. Valid values are cdp and lldp.
mtu int
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. str
The name of the virtual switch. Forces a new resource if changed.
network_adapters Sequence[str]
The list of network adapters to bind to this virtual switch.
notify_switches bool
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
number_of_ports int

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shaping_average_bandwidth int
The average bandwidth in bits per second if traffic shaping is enabled.
shaping_burst_size int
The maximum burst size allowed in bytes if traffic shaping is enabled.
shaping_enabled bool
Enable traffic shaping on this virtual switch or port group.
shaping_peak_bandwidth int
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standby_nics Sequence[str]
List of standby network adapters used for failover.
teaming_policy str
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.
activeNics List<String>
List of active network adapters used for load balancing.
allowForgedTransmits Boolean
Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than that of its own.
allowMacChanges Boolean
Controls whether or not the Media Access Control (MAC) address can be changed.
allowPromiscuous Boolean
Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port.
beaconInterval Number
Determines how often, in seconds, a beacon should be sent to probe for the validity of a link.
checkBeacon Boolean
Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used only.
failback Boolean
If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up.
hostSystemId Changes to this property will trigger replacement. String
The managed object ID of the host to set the virtual switch up on. Forces a new resource if changed.
linkDiscoveryOperation String
Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none.
linkDiscoveryProtocol String
The discovery protocol type. Valid values are cdp and lldp.
mtu Number
The maximum transmission unit (MTU) for the virtual switch. Default: 1500.
name Changes to this property will trigger replacement. String
The name of the virtual switch. Forces a new resource if changed.
networkAdapters List<String>
The list of network adapters to bind to this virtual switch.
notifySwitches Boolean
If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates.
numberOfPorts Number

The number of ports to create with this virtual switch. Default: 128.

NOTE: Changing the port count requires a reboot of the host. This provider will not restart the host for you.

shapingAverageBandwidth Number
The average bandwidth in bits per second if traffic shaping is enabled.
shapingBurstSize Number
The maximum burst size allowed in bytes if traffic shaping is enabled.
shapingEnabled Boolean
Enable traffic shaping on this virtual switch or port group.
shapingPeakBandwidth Number
The peak bandwidth during bursts in bits per second if traffic shaping is enabled.
standbyNics List<String>
List of standby network adapters used for failover.
teamingPolicy String
The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or failover_explicit.

Import

An existing vSwitch can be imported into this resource by its ID.

The convention of the id is a prefix, the host system managed objectID, and the virtual switch

name. An example would be tf-HostVirtualSwitch:host-10:vSwitchTerraformTest.

Import can the be done via the following command:

$ pulumi import vsphere:index/hostVirtualSwitch:HostVirtualSwitch switch tf-HostVirtualSwitch:host-10:vSwitchTerraformTest
Copy

The above would import the vSwitch named vSwitchTerraformTest that is located in the host-10

vSphere host.

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
vSphere pulumi/pulumi-vsphere
License
Apache-2.0
Notes
This Pulumi package is based on the vsphere Terraform Provider.