import * as pulumi from "@pulumi/pulumi"; /** * 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][ref-vsphere-net-concepts]. * * [ref-vsphere-net-concepts]: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-networking-8-0/introduction-to-vsphere-networking.html * * ## Example Usage * * ### Create a virtual switch with one active and one standby NIC * * ```typescript * 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"], * }); * ``` * * ### Create a virtual switch with extra networking policy options * * ```typescript * 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, * }); * ``` * * ## 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][docs-about-morefs], and the virtual switch * * name. An example would be `tf-HostVirtualSwitch:host-10:vSwitchTerraformTest`. * * Import can the be done via the following command: * * [docs-import]: https://developer.hashicorp.com/terraform/cli/import * * [docs-about-morefs]: /docs/providers/vsphere/index.html#use-of-managed-object-references-by-the-vsphere-provider * * ```sh * $ pulumi import vsphere:index/hostVirtualSwitch:HostVirtualSwitch switch tf-HostVirtualSwitch:host-10:vSwitchTerraformTest * ``` * * The above would import the vSwitch named `vSwitchTerraformTest` that is located in the `host-10` * * vSphere host. */ export declare class HostVirtualSwitch extends pulumi.CustomResource { /** * Get an existing HostVirtualSwitch resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: HostVirtualSwitchState, opts?: pulumi.CustomResourceOptions): HostVirtualSwitch; /** * Returns true if the given object is an instance of HostVirtualSwitch. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is HostVirtualSwitch; /** * List of active network adapters used for load balancing. */ readonly activeNics: pulumi.Output; /** * Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than * that of its own. */ readonly allowForgedTransmits: pulumi.Output; /** * Controls whether or not the Media Access Control (MAC) address can be changed. */ readonly allowMacChanges: pulumi.Output; /** * Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port. */ readonly allowPromiscuous: pulumi.Output; /** * Determines how often, in seconds, a beacon should be sent to probe for the validity of a link. */ readonly beaconInterval: pulumi.Output; /** * Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used * only. */ readonly checkBeacon: pulumi.Output; /** * If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up. */ readonly failback: pulumi.Output; /** * The managed object ID of * the host to set the virtual switch up on. Forces a new resource if changed. */ readonly hostSystemId: pulumi.Output; /** * Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none. */ readonly linkDiscoveryOperation: pulumi.Output; /** * The discovery protocol type. Valid values are cdp and lldp. */ readonly linkDiscoveryProtocol: pulumi.Output; /** * The maximum transmission unit (MTU) for the virtual * switch. Default: `1500`. */ readonly mtu: pulumi.Output; /** * The name of the virtual switch. Forces a new resource if * changed. */ readonly name: pulumi.Output; /** * The list of network adapters to bind to this virtual switch. */ readonly networkAdapters: pulumi.Output; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ readonly notifySwitches: pulumi.Output; /** * 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. */ readonly numberOfPorts: pulumi.Output; /** * The average bandwidth in bits per second if traffic shaping is enabled. */ readonly shapingAverageBandwidth: pulumi.Output; /** * The maximum burst size allowed in bytes if traffic shaping is enabled. */ readonly shapingBurstSize: pulumi.Output; /** * Enable traffic shaping on this virtual switch or port group. */ readonly shapingEnabled: pulumi.Output; /** * The peak bandwidth during bursts in bits per second if traffic shaping is enabled. */ readonly shapingPeakBandwidth: pulumi.Output; /** * List of standby network adapters used for failover. */ readonly standbyNics: pulumi.Output; /** * The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or * failover_explicit. */ readonly teamingPolicy: pulumi.Output; /** * Create a HostVirtualSwitch resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HostVirtualSwitchArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HostVirtualSwitch resources. */ export interface HostVirtualSwitchState { /** * List of active network adapters used for load balancing. */ activeNics?: pulumi.Input[]>; /** * Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than * that of its own. */ allowForgedTransmits?: pulumi.Input; /** * Controls whether or not the Media Access Control (MAC) address can be changed. */ allowMacChanges?: pulumi.Input; /** * Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port. */ allowPromiscuous?: pulumi.Input; /** * Determines how often, in seconds, a beacon should be sent to probe for the validity of a link. */ beaconInterval?: pulumi.Input; /** * Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used * only. */ checkBeacon?: pulumi.Input; /** * If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up. */ failback?: pulumi.Input; /** * The managed object ID of * the host to set the virtual switch up on. Forces a new resource if changed. */ hostSystemId?: pulumi.Input; /** * Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none. */ linkDiscoveryOperation?: pulumi.Input; /** * The discovery protocol type. Valid values are cdp and lldp. */ linkDiscoveryProtocol?: pulumi.Input; /** * The maximum transmission unit (MTU) for the virtual * switch. Default: `1500`. */ mtu?: pulumi.Input; /** * The name of the virtual switch. Forces a new resource if * changed. */ name?: pulumi.Input; /** * The list of network adapters to bind to this virtual switch. */ networkAdapters?: pulumi.Input[]>; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ notifySwitches?: pulumi.Input; /** * 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. */ numberOfPorts?: pulumi.Input; /** * The average bandwidth in bits per second if traffic shaping is enabled. */ shapingAverageBandwidth?: pulumi.Input; /** * The maximum burst size allowed in bytes if traffic shaping is enabled. */ shapingBurstSize?: pulumi.Input; /** * Enable traffic shaping on this virtual switch or port group. */ shapingEnabled?: pulumi.Input; /** * The peak bandwidth during bursts in bits per second if traffic shaping is enabled. */ shapingPeakBandwidth?: pulumi.Input; /** * List of standby network adapters used for failover. */ standbyNics?: pulumi.Input[]>; /** * The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or * failover_explicit. */ teamingPolicy?: pulumi.Input; } /** * The set of arguments for constructing a HostVirtualSwitch resource. */ export interface HostVirtualSwitchArgs { /** * List of active network adapters used for load balancing. */ activeNics: pulumi.Input[]>; /** * Controls whether or not the virtual network adapter is allowed to send network traffic with a different MAC address than * that of its own. */ allowForgedTransmits?: pulumi.Input; /** * Controls whether or not the Media Access Control (MAC) address can be changed. */ allowMacChanges?: pulumi.Input; /** * Enable promiscuous mode on the network. This flag indicates whether or not all traffic is seen on a given port. */ allowPromiscuous?: pulumi.Input; /** * Determines how often, in seconds, a beacon should be sent to probe for the validity of a link. */ beaconInterval?: pulumi.Input; /** * Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used * only. */ checkBeacon?: pulumi.Input; /** * If true, the teaming policy will re-activate failed interfaces higher in precedence when they come back up. */ failback?: pulumi.Input; /** * The managed object ID of * the host to set the virtual switch up on. Forces a new resource if changed. */ hostSystemId: pulumi.Input; /** * Whether to advertise or listen for link discovery. Valid values are advertise, both, listen, and none. */ linkDiscoveryOperation?: pulumi.Input; /** * The discovery protocol type. Valid values are cdp and lldp. */ linkDiscoveryProtocol?: pulumi.Input; /** * The maximum transmission unit (MTU) for the virtual * switch. Default: `1500`. */ mtu?: pulumi.Input; /** * The name of the virtual switch. Forces a new resource if * changed. */ name?: pulumi.Input; /** * The list of network adapters to bind to this virtual switch. */ networkAdapters: pulumi.Input[]>; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ notifySwitches?: pulumi.Input; /** * 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. */ numberOfPorts?: pulumi.Input; /** * The average bandwidth in bits per second if traffic shaping is enabled. */ shapingAverageBandwidth?: pulumi.Input; /** * The maximum burst size allowed in bytes if traffic shaping is enabled. */ shapingBurstSize?: pulumi.Input; /** * Enable traffic shaping on this virtual switch or port group. */ shapingEnabled?: pulumi.Input; /** * The peak bandwidth during bursts in bits per second if traffic shaping is enabled. */ shapingPeakBandwidth?: pulumi.Input; /** * List of standby network adapters used for failover. */ standbyNics?: pulumi.Input[]>; /** * The network adapter teaming policy. Can be one of loadbalance_ip, loadbalance_srcmac, loadbalance_srcid, or * failover_explicit. */ teamingPolicy?: pulumi.Input; }