UNPKG

@muhlba91/pulumi-proxmoxve

Version:

A Pulumi package for creating and managing Proxmox Virtual Environment cloud resources.

227 lines 9.53 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../../types/input"; import * as outputs from "../../types/output"; /** * Manages a ZFS pool (zpool) on a Proxmox VE node. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as proxmoxve from "@muhlba91/pulumi-proxmoxve"; * * const example = new proxmoxve.node.disk.Zfs("example", { * nodeName: "pve", * name: "tank", * devices: [ * "/dev/sdb", * "/dev/sdc", * ], * raidlevel: "mirror", * ashift: 12, * compression: "lz4", * addStorage: true, * cleanupConfig: true, * cleanupDisks: false, * }); * ``` * * ## Device Reuse After Destroy * * When `cleanupDisks = true`, Proxmox wipes the contents of each ZFS member partition * (e.g. `/dev/nvme0n1p1`) but leaves the parent disk's GPT partition table intact. * If you destroy a pool and immediately recreate it on the same device, the create may * fail with _"device is already in use"_. * * To fully prepare the device for reuse after destroy, run on the Proxmox node: * * ```sh * wipefs -a /dev/nvme0n1 * partprobe /dev/nvme0n1 * ``` * * Replace `/dev/nvme0n1` with the actual disk device (not the partition). * * ## Import * * !/usr/bin/env sh * ZFS pools can be imported using the format `node_name/pool_name`, e.g.: * * ```sh * $ pulumi import proxmoxve:node/disk/zfs:Zfs example pve/tank * ``` * * > **Note on import:** The write-only attributes `devices`, `raidlevel`, `ashift`, `compression`, `draidConfig`, and `addStorage` cannot be reconstructed from the Proxmox API and must be added to the configuration manually after import. Once added, the next `pulumi up` will record them in state without replacing the pool. */ export declare class Zfs extends pulumi.CustomResource { /** * Get an existing Zfs 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<pulumi.ID>, state?: ZfsState, opts?: pulumi.CustomResourceOptions): Zfs; /** * Returns true if the given object is an instance of Zfs. 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 Zfs; /** * Configure a Proxmox storage entry using this zpool after creation. Applied at create time only. */ readonly addStorage: pulumi.Output<boolean | undefined>; /** * Pool sector size exponent (2^ashift bytes). Defaults to `12` (4 KiB sectors) server-side. */ readonly ashift: pulumi.Output<number | undefined>; /** * On destroy, mark associated Proxmox storage entries as unavailable (or remove them if configured for this node only). Defaults to `false`. */ readonly cleanupConfig: pulumi.Output<boolean>; /** * On destroy, wipe the ZFS member partitions so they can be reused. Defaults to `false`. Note: Proxmox wipes the partition contents but leaves the parent disk's GPT partition table intact. If you plan to reuse the same device immediately, run `wipefs -a <disk>` and `partprobe <disk>` on the node after destroy. */ readonly cleanupDisks: pulumi.Output<boolean>; /** * The compression algorithm for the pool. One of `on`, `off`, `gzip`, `lz4`, `lzjb`, `zle`, `zstd`. Defaults to `on` server-side. */ readonly compression: pulumi.Output<string | undefined>; /** * The block devices to use for the ZFS pool (e.g. `["/dev/sdb", "/dev/sdc"]`). */ readonly devices: pulumi.Output<string[]>; /** * dRAID configuration. Required when `raidlevel` is `draid`, `draid2`, or `draid3`. */ readonly draidConfig: pulumi.Output<outputs.node.disk.ZfsDraidConfig | undefined>; /** * Error information reported by the ZFS pool. */ readonly errors: pulumi.Output<string>; /** * The name of the ZFS pool (storage identifier). */ readonly name: pulumi.Output<string>; /** * The name of the Proxmox node on which to create the ZFS pool. */ readonly nodeName: pulumi.Output<string>; /** * The RAID level for the ZFS pool. One of `single`, `mirror`, `raid10`, `raidz`, `raidz2`, `raidz3`, `draid`, `draid2`, `draid3`. */ readonly raidlevel: pulumi.Output<string>; /** * The current state of the ZFS pool (e.g. `ONLINE`, `DEGRADED`). */ readonly state: pulumi.Output<string>; /** * Create a Zfs 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: ZfsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Zfs resources. */ export interface ZfsState { /** * Configure a Proxmox storage entry using this zpool after creation. Applied at create time only. */ addStorage?: pulumi.Input<boolean | undefined>; /** * Pool sector size exponent (2^ashift bytes). Defaults to `12` (4 KiB sectors) server-side. */ ashift?: pulumi.Input<number | undefined>; /** * On destroy, mark associated Proxmox storage entries as unavailable (or remove them if configured for this node only). Defaults to `false`. */ cleanupConfig?: pulumi.Input<boolean | undefined>; /** * On destroy, wipe the ZFS member partitions so they can be reused. Defaults to `false`. Note: Proxmox wipes the partition contents but leaves the parent disk's GPT partition table intact. If you plan to reuse the same device immediately, run `wipefs -a <disk>` and `partprobe <disk>` on the node after destroy. */ cleanupDisks?: pulumi.Input<boolean | undefined>; /** * The compression algorithm for the pool. One of `on`, `off`, `gzip`, `lz4`, `lzjb`, `zle`, `zstd`. Defaults to `on` server-side. */ compression?: pulumi.Input<string | undefined>; /** * The block devices to use for the ZFS pool (e.g. `["/dev/sdb", "/dev/sdc"]`). */ devices?: pulumi.Input<pulumi.Input<string>[] | undefined>; /** * dRAID configuration. Required when `raidlevel` is `draid`, `draid2`, or `draid3`. */ draidConfig?: pulumi.Input<inputs.node.disk.ZfsDraidConfig | undefined>; /** * Error information reported by the ZFS pool. */ errors?: pulumi.Input<string | undefined>; /** * The name of the ZFS pool (storage identifier). */ name?: pulumi.Input<string | undefined>; /** * The name of the Proxmox node on which to create the ZFS pool. */ nodeName?: pulumi.Input<string | undefined>; /** * The RAID level for the ZFS pool. One of `single`, `mirror`, `raid10`, `raidz`, `raidz2`, `raidz3`, `draid`, `draid2`, `draid3`. */ raidlevel?: pulumi.Input<string | undefined>; /** * The current state of the ZFS pool (e.g. `ONLINE`, `DEGRADED`). */ state?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a Zfs resource. */ export interface ZfsArgs { /** * Configure a Proxmox storage entry using this zpool after creation. Applied at create time only. */ addStorage?: pulumi.Input<boolean | undefined>; /** * Pool sector size exponent (2^ashift bytes). Defaults to `12` (4 KiB sectors) server-side. */ ashift?: pulumi.Input<number | undefined>; /** * On destroy, mark associated Proxmox storage entries as unavailable (or remove them if configured for this node only). Defaults to `false`. */ cleanupConfig?: pulumi.Input<boolean | undefined>; /** * On destroy, wipe the ZFS member partitions so they can be reused. Defaults to `false`. Note: Proxmox wipes the partition contents but leaves the parent disk's GPT partition table intact. If you plan to reuse the same device immediately, run `wipefs -a <disk>` and `partprobe <disk>` on the node after destroy. */ cleanupDisks?: pulumi.Input<boolean | undefined>; /** * The compression algorithm for the pool. One of `on`, `off`, `gzip`, `lz4`, `lzjb`, `zle`, `zstd`. Defaults to `on` server-side. */ compression?: pulumi.Input<string | undefined>; /** * The block devices to use for the ZFS pool (e.g. `["/dev/sdb", "/dev/sdc"]`). */ devices: pulumi.Input<pulumi.Input<string>[]>; /** * dRAID configuration. Required when `raidlevel` is `draid`, `draid2`, or `draid3`. */ draidConfig?: pulumi.Input<inputs.node.disk.ZfsDraidConfig | undefined>; /** * The name of the ZFS pool (storage identifier). */ name?: pulumi.Input<string | undefined>; /** * The name of the Proxmox node on which to create the ZFS pool. */ nodeName: pulumi.Input<string>; /** * The RAID level for the ZFS pool. One of `single`, `mirror`, `raid10`, `raidz`, `raidz2`, `raidz3`, `draid`, `draid2`, `draid3`. */ raidlevel: pulumi.Input<string>; } //# sourceMappingURL=zfs.d.ts.map