1. Packages
  2. Libvirt Provider
  3. API Docs
  4. Pool
libvirt 0.9.0 published on Saturday, Nov 8, 2025 by dmacvicar
libvirt logo
libvirt 0.9.0 published on Saturday, Nov 8, 2025 by dmacvicar

    Manages a libvirt storage pool.

    Storage pools provide a common interface for managing storage that can be used by virtual machines. This resource supports directory-based and LVM-based storage pools.

    See the libvirt storage pool documentation for more details.

    Create Pool Resource

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

    Constructor syntax

    new Pool(name: string, args: PoolArgs, opts?: CustomResourceOptions);
    @overload
    def Pool(resource_name: str,
             args: PoolArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Pool(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             target: Optional[PoolTargetArgs] = None,
             type: Optional[str] = None,
             name: Optional[str] = None,
             source: Optional[PoolSourceArgs] = None)
    func NewPool(ctx *Context, name string, args PoolArgs, opts ...ResourceOption) (*Pool, error)
    public Pool(string name, PoolArgs args, CustomResourceOptions? opts = null)
    public Pool(String name, PoolArgs args)
    public Pool(String name, PoolArgs args, CustomResourceOptions options)
    
    type: libvirt:Pool
    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 PoolArgs
    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 PoolArgs
    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 PoolArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PoolArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PoolArgs
    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 poolResource = new Libvirt.Pool("poolResource", new()
    {
        Target = new Libvirt.Inputs.PoolTargetArgs
        {
            Path = "string",
            Permissions = new Libvirt.Inputs.PoolTargetPermissionsArgs
            {
                Group = "string",
                Label = "string",
                Mode = "string",
                Owner = "string",
            },
        },
        Type = "string",
        Name = "string",
        Source = new Libvirt.Inputs.PoolSourceArgs
        {
            Devices = new[]
            {
                new Libvirt.Inputs.PoolSourceDeviceArgs
                {
                    Path = "string",
                },
            },
            Name = "string",
        },
    });
    
    example, err := libvirt.NewPool(ctx, "poolResource", &libvirt.PoolArgs{
    	Target: &libvirt.PoolTargetArgs{
    		Path: pulumi.String("string"),
    		Permissions: &libvirt.PoolTargetPermissionsArgs{
    			Group: pulumi.String("string"),
    			Label: pulumi.String("string"),
    			Mode:  pulumi.String("string"),
    			Owner: pulumi.String("string"),
    		},
    	},
    	Type: pulumi.String("string"),
    	Name: pulumi.String("string"),
    	Source: &libvirt.PoolSourceArgs{
    		Devices: libvirt.PoolSourceDeviceArray{
    			&libvirt.PoolSourceDeviceArgs{
    				Path: pulumi.String("string"),
    			},
    		},
    		Name: pulumi.String("string"),
    	},
    })
    
    var poolResource = new Pool("poolResource", PoolArgs.builder()
        .target(PoolTargetArgs.builder()
            .path("string")
            .permissions(PoolTargetPermissionsArgs.builder()
                .group("string")
                .label("string")
                .mode("string")
                .owner("string")
                .build())
            .build())
        .type("string")
        .name("string")
        .source(PoolSourceArgs.builder()
            .devices(PoolSourceDeviceArgs.builder()
                .path("string")
                .build())
            .name("string")
            .build())
        .build());
    
    pool_resource = libvirt.Pool("poolResource",
        target={
            "path": "string",
            "permissions": {
                "group": "string",
                "label": "string",
                "mode": "string",
                "owner": "string",
            },
        },
        type="string",
        name="string",
        source={
            "devices": [{
                "path": "string",
            }],
            "name": "string",
        })
    
    const poolResource = new libvirt.Pool("poolResource", {
        target: {
            path: "string",
            permissions: {
                group: "string",
                label: "string",
                mode: "string",
                owner: "string",
            },
        },
        type: "string",
        name: "string",
        source: {
            devices: [{
                path: "string",
            }],
            name: "string",
        },
    });
    
    type: libvirt:Pool
    properties:
        name: string
        source:
            devices:
                - path: string
            name: string
        target:
            path: string
            permissions:
                group: string
                label: string
                mode: string
                owner: string
        type: string
    

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

    Target PoolTarget
    Target path for the storage pool
    Type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    Name string
    Unique name of the storage pool
    Source PoolSource
    Source configuration for the storage pool (required for logical pools)
    Target PoolTargetArgs
    Target path for the storage pool
    Type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    Name string
    Unique name of the storage pool
    Source PoolSourceArgs
    Source configuration for the storage pool (required for logical pools)
    target PoolTarget
    Target path for the storage pool
    type String
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    name String
    Unique name of the storage pool
    source PoolSource
    Source configuration for the storage pool (required for logical pools)
    target PoolTarget
    Target path for the storage pool
    type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    name string
    Unique name of the storage pool
    source PoolSource
    Source configuration for the storage pool (required for logical pools)
    target PoolTargetArgs
    Target path for the storage pool
    type str
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    name str
    Unique name of the storage pool
    source PoolSourceArgs
    Source configuration for the storage pool (required for logical pools)
    target Property Map
    Target path for the storage pool
    type String
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    name String
    Unique name of the storage pool
    source Property Map
    Source configuration for the storage pool (required for logical pools)

    Outputs

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

    Allocation double
    Currently allocated space in bytes
    Available double
    Available space in bytes
    Capacity double
    Total capacity of the storage pool in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    UUID of the storage pool
    Allocation float64
    Currently allocated space in bytes
    Available float64
    Available space in bytes
    Capacity float64
    Total capacity of the storage pool in bytes
    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    UUID of the storage pool
    allocation Double
    Currently allocated space in bytes
    available Double
    Available space in bytes
    capacity Double
    Total capacity of the storage pool in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    UUID of the storage pool
    allocation number
    Currently allocated space in bytes
    available number
    Available space in bytes
    capacity number
    Total capacity of the storage pool in bytes
    id string
    The provider-assigned unique ID for this managed resource.
    uuid string
    UUID of the storage pool
    allocation float
    Currently allocated space in bytes
    available float
    Available space in bytes
    capacity float
    Total capacity of the storage pool in bytes
    id str
    The provider-assigned unique ID for this managed resource.
    uuid str
    UUID of the storage pool
    allocation Number
    Currently allocated space in bytes
    available Number
    Available space in bytes
    capacity Number
    Total capacity of the storage pool in bytes
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    UUID of the storage pool

    Look up Existing Pool Resource

    Get an existing Pool 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?: PoolState, opts?: CustomResourceOptions): Pool
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allocation: Optional[float] = None,
            available: Optional[float] = None,
            capacity: Optional[float] = None,
            name: Optional[str] = None,
            source: Optional[PoolSourceArgs] = None,
            target: Optional[PoolTargetArgs] = None,
            type: Optional[str] = None,
            uuid: Optional[str] = None) -> Pool
    func GetPool(ctx *Context, name string, id IDInput, state *PoolState, opts ...ResourceOption) (*Pool, error)
    public static Pool Get(string name, Input<string> id, PoolState? state, CustomResourceOptions? opts = null)
    public static Pool get(String name, Output<String> id, PoolState state, CustomResourceOptions options)
    resources:  _:    type: libvirt:Pool    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:
    Allocation double
    Currently allocated space in bytes
    Available double
    Available space in bytes
    Capacity double
    Total capacity of the storage pool in bytes
    Name string
    Unique name of the storage pool
    Source PoolSource
    Source configuration for the storage pool (required for logical pools)
    Target PoolTarget
    Target path for the storage pool
    Type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    Uuid string
    UUID of the storage pool
    Allocation float64
    Currently allocated space in bytes
    Available float64
    Available space in bytes
    Capacity float64
    Total capacity of the storage pool in bytes
    Name string
    Unique name of the storage pool
    Source PoolSourceArgs
    Source configuration for the storage pool (required for logical pools)
    Target PoolTargetArgs
    Target path for the storage pool
    Type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    Uuid string
    UUID of the storage pool
    allocation Double
    Currently allocated space in bytes
    available Double
    Available space in bytes
    capacity Double
    Total capacity of the storage pool in bytes
    name String
    Unique name of the storage pool
    source PoolSource
    Source configuration for the storage pool (required for logical pools)
    target PoolTarget
    Target path for the storage pool
    type String
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    uuid String
    UUID of the storage pool
    allocation number
    Currently allocated space in bytes
    available number
    Available space in bytes
    capacity number
    Total capacity of the storage pool in bytes
    name string
    Unique name of the storage pool
    source PoolSource
    Source configuration for the storage pool (required for logical pools)
    target PoolTarget
    Target path for the storage pool
    type string
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    uuid string
    UUID of the storage pool
    allocation float
    Currently allocated space in bytes
    available float
    Available space in bytes
    capacity float
    Total capacity of the storage pool in bytes
    name str
    Unique name of the storage pool
    source PoolSourceArgs
    Source configuration for the storage pool (required for logical pools)
    target PoolTargetArgs
    Target path for the storage pool
    type str
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    uuid str
    UUID of the storage pool
    allocation Number
    Currently allocated space in bytes
    available Number
    Available space in bytes
    capacity Number
    Total capacity of the storage pool in bytes
    name String
    Unique name of the storage pool
    source Property Map
    Source configuration for the storage pool (required for logical pools)
    target Property Map
    Target path for the storage pool
    type String
    Type of storage pool. Supported values: dir (directory-based), logical (LVM)
    uuid String
    UUID of the storage pool

    Supporting Types

    PoolSource, PoolSourceArgs

    Devices List<PoolSourceDevice>
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    Name string
    Name of the source (e.g., volume group name for logical pools)
    Devices []PoolSourceDevice
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    Name string
    Name of the source (e.g., volume group name for logical pools)
    devices List<PoolSourceDevice>
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    name String
    Name of the source (e.g., volume group name for logical pools)
    devices PoolSourceDevice[]
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    name string
    Name of the source (e.g., volume group name for logical pools)
    devices Sequence[PoolSourceDevice]
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    name str
    Name of the source (e.g., volume group name for logical pools)
    devices List<Property Map>
    List of devices to use for the storage pool (e.g., physical volumes for logical pools)
    name String
    Name of the source (e.g., volume group name for logical pools)

    PoolSourceDevice, PoolSourceDeviceArgs

    Path string
    Path to the device
    Path string
    Path to the device
    path String
    Path to the device
    path string
    Path to the device
    path str
    Path to the device
    path String
    Path to the device

    PoolTarget, PoolTargetArgs

    Path string
    Path where the storage pool is located on the host
    Permissions PoolTargetPermissions
    Permissions for the pool directory
    Path string
    Path where the storage pool is located on the host
    Permissions PoolTargetPermissions
    Permissions for the pool directory
    path String
    Path where the storage pool is located on the host
    permissions PoolTargetPermissions
    Permissions for the pool directory
    path string
    Path where the storage pool is located on the host
    permissions PoolTargetPermissions
    Permissions for the pool directory
    path str
    Path where the storage pool is located on the host
    permissions PoolTargetPermissions
    Permissions for the pool directory
    path String
    Path where the storage pool is located on the host
    permissions Property Map
    Permissions for the pool directory

    PoolTargetPermissions, PoolTargetPermissionsArgs

    Group string
    Numeric group ID for the pool directory group
    Label string
    SELinux label for the pool directory
    Mode string
    Octal permission mode for the pool directory (e.g., '0755')
    Owner string
    Numeric user ID for the pool directory owner
    Group string
    Numeric group ID for the pool directory group
    Label string
    SELinux label for the pool directory
    Mode string
    Octal permission mode for the pool directory (e.g., '0755')
    Owner string
    Numeric user ID for the pool directory owner
    group String
    Numeric group ID for the pool directory group
    label String
    SELinux label for the pool directory
    mode String
    Octal permission mode for the pool directory (e.g., '0755')
    owner String
    Numeric user ID for the pool directory owner
    group string
    Numeric group ID for the pool directory group
    label string
    SELinux label for the pool directory
    mode string
    Octal permission mode for the pool directory (e.g., '0755')
    owner string
    Numeric user ID for the pool directory owner
    group str
    Numeric group ID for the pool directory group
    label str
    SELinux label for the pool directory
    mode str
    Octal permission mode for the pool directory (e.g., '0755')
    owner str
    Numeric user ID for the pool directory owner
    group String
    Numeric group ID for the pool directory group
    label String
    SELinux label for the pool directory
    mode String
    Octal permission mode for the pool directory (e.g., '0755')
    owner String
    Numeric user ID for the pool directory owner

    Package Details

    Repository
    libvirt dmacvicar/terraform-provider-libvirt
    License
    Notes
    This Pulumi package is based on the libvirt Terraform Provider.
    libvirt logo
    libvirt 0.9.0 published on Saturday, Nov 8, 2025 by dmacvicar
      Meet Neo: Your AI Platform Teammate