Skip to content

Resource: proxmox_storage_cephfs

Warning

Experimental. Schema and behavior may change in future releases. Pin the provider version if stability matters.

Manages a CephFS storage on the Proxmox VE cluster's own Ceph cluster. Proxmox mounts an enabled storage at /mnt/pve/<id> on each node it's available on. Storages on external Ceph clusters aren't supported yet.

Proxmox VE mounts an enabled storage on the node where it's created, and its status daemon keeps the storage mounted on every node the storage is available on. Mount options (options) take effect when Proxmox VE next mounts it.

Warning

Destroying or disabling the storage doesn't unmount it: the mount stays until it's unmounted with umount /mnt/pve/<id> on each node, or the node reboots. Changing fs_name, subdir or fuse replaces the storage, which likewise doesn't unmount the old one.

Example Usage

resource "proxmox_storage_cephfs" "example" {
  id      = "cephfs-templates"
  fs_name = "cephfs"

  content = ["backup", "iso", "vztmpl", "snippets"]
  options = "noatime"

  backups {
    keep_last = 3
  }
}

Schema

Required

  • id (String) The unique identifier of the storage.

Optional

  • backups (Block, Optional) Configure backup retention settings for the storage type. (see below for nested schema)
  • content (Set of String) The content types that can be stored on this storage. Valid values: backup (VM backups), import (VM disk images for import), iso (ISO images), snippets (cloud-init, hook scripts, etc.), vztmpl (container templates). Proxmox defaults to backup.
  • create_base_path (Boolean) Create the base directory if it doesn't exist.
  • create_subdirs (Boolean) Populate the directory with the default structure.
  • disable (Boolean) Whether the storage is disabled.
  • fs_name (String) The name of the CephFS to mount. Proxmox uses the cluster's default filesystem when unset.
  • fuse (Boolean) Whether to mount the filesystem through FUSE (ceph-fuse) instead of the kernel client.
  • nodes (Set of String) A list of nodes where this storage is available.
  • options (String) The mount options (see man mount.ceph). Proxmox applies them when it next mounts the storage.
  • subdir (String) The directory within the filesystem to mount. Proxmox mounts the filesystem's root when unset.

Read-Only

  • shared (Boolean) Whether the storage is shared across all nodes. Proxmox always shares CephFS storage.

Nested Schema for backups

Optional:

  • 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_backups (Number) The maximum number of protected backups per guest. Use '-1' for unlimited.

Import

Import is supported using the following syntax:

#!/usr/bin/env sh
# Storage can be imported using its identifier, e.g.:
terraform import proxmox_storage_cephfs.example cephfs-templates