1. Packages
  2. Xen Orchestra
  3. API Docs
  4. BondedNetwork
xenorchestra v1.5.0 published on Friday, Mar 7, 2025 by Vates

xenorchestra.BondedNetwork

Explore with Pulumi AI

xenorchestra logo
xenorchestra v1.5.0 published on Friday, Mar 7, 2025 by Vates
    Deprecated: xenorchestra.index/bondednetwork.BondedNetwork has been deprecated in favor of xenorchestra.index/xoabondednetwork.XoaBondedNetwork

    A resource for managing Bonded Xen Orchestra networks. See the XCP-ng networking docs for more details.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as xenorchestra from "@pulumi/xenorchestra";
    import * as xenorchestra from "@vates/pulumi-xenorchestra";
    
    const host1 = xenorchestra.getXoaHost({
        nameLabel: "Your host",
    });
    const eth1 = host1.then(host1 => xenorchestra.getXoaPif({
        device: "eth1",
        vlan: -1,
        hostId: host1.id,
    }));
    const eth2 = host1.then(host1 => xenorchestra.getXoaPif({
        device: "eth2",
        vlan: -1,
        hostId: host1.id,
    }));
    // Create a bonded network from normal PIFs
    const network = new xenorchestra.XoaBondedNetwork("network", {
        nameLabel: "new network name",
        bondMode: "active-backup",
        poolId: host1.then(host1 => host1.poolId),
        pifIds: [
            eth1.then(eth1 => eth1.id),
            eth2.then(eth2 => eth2.id),
        ],
    });
    // Create a bonded network from PIFs on VLANs
    const eth1Vlan = host1.then(host1 => xenorchestra.getXoaPif({
        device: "eth1",
        vlan: 15,
        hostId: host1.id,
    }));
    const eth2Vlan = host1.then(host1 => xenorchestra.getXoaPif({
        device: "eth2",
        vlan: 15,
        hostId: host1.id,
    }));
    // Create a bonded network from normal PIFs
    const networkVlan = new xenorchestra.XoaBondedNetwork("network_vlan", {
        nameLabel: "new network name",
        bondMode: "active-backup",
        poolId: host1.then(host1 => host1.poolId),
        pifIds: [
            eth1Vlan.then(eth1Vlan => eth1Vlan.id),
            eth2Vlan.then(eth2Vlan => eth2Vlan.id),
        ],
    });
    
    import pulumi
    import pulumi_xenorchestra as xenorchestra
    
    host1 = xenorchestra.get_xoa_host(name_label="Your host")
    eth1 = xenorchestra.get_xoa_pif(device="eth1",
        vlan=-1,
        host_id=host1.id)
    eth2 = xenorchestra.get_xoa_pif(device="eth2",
        vlan=-1,
        host_id=host1.id)
    # Create a bonded network from normal PIFs
    network = xenorchestra.XoaBondedNetwork("network",
        name_label="new network name",
        bond_mode="active-backup",
        pool_id=host1.pool_id,
        pif_ids=[
            eth1.id,
            eth2.id,
        ])
    # Create a bonded network from PIFs on VLANs
    eth1_vlan = xenorchestra.get_xoa_pif(device="eth1",
        vlan=15,
        host_id=host1.id)
    eth2_vlan = xenorchestra.get_xoa_pif(device="eth2",
        vlan=15,
        host_id=host1.id)
    # Create a bonded network from normal PIFs
    network_vlan = xenorchestra.XoaBondedNetwork("network_vlan",
        name_label="new network name",
        bond_mode="active-backup",
        pool_id=host1.pool_id,
        pif_ids=[
            eth1_vlan.id,
            eth2_vlan.id,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/vatesfr/pulumi-xenorchestra/sdk/go/xenorchestra"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		host1, err := xenorchestra.GetXoaHost(ctx, &xenorchestra.GetXoaHostArgs{
    			NameLabel: "Your host",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		eth1, err := xenorchestra.GetXoaPif(ctx, &xenorchestra.GetXoaPifArgs{
    			Device: "eth1",
    			Vlan:   -1,
    			HostId: pulumi.StringRef(host1.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		eth2, err := xenorchestra.GetXoaPif(ctx, &xenorchestra.GetXoaPifArgs{
    			Device: "eth2",
    			Vlan:   -1,
    			HostId: pulumi.StringRef(host1.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create a bonded network from normal PIFs
    		_, err = xenorchestra.NewXoaBondedNetwork(ctx, "network", &xenorchestra.XoaBondedNetworkArgs{
    			NameLabel: pulumi.String("new network name"),
    			BondMode:  pulumi.String("active-backup"),
    			PoolId:    pulumi.String(host1.PoolId),
    			PifIds: pulumi.StringArray{
    				pulumi.String(eth1.Id),
    				pulumi.String(eth2.Id),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Create a bonded network from PIFs on VLANs
    		eth1Vlan, err := xenorchestra.GetXoaPif(ctx, &xenorchestra.GetXoaPifArgs{
    			Device: "eth1",
    			Vlan:   15,
    			HostId: pulumi.StringRef(host1.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		eth2Vlan, err := xenorchestra.GetXoaPif(ctx, &xenorchestra.GetXoaPifArgs{
    			Device: "eth2",
    			Vlan:   15,
    			HostId: pulumi.StringRef(host1.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create a bonded network from normal PIFs
    		_, err = xenorchestra.NewXoaBondedNetwork(ctx, "network_vlan", &xenorchestra.XoaBondedNetworkArgs{
    			NameLabel: pulumi.String("new network name"),
    			BondMode:  pulumi.String("active-backup"),
    			PoolId:    pulumi.String(host1.PoolId),
    			PifIds: pulumi.StringArray{
    				pulumi.String(eth1Vlan.Id),
    				pulumi.String(eth2Vlan.Id),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Xenorchestra = Pulumi.Xenorchestra;
    
    return await Deployment.RunAsync(() => 
    {
        var host1 = Xenorchestra.GetXoaHost.Invoke(new()
        {
            NameLabel = "Your host",
        });
    
        var eth1 = Xenorchestra.GetXoaPif.Invoke(new()
        {
            Device = "eth1",
            Vlan = -1,
            HostId = host1.Apply(getXoaHostResult => getXoaHostResult.Id),
        });
    
        var eth2 = Xenorchestra.GetXoaPif.Invoke(new()
        {
            Device = "eth2",
            Vlan = -1,
            HostId = host1.Apply(getXoaHostResult => getXoaHostResult.Id),
        });
    
        // Create a bonded network from normal PIFs
        var network = new Xenorchestra.XoaBondedNetwork("network", new()
        {
            NameLabel = "new network name",
            BondMode = "active-backup",
            PoolId = host1.Apply(getXoaHostResult => getXoaHostResult.PoolId),
            PifIds = new[]
            {
                eth1.Apply(getXoaPifResult => getXoaPifResult.Id),
                eth2.Apply(getXoaPifResult => getXoaPifResult.Id),
            },
        });
    
        // Create a bonded network from PIFs on VLANs
        var eth1Vlan = Xenorchestra.GetXoaPif.Invoke(new()
        {
            Device = "eth1",
            Vlan = 15,
            HostId = host1.Apply(getXoaHostResult => getXoaHostResult.Id),
        });
    
        var eth2Vlan = Xenorchestra.GetXoaPif.Invoke(new()
        {
            Device = "eth2",
            Vlan = 15,
            HostId = host1.Apply(getXoaHostResult => getXoaHostResult.Id),
        });
    
        // Create a bonded network from normal PIFs
        var networkVlan = new Xenorchestra.XoaBondedNetwork("network_vlan", new()
        {
            NameLabel = "new network name",
            BondMode = "active-backup",
            PoolId = host1.Apply(getXoaHostResult => getXoaHostResult.PoolId),
            PifIds = new[]
            {
                eth1Vlan.Apply(getXoaPifResult => getXoaPifResult.Id),
                eth2Vlan.Apply(getXoaPifResult => getXoaPifResult.Id),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.xenorchestra.XenorchestraFunctions;
    import com.pulumi.xenorchestra.inputs.GetXoaHostArgs;
    import com.pulumi.xenorchestra.inputs.GetXoaPifArgs;
    import com.pulumi.xenorchestra.XoaBondedNetwork;
    import com.pulumi.xenorchestra.XoaBondedNetworkArgs;
    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 host1 = XenorchestraFunctions.getXoaHost(GetXoaHostArgs.builder()
                .nameLabel("Your host")
                .build());
    
            final var eth1 = XenorchestraFunctions.getXoaPif(GetXoaPifArgs.builder()
                .device("eth1")
                .vlan(-1)
                .hostId(host1.applyValue(getXoaHostResult -> getXoaHostResult.id()))
                .build());
    
            final var eth2 = XenorchestraFunctions.getXoaPif(GetXoaPifArgs.builder()
                .device("eth2")
                .vlan(-1)
                .hostId(host1.applyValue(getXoaHostResult -> getXoaHostResult.id()))
                .build());
    
            // Create a bonded network from normal PIFs
            var network = new XoaBondedNetwork("network", XoaBondedNetworkArgs.builder()
                .nameLabel("new network name")
                .bondMode("active-backup")
                .poolId(host1.applyValue(getXoaHostResult -> getXoaHostResult.poolId()))
                .pifIds(            
                    eth1.applyValue(getXoaPifResult -> getXoaPifResult.id()),
                    eth2.applyValue(getXoaPifResult -> getXoaPifResult.id()))
                .build());
    
            // Create a bonded network from PIFs on VLANs
            final var eth1Vlan = XenorchestraFunctions.getXoaPif(GetXoaPifArgs.builder()
                .device("eth1")
                .vlan(15)
                .hostId(host1.applyValue(getXoaHostResult -> getXoaHostResult.id()))
                .build());
    
            final var eth2Vlan = XenorchestraFunctions.getXoaPif(GetXoaPifArgs.builder()
                .device("eth2")
                .vlan(15)
                .hostId(host1.applyValue(getXoaHostResult -> getXoaHostResult.id()))
                .build());
    
            // Create a bonded network from normal PIFs
            var networkVlan = new XoaBondedNetwork("networkVlan", XoaBondedNetworkArgs.builder()
                .nameLabel("new network name")
                .bondMode("active-backup")
                .poolId(host1.applyValue(getXoaHostResult -> getXoaHostResult.poolId()))
                .pifIds(            
                    eth1Vlan.applyValue(getXoaPifResult -> getXoaPifResult.id()),
                    eth2Vlan.applyValue(getXoaPifResult -> getXoaPifResult.id()))
                .build());
    
        }
    }
    
    resources:
      # Create a bonded network from normal PIFs
      network:
        type: xenorchestra:XoaBondedNetwork
        properties:
          nameLabel: new network name
          bondMode: active-backup
          poolId: ${host1.poolId}
          pifIds:
            - ${eth1.id}
            - ${eth2.id}
      # Create a bonded network from normal PIFs
      networkVlan:
        type: xenorchestra:XoaBondedNetwork
        name: network_vlan
        properties:
          nameLabel: new network name
          bondMode: active-backup
          poolId: ${host1.poolId}
          pifIds:
            - ${eth1Vlan.id}
            - ${eth2Vlan.id}
    variables:
      host1:
        fn::invoke:
          function: xenorchestra:getXoaHost
          arguments:
            nameLabel: Your host
      eth1:
        fn::invoke:
          function: xenorchestra:getXoaPif
          arguments:
            device: eth1
            vlan: -1
            hostId: ${host1.id}
      eth2:
        fn::invoke:
          function: xenorchestra:getXoaPif
          arguments:
            device: eth2
            vlan: -1
            hostId: ${host1.id}
      # Create a bonded network from PIFs on VLANs
      eth1Vlan:
        fn::invoke:
          function: xenorchestra:getXoaPif
          arguments:
            device: eth1
            vlan: 15
            hostId: ${host1.id}
      eth2Vlan:
        fn::invoke:
          function: xenorchestra:getXoaPif
          arguments:
            device: eth2
            vlan: 15
            hostId: ${host1.id}
    

    Create BondedNetwork Resource

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

    Constructor syntax

    new BondedNetwork(name: string, args: BondedNetworkArgs, opts?: CustomResourceOptions);
    @overload
    def BondedNetwork(resource_name: str,
                      args: BondedNetworkArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def BondedNetwork(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      automatic: Optional[bool] = None,
                      bond_mode: Optional[str] = None,
                      default_is_locked: Optional[bool] = None,
                      mtu: Optional[int] = None,
                      name_description: Optional[str] = None,
                      name_label: Optional[str] = None,
                      pif_ids: Optional[Sequence[str]] = None,
                      pool_id: Optional[str] = None)
    func NewBondedNetwork(ctx *Context, name string, args BondedNetworkArgs, opts ...ResourceOption) (*BondedNetwork, error)
    public BondedNetwork(string name, BondedNetworkArgs args, CustomResourceOptions? opts = null)
    public BondedNetwork(String name, BondedNetworkArgs args)
    public BondedNetwork(String name, BondedNetworkArgs args, CustomResourceOptions options)
    
    type: xenorchestra:BondedNetwork
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    BondedNetwork 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 BondedNetwork resource accepts the following input properties:

    NameLabel string
    The name label of the network.
    PoolId string
    The pool id that this network should belong to.
    Automatic bool
    BondMode string
    The bond mode that should be used for this network.
    DefaultIsLocked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    Mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    NameDescription string
    PifIds List<string>
    The pifs (uuid) that should be used for this network.
    NameLabel string
    The name label of the network.
    PoolId string
    The pool id that this network should belong to.
    Automatic bool
    BondMode string
    The bond mode that should be used for this network.
    DefaultIsLocked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    Mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    NameDescription string
    PifIds []string
    The pifs (uuid) that should be used for this network.
    nameLabel String
    The name label of the network.
    poolId String
    The pool id that this network should belong to.
    automatic Boolean
    bondMode String
    The bond mode that should be used for this network.
    defaultIsLocked Boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu Integer
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription String
    pifIds List<String>
    The pifs (uuid) that should be used for this network.
    nameLabel string
    The name label of the network.
    poolId string
    The pool id that this network should belong to.
    automatic boolean
    bondMode string
    The bond mode that should be used for this network.
    defaultIsLocked boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu number
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription string
    pifIds string[]
    The pifs (uuid) that should be used for this network.
    name_label str
    The name label of the network.
    pool_id str
    The pool id that this network should belong to.
    automatic bool
    bond_mode str
    The bond mode that should be used for this network.
    default_is_locked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    name_description str
    pif_ids Sequence[str]
    The pifs (uuid) that should be used for this network.
    nameLabel String
    The name label of the network.
    poolId String
    The pool id that this network should belong to.
    automatic Boolean
    bondMode String
    The bond mode that should be used for this network.
    defaultIsLocked Boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu Number
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription String
    pifIds List<String>
    The pifs (uuid) that should be used for this network.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BondedNetwork 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 BondedNetwork Resource

    Get an existing BondedNetwork 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?: BondedNetworkState, opts?: CustomResourceOptions): BondedNetwork
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            automatic: Optional[bool] = None,
            bond_mode: Optional[str] = None,
            default_is_locked: Optional[bool] = None,
            mtu: Optional[int] = None,
            name_description: Optional[str] = None,
            name_label: Optional[str] = None,
            pif_ids: Optional[Sequence[str]] = None,
            pool_id: Optional[str] = None) -> BondedNetwork
    func GetBondedNetwork(ctx *Context, name string, id IDInput, state *BondedNetworkState, opts ...ResourceOption) (*BondedNetwork, error)
    public static BondedNetwork Get(string name, Input<string> id, BondedNetworkState? state, CustomResourceOptions? opts = null)
    public static BondedNetwork get(String name, Output<String> id, BondedNetworkState state, CustomResourceOptions options)
    resources:  _:    type: xenorchestra:BondedNetwork    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    Automatic bool
    BondMode string
    The bond mode that should be used for this network.
    DefaultIsLocked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    Mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    NameDescription string
    NameLabel string
    The name label of the network.
    PifIds List<string>
    The pifs (uuid) that should be used for this network.
    PoolId string
    The pool id that this network should belong to.
    Automatic bool
    BondMode string
    The bond mode that should be used for this network.
    DefaultIsLocked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    Mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    NameDescription string
    NameLabel string
    The name label of the network.
    PifIds []string
    The pifs (uuid) that should be used for this network.
    PoolId string
    The pool id that this network should belong to.
    automatic Boolean
    bondMode String
    The bond mode that should be used for this network.
    defaultIsLocked Boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu Integer
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription String
    nameLabel String
    The name label of the network.
    pifIds List<String>
    The pifs (uuid) that should be used for this network.
    poolId String
    The pool id that this network should belong to.
    automatic boolean
    bondMode string
    The bond mode that should be used for this network.
    defaultIsLocked boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu number
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription string
    nameLabel string
    The name label of the network.
    pifIds string[]
    The pifs (uuid) that should be used for this network.
    poolId string
    The pool id that this network should belong to.
    automatic bool
    bond_mode str
    The bond mode that should be used for this network.
    default_is_locked bool
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu int
    The MTU of the network. Defaults to 1500 if unspecified.
    name_description str
    name_label str
    The name label of the network.
    pif_ids Sequence[str]
    The pifs (uuid) that should be used for this network.
    pool_id str
    The pool id that this network should belong to.
    automatic Boolean
    bondMode String
    The bond mode that should be used for this network.
    defaultIsLocked Boolean
    This argument controls whether the network should enforce VIF locking. This defaults to false which means that no filtering rules are applied.
    mtu Number
    The MTU of the network. Defaults to 1500 if unspecified.
    nameDescription String
    nameLabel String
    The name label of the network.
    pifIds List<String>
    The pifs (uuid) that should be used for this network.
    poolId String
    The pool id that this network should belong to.

    Package Details

    Repository
    xenorchestra vatesfr/pulumi-xenorchestra
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the xenorchestra Terraform Provider.
    xenorchestra logo
    xenorchestra v1.5.0 published on Friday, Mar 7, 2025 by Vates