Manages directory-based storage in Proxmox VE.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as proxmoxve from "@muhlba91/pulumi-proxmoxve";
const example = new proxmoxve.storage.Directory("example", {
directoryId: "example-dir",
path: "/var/lib/vz",
nodes: ["pve"],
contents: ["images"],
shared: true,
disable: false,
backups: {
maxProtectedBackups: 5,
keepDaily: 7,
},
});
import pulumi
import pulumi_proxmoxve as proxmoxve
example = proxmoxve.storage.Directory("example",
directory_id="example-dir",
path="/var/lib/vz",
nodes=["pve"],
contents=["images"],
shared=True,
disable=False,
backups={
"max_protected_backups": 5,
"keep_daily": 7,
})
package main
import (
"github.com/muhlba91/pulumi-proxmoxve/sdk/v7/go/proxmoxve/storage"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewDirectory(ctx, "example", &storage.DirectoryArgs{
DirectoryId: pulumi.String("example-dir"),
Path: pulumi.String("/var/lib/vz"),
Nodes: pulumi.StringArray{
pulumi.String("pve"),
},
Contents: pulumi.StringArray{
pulumi.String("images"),
},
Shared: pulumi.Bool(true),
Disable: pulumi.Bool(false),
Backups: &storage.DirectoryBackupsArgs{
MaxProtectedBackups: pulumi.Int(5),
KeepDaily: pulumi.Int(7),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using ProxmoxVE = Pulumi.ProxmoxVE;
return await Deployment.RunAsync(() =>
{
var example = new ProxmoxVE.Storage.Directory("example", new()
{
DirectoryId = "example-dir",
Path = "/var/lib/vz",
Nodes = new[]
{
"pve",
},
Contents = new[]
{
"images",
},
Shared = true,
Disable = false,
Backups = new ProxmoxVE.Storage.Inputs.DirectoryBackupsArgs
{
MaxProtectedBackups = 5,
KeepDaily = 7,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import io.muehlbachler.pulumi.proxmoxve.Storage.Directory;
import io.muehlbachler.pulumi.proxmoxve.Storage.DirectoryArgs;
import com.pulumi.proxmoxve.Storage.inputs.DirectoryBackupsArgs;
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) {
var example = new Directory("example", DirectoryArgs.builder()
.directoryId("example-dir")
.path("/var/lib/vz")
.nodes("pve")
.contents("images")
.shared(true)
.disable(false)
.backups(DirectoryBackupsArgs.builder()
.maxProtectedBackups(5)
.keepDaily(7)
.build())
.build());
}
}
resources:
example:
type: proxmoxve:Storage:Directory
properties:
directoryId: example-dir
path: /var/lib/vz
nodes:
- pve
contents:
- images
shared: true
disable: false
backups:
maxProtectedBackups: 5
keepDaily: 7
Create Directory Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Directory(name: string, args: DirectoryArgs, opts?: CustomResourceOptions);@overload
def Directory(resource_name: str,
args: DirectoryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Directory(resource_name: str,
opts: Optional[ResourceOptions] = None,
directory_id: Optional[str] = None,
path: Optional[str] = None,
backups: Optional[DirectoryBackupsArgs] = None,
contents: Optional[Sequence[str]] = None,
disable: Optional[bool] = None,
nodes: Optional[Sequence[str]] = None,
preallocation: Optional[str] = None,
shared: Optional[bool] = None)func NewDirectory(ctx *Context, name string, args DirectoryArgs, opts ...ResourceOption) (*Directory, error)public Directory(string name, DirectoryArgs args, CustomResourceOptions? opts = null)
public Directory(String name, DirectoryArgs args)
public Directory(String name, DirectoryArgs args, CustomResourceOptions options)
type: proxmoxve:Storage:Directory
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 DirectoryArgs
- 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 DirectoryArgs
- 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 DirectoryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DirectoryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DirectoryArgs
- 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 directoryResource = new ProxmoxVE.Storage.Directory("directoryResource", new()
{
DirectoryId = "string",
Path = "string",
Backups = new ProxmoxVE.Storage.Inputs.DirectoryBackupsArgs
{
KeepAll = false,
KeepDaily = 0,
KeepHourly = 0,
KeepLast = 0,
KeepMonthly = 0,
KeepWeekly = 0,
KeepYearly = 0,
MaxProtectedBackups = 0,
},
Contents = new[]
{
"string",
},
Disable = false,
Nodes = new[]
{
"string",
},
Preallocation = "string",
Shared = false,
});
example, err := storage.NewDirectory(ctx, "directoryResource", &storage.DirectoryArgs{
DirectoryId: pulumi.String("string"),
Path: pulumi.String("string"),
Backups: &storage.DirectoryBackupsArgs{
KeepAll: pulumi.Bool(false),
KeepDaily: pulumi.Int(0),
KeepHourly: pulumi.Int(0),
KeepLast: pulumi.Int(0),
KeepMonthly: pulumi.Int(0),
KeepWeekly: pulumi.Int(0),
KeepYearly: pulumi.Int(0),
MaxProtectedBackups: pulumi.Int(0),
},
Contents: pulumi.StringArray{
pulumi.String("string"),
},
Disable: pulumi.Bool(false),
Nodes: pulumi.StringArray{
pulumi.String("string"),
},
Preallocation: pulumi.String("string"),
Shared: pulumi.Bool(false),
})
var directoryResource = new Directory("directoryResource", DirectoryArgs.builder()
.directoryId("string")
.path("string")
.backups(DirectoryBackupsArgs.builder()
.keepAll(false)
.keepDaily(0)
.keepHourly(0)
.keepLast(0)
.keepMonthly(0)
.keepWeekly(0)
.keepYearly(0)
.maxProtectedBackups(0)
.build())
.contents("string")
.disable(false)
.nodes("string")
.preallocation("string")
.shared(false)
.build());
directory_resource = proxmoxve.storage.Directory("directoryResource",
directory_id="string",
path="string",
backups={
"keep_all": False,
"keep_daily": 0,
"keep_hourly": 0,
"keep_last": 0,
"keep_monthly": 0,
"keep_weekly": 0,
"keep_yearly": 0,
"max_protected_backups": 0,
},
contents=["string"],
disable=False,
nodes=["string"],
preallocation="string",
shared=False)
const directoryResource = new proxmoxve.storage.Directory("directoryResource", {
directoryId: "string",
path: "string",
backups: {
keepAll: false,
keepDaily: 0,
keepHourly: 0,
keepLast: 0,
keepMonthly: 0,
keepWeekly: 0,
keepYearly: 0,
maxProtectedBackups: 0,
},
contents: ["string"],
disable: false,
nodes: ["string"],
preallocation: "string",
shared: false,
});
type: proxmoxve:Storage:Directory
properties:
backups:
keepAll: false
keepDaily: 0
keepHourly: 0
keepLast: 0
keepMonthly: 0
keepWeekly: 0
keepYearly: 0
maxProtectedBackups: 0
contents:
- string
directoryId: string
disable: false
nodes:
- string
path: string
preallocation: string
shared: false
Directory 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 Directory resource accepts the following input properties:
- Directory
Id string - The unique identifier of the storage.
- Path string
- The path to the directory on the Proxmox node.
- Backups
Pulumi.
Proxmox VE. Storage. Inputs. Directory Backups - Configure backup retention settings for the storage type.
- Contents List<string>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - Disable bool
- Whether the storage is disabled.
- Nodes List<string>
- A list of nodes where this storage is available.
- Preallocation string
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- Directory
Id string - The unique identifier of the storage.
- Path string
- The path to the directory on the Proxmox node.
- Backups
Directory
Backups Args - Configure backup retention settings for the storage type.
- Contents []string
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - Disable bool
- Whether the storage is disabled.
- Nodes []string
- A list of nodes where this storage is available.
- Preallocation string
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- directory
Id String - The unique identifier of the storage.
- path String
- The path to the directory on the Proxmox node.
- backups
Directory
Backups - Configure backup retention settings for the storage type.
- contents List<String>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - disable Boolean
- Whether the storage is disabled.
- nodes List<String>
- A list of nodes where this storage is available.
- preallocation String
- The preallocation mode for raw and qcow2 images.
- Boolean
- Whether the storage is shared across all nodes.
- directory
Id string - The unique identifier of the storage.
- path string
- The path to the directory on the Proxmox node.
- backups
Directory
Backups - Configure backup retention settings for the storage type.
- contents string[]
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - disable boolean
- Whether the storage is disabled.
- nodes string[]
- A list of nodes where this storage is available.
- preallocation string
- The preallocation mode for raw and qcow2 images.
- boolean
- Whether the storage is shared across all nodes.
- directory_
id str - The unique identifier of the storage.
- path str
- The path to the directory on the Proxmox node.
- backups
Directory
Backups Args - Configure backup retention settings for the storage type.
- contents Sequence[str]
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - disable bool
- Whether the storage is disabled.
- nodes Sequence[str]
- A list of nodes where this storage is available.
- preallocation str
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- directory
Id String - The unique identifier of the storage.
- path String
- The path to the directory on the Proxmox node.
- backups Property Map
- Configure backup retention settings for the storage type.
- contents List<String>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - disable Boolean
- Whether the storage is disabled.
- nodes List<String>
- A list of nodes where this storage is available.
- preallocation String
- The preallocation mode for raw and qcow2 images.
- Boolean
- Whether the storage is shared across all nodes.
Outputs
All input properties are implicitly available as output properties. Additionally, the Directory 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 Directory Resource
Get an existing Directory 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?: DirectoryState, opts?: CustomResourceOptions): Directory@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backups: Optional[DirectoryBackupsArgs] = None,
contents: Optional[Sequence[str]] = None,
directory_id: Optional[str] = None,
disable: Optional[bool] = None,
nodes: Optional[Sequence[str]] = None,
path: Optional[str] = None,
preallocation: Optional[str] = None,
shared: Optional[bool] = None) -> Directoryfunc GetDirectory(ctx *Context, name string, id IDInput, state *DirectoryState, opts ...ResourceOption) (*Directory, error)public static Directory Get(string name, Input<string> id, DirectoryState? state, CustomResourceOptions? opts = null)public static Directory get(String name, Output<String> id, DirectoryState state, CustomResourceOptions options)resources: _: type: proxmoxve:Storage:Directory 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.
- Backups
Pulumi.
Proxmox VE. Storage. Inputs. Directory Backups - Configure backup retention settings for the storage type.
- Contents List<string>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - Directory
Id string - The unique identifier of the storage.
- Disable bool
- Whether the storage is disabled.
- Nodes List<string>
- A list of nodes where this storage is available.
- Path string
- The path to the directory on the Proxmox node.
- Preallocation string
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- Backups
Directory
Backups Args - Configure backup retention settings for the storage type.
- Contents []string
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - Directory
Id string - The unique identifier of the storage.
- Disable bool
- Whether the storage is disabled.
- Nodes []string
- A list of nodes where this storage is available.
- Path string
- The path to the directory on the Proxmox node.
- Preallocation string
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- backups
Directory
Backups - Configure backup retention settings for the storage type.
- contents List<String>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - directory
Id String - The unique identifier of the storage.
- disable Boolean
- Whether the storage is disabled.
- nodes List<String>
- A list of nodes where this storage is available.
- path String
- The path to the directory on the Proxmox node.
- preallocation String
- The preallocation mode for raw and qcow2 images.
- Boolean
- Whether the storage is shared across all nodes.
- backups
Directory
Backups - Configure backup retention settings for the storage type.
- contents string[]
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - directory
Id string - The unique identifier of the storage.
- disable boolean
- Whether the storage is disabled.
- nodes string[]
- A list of nodes where this storage is available.
- path string
- The path to the directory on the Proxmox node.
- preallocation string
- The preallocation mode for raw and qcow2 images.
- boolean
- Whether the storage is shared across all nodes.
- backups
Directory
Backups Args - Configure backup retention settings for the storage type.
- contents Sequence[str]
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - directory_
id str - The unique identifier of the storage.
- disable bool
- Whether the storage is disabled.
- nodes Sequence[str]
- A list of nodes where this storage is available.
- path str
- The path to the directory on the Proxmox node.
- preallocation str
- The preallocation mode for raw and qcow2 images.
- bool
- Whether the storage is shared across all nodes.
- backups Property Map
- Configure backup retention settings for the storage type.
- contents List<String>
- The content types that can be stored on this storage. Valid values:
backup(VM backups),images(VM disk images),import(VM disk images for import),iso(ISO images),rootdir(container root directories),snippets(cloud-init, hook scripts, etc.),vztmpl(container templates). - directory
Id String - The unique identifier of the storage.
- disable Boolean
- Whether the storage is disabled.
- nodes List<String>
- A list of nodes where this storage is available.
- path String
- The path to the directory on the Proxmox node.
- preallocation String
- The preallocation mode for raw and qcow2 images.
- Boolean
- Whether the storage is shared across all nodes.
Supporting Types
DirectoryBackups, DirectoryBackupsArgs
- Keep
All bool - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- Keep
Daily int - The number of daily backups to keep. Older backups will be removed.
- Keep
Hourly int - The number of hourly backups to keep. Older backups will be removed.
- Keep
Last int - Specifies the number of the most recent backups to keep, regardless of their age.
- Keep
Monthly int - The number of monthly backups to keep. Older backups will be removed.
- Keep
Weekly int - The number of weekly backups to keep. Older backups will be removed.
- Keep
Yearly int - The number of yearly backups to keep. Older backups will be removed.
- Max
Protected intBackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
- Keep
All bool - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- Keep
Daily int - The number of daily backups to keep. Older backups will be removed.
- Keep
Hourly int - The number of hourly backups to keep. Older backups will be removed.
- Keep
Last int - Specifies the number of the most recent backups to keep, regardless of their age.
- Keep
Monthly int - The number of monthly backups to keep. Older backups will be removed.
- Keep
Weekly int - The number of weekly backups to keep. Older backups will be removed.
- Keep
Yearly int - The number of yearly backups to keep. Older backups will be removed.
- Max
Protected intBackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
- keep
All Boolean - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- keep
Daily Integer - The number of daily backups to keep. Older backups will be removed.
- keep
Hourly Integer - The number of hourly backups to keep. Older backups will be removed.
- keep
Last Integer - Specifies the number of the most recent backups to keep, regardless of their age.
- keep
Monthly Integer - The number of monthly backups to keep. Older backups will be removed.
- keep
Weekly Integer - The number of weekly backups to keep. Older backups will be removed.
- keep
Yearly Integer - The number of yearly backups to keep. Older backups will be removed.
- max
Protected IntegerBackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
- keep
All boolean - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- keep
Daily number - The number of daily backups to keep. Older backups will be removed.
- keep
Hourly number - The number of hourly backups to keep. Older backups will be removed.
- keep
Last number - Specifies the number of the most recent backups to keep, regardless of their age.
- keep
Monthly number - The number of monthly backups to keep. Older backups will be removed.
- keep
Weekly number - The number of weekly backups to keep. Older backups will be removed.
- keep
Yearly number - The number of yearly backups to keep. Older backups will be removed.
- max
Protected numberBackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
- keep_
all bool - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- keep_
daily int - The number of daily backups to keep. Older backups will be removed.
- keep_
hourly int - The number of hourly backups to keep. Older backups will be removed.
- keep_
last int - Specifies the number of the most recent backups to keep, regardless of their age.
- keep_
monthly int - The number of monthly backups to keep. Older backups will be removed.
- keep_
weekly int - The number of weekly backups to keep. Older backups will be removed.
- keep_
yearly int - The number of yearly backups to keep. Older backups will be removed.
- max_
protected_ intbackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
- keep
All Boolean - Specifies if all backups should be kept, regardless of their age. When set to true, other keep_* attributes must not be set.
- keep
Daily Number - The number of daily backups to keep. Older backups will be removed.
- keep
Hourly Number - The number of hourly backups to keep. Older backups will be removed.
- keep
Last Number - Specifies the number of the most recent backups to keep, regardless of their age.
- keep
Monthly Number - The number of monthly backups to keep. Older backups will be removed.
- keep
Weekly Number - The number of weekly backups to keep. Older backups will be removed.
- keep
Yearly Number - The number of yearly backups to keep. Older backups will be removed.
- max
Protected NumberBackups - The maximum number of protected backups per guest. Use '-1' for unlimited.
Package Details
- Repository
- proxmoxve muhlba91/pulumi-proxmoxve
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
proxmoxTerraform Provider.
