Pool

Manages a storage pool in libvirt. Currently only directory-based storage pool are supported. For more information on storage pools in libvirt, see the official documentation.

WARNING: This is experimental API and may change in the future.

Example Usage

using Pulumi;
using Libvirt = Pulumi.Libvirt;

class MyStack : Stack
{
    public MyStack()
    {
        // A pool for all cluster volumes
        var cluster = new Libvirt.Pool("cluster", new Libvirt.PoolArgs
        {
            Type = "dir",
            Path = "/home/user/cluster_storage",
        });
        var opensuseLeap = new Libvirt.Volume("opensuseLeap", new Libvirt.VolumeArgs
        {
            Pool = cluster.Name,
            Source = "http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cluster, err := libvirt.NewPool(ctx, "cluster", &libvirt.PoolArgs{
			Type: pulumi.String("dir"),
			Path: pulumi.String("/home/user/cluster_storage"),
		})
		if err != nil {
			return err
		}
		_, err = libvirt.NewVolume(ctx, "opensuseLeap", &libvirt.VolumeArgs{
			Pool:   cluster.Name,
			Source: pulumi.String("http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_libvirt as libvirt

# A pool for all cluster volumes
cluster = libvirt.Pool("cluster",
    type="dir",
    path="/home/user/cluster_storage")
opensuse_leap = libvirt.Volume("opensuseLeap",
    pool=cluster.name,
    source="http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2")
import * as pulumi from "@pulumi/pulumi";
import * as libvirt from "@pulumi/libvirt";

// A pool for all cluster volumes
const cluster = new libvirt.Pool("cluster", {
    type: "dir",
    path: "/home/user/cluster_storage",
});
const opensuseLeap = new libvirt.Volume("opensuseLeap", {
    pool: cluster.name,
    source: "http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2",
});

Create a Pool Resource

new Pool(name: string, args: PoolArgs, opts?: CustomResourceOptions);
@overload
def Pool(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         allocation: Optional[int] = None,
         available: Optional[str] = None,
         capacity: Optional[int] = None,
         name: Optional[str] = None,
         path: Optional[str] = None,
         type: Optional[str] = None,
         xml: Optional[PoolXmlArgs] = None)
@overload
def Pool(resource_name: str,
         args: PoolArgs,
         opts: Optional[ResourceOptions] = None)
func NewPool(ctx *Context, name string, args PoolArgs, opts ...ResourceOption) (*Pool, error)
public Pool(string name, PoolArgs args, CustomResourceOptions? opts = null)
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.

Pool Resource Properties

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

Inputs

The Pool resource accepts the following input properties:

Type string
The type of the pool. Currently, only “dir” supported.
Allocation int
Available string
Capacity int
Name string
A unique name for the resource, required by libvirt.
Path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
Xml PoolXmlArgs
Type string
The type of the pool. Currently, only “dir” supported.
Allocation int
Available string
Capacity int
Name string
A unique name for the resource, required by libvirt.
Path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
Xml PoolXml
type string
The type of the pool. Currently, only “dir” supported.
allocation number
available string
capacity number
name string
A unique name for the resource, required by libvirt.
path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
xml PoolXmlArgs
type str
The type of the pool. Currently, only “dir” supported.
allocation int
available str
capacity int
name str
A unique name for the resource, required by libvirt.
path str
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
xml PoolXmlArgs

Outputs

All input properties are implicitly available as output properties. Additionally, the Pool 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 str
The provider-assigned unique ID for this managed resource.

Look up an 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[int] = None,
        available: Optional[str] = None,
        capacity: Optional[int] = None,
        name: Optional[str] = None,
        path: Optional[str] = None,
        type: Optional[str] = None,
        xml: Optional[PoolXmlArgs] = 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)
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.

The following state arguments are supported:

Allocation int
Available string
Capacity int
Name string
A unique name for the resource, required by libvirt.
Path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
Type string
The type of the pool. Currently, only “dir” supported.
Xml PoolXmlArgs
Allocation int
Available string
Capacity int
Name string
A unique name for the resource, required by libvirt.
Path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
Type string
The type of the pool. Currently, only “dir” supported.
Xml PoolXml
allocation number
available string
capacity number
name string
A unique name for the resource, required by libvirt.
path string
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
type string
The type of the pool. Currently, only “dir” supported.
xml PoolXmlArgs
allocation int
available str
capacity int
name str
A unique name for the resource, required by libvirt.
path str
The directory where the pool will keep all its volumes. This is only relevant to (and required by) the “dir” type pools.
type str
The type of the pool. Currently, only “dir” supported.
xml PoolXmlArgs

Supporting Types

PoolXml

Xslt string
Xslt string
xslt string
xslt str

Package Details

Repository
https://github.com/pulumi/pulumi-libvirt
License
Apache-2.0
Notes
This Pulumi package is based on the libvirt Terraform Provider.