import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * The `vsphere.HostPortGroup` resource can be used to manage port groups on * ESXi hosts. These port groups are connected to standard switches, which * can be managed by the `vsphere.HostVirtualSwitch` * resource. * * For an overview on vSphere networking concepts, see [the product documentation][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 and Bind a Port Group:** * * ```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 hostVirtualSwitch = new vsphere.HostVirtualSwitch("host_virtual_switch", { * name: "switch-01", * hostSystemId: host.then(host => host.id), * networkAdapters: [ * "vmnic0", * "vmnic1", * ], * activeNics: ["vmnic0"], * standbyNics: ["vmnic1"], * }); * const pg = new vsphere.HostPortGroup("pg", { * name: "portgroup-01", * hostSystemId: host.then(host => host.id), * virtualSwitchName: hostVirtualSwitch.name, * }); * ``` * * **Create a Port Group with a VLAN and ab Override:** * * This example sets the trunk mode VLAN (`4095`, which passes through all tags) * and sets * `allowPromiscuous` * to ensure that all traffic is seen on the port. The setting overrides * the implicit default of `false` set on the standard switch. * * ```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 hostVirtualSwitch = new vsphere.HostVirtualSwitch("host_virtual_switch", { * name: "switch-01", * hostSystemId: host.then(host => host.id), * networkAdapters: [ * "vmnic0", * "vmnic1", * ], * activeNics: ["vmnic0"], * standbyNics: ["vmnic1"], * }); * const pg = new vsphere.HostPortGroup("pg", { * name: "portgroup-01", * hostSystemId: host.then(host => host.id), * virtualSwitchName: hostVirtualSwitch.name, * vlanId: 4095, * allowPromiscuous: true, * }); * ``` * * ## Import * * An existing host port group can be imported into this resource * * using the host port group's ID. An example is below: * * ```sh * $ pulumi import vsphere:index/hostPortGroup:HostPortGroup management tf-HostPortGroup:host-123:management * ``` * * The above would import the `management` host port group from host with ID `host-123`. */ export declare class HostPortGroup extends pulumi.CustomResource { /** * Get an existing HostPortGroup 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?: HostPortGroupState, opts?: pulumi.CustomResourceOptions): HostPortGroup; /** * Returns true if the given object is an instance of HostPortGroup. 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 HostPortGroup; /** * 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; /** * 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; /** * A map with a full set of the policy * options computed from defaults and overrides, * explaining the effective policy for this port group. */ readonly computedPolicy: pulumi.Output<{ [key: string]: string; }>; /** * 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 port group up on. Forces a new resource if changed. */ readonly hostSystemId: pulumi.Output; /** * The key for this port group as returned from the vSphere API. */ readonly key: pulumi.Output; /** * The name of the port group. Forces a new resource if * changed. */ readonly name: pulumi.Output; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ readonly notifySwitches: pulumi.Output; /** * A list of ports that currently exist and are used on this port group. */ readonly ports: 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; /** * The name of the virtual switch to bind * this port group to. Forces a new resource if changed. */ readonly virtualSwitchName: pulumi.Output; /** * The VLAN ID/trunk mode for this port group. An ID of * `0` denotes no tagging, an ID of `1`-`4094` tags with the specific ID, and an * ID of `4095` enables trunk mode, allowing the guest to manage its own * tagging. Default: `0`. */ readonly vlanId: pulumi.Output; /** * Create a HostPortGroup 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: HostPortGroupArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HostPortGroup resources. */ export interface HostPortGroupState { /** * 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; /** * Enable beacon probing. Requires that the vSwitch has been configured to use a beacon. If disabled, link status is used * only. */ checkBeacon?: pulumi.Input; /** * A map with a full set of the policy * options computed from defaults and overrides, * explaining the effective policy for this port group. */ computedPolicy?: pulumi.Input<{ [key: string]: 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 port group up on. Forces a new resource if changed. */ hostSystemId?: pulumi.Input; /** * The key for this port group as returned from the vSphere API. */ key?: pulumi.Input; /** * The name of the port group. Forces a new resource if * changed. */ name?: pulumi.Input; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ notifySwitches?: pulumi.Input; /** * A list of ports that currently exist and are used on this port group. */ ports?: 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 name of the virtual switch to bind * this port group to. Forces a new resource if changed. */ virtualSwitchName?: pulumi.Input; /** * The VLAN ID/trunk mode for this port group. An ID of * `0` denotes no tagging, an ID of `1`-`4094` tags with the specific ID, and an * ID of `4095` enables trunk mode, allowing the guest to manage its own * tagging. Default: `0`. */ vlanId?: pulumi.Input; } /** * The set of arguments for constructing a HostPortGroup resource. */ export interface HostPortGroupArgs { /** * 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; /** * 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 port group up on. Forces a new resource if changed. */ hostSystemId: pulumi.Input; /** * The name of the port group. Forces a new resource if * changed. */ name?: pulumi.Input; /** * If true, the teaming policy will notify the broadcast network of a NIC failover, triggering cache updates. */ notifySwitches?: 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 name of the virtual switch to bind * this port group to. Forces a new resource if changed. */ virtualSwitchName: pulumi.Input; /** * The VLAN ID/trunk mode for this port group. An ID of * `0` denotes no tagging, an ID of `1`-`4094` tags with the specific ID, and an * ID of `4095` enables trunk mode, allowing the guest to manage its own * tagging. Default: `0`. */ vlanId?: pulumi.Input; }