community.proxmox.proxmox_storage module – Manage storage in PVE clusters and nodes
Note
This module is part of the community.proxmox collection (version 2.1.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.proxmox.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.proxmox.proxmox_storage.
New in community.proxmox 1.3.0
Synopsis
Manage storage in PVE clusters and nodes.
Requirements
The below requirements are needed on the host that executes this module.
proxmoxer >= 2.3
requests
Parameters
Parameter |
Comments |
|---|---|
Specify the target host of the Proxmox VE cluster. Uses the |
|
Specify the OTP. Uses the |
|
Specify the password to authenticate with. Uses the |
|
Specify the target port of the Proxmox VE cluster. Uses the |
|
Time limit for requests towards the Proxmox VE API. Default: |
|
Specify the token ID. Uses the |
|
Specify the token secret. Uses the |
|
Specify the user to authenticate with. Uses the Default: |
|
Extended information for adding BTRFS storage. |
|
Default image format Choices:
|
|
Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted. Using a Default: |
|
Maximal number of protected backups per guest. Use -1 for unlimited. |
|
Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system. Choices:
|
|
The required path of the directory on the node(s). |
|
Preallocation mode for raw and qcow2 images on file-based storages. The default is Choices:
|
|
Retention options for backups. For details, see Backup Retention. See https://pve.proxmox.com/pve-docs/vzdump.1.html#vzdump_retention for an overview. |
|
Set I/O bandwidth limit for various operations (in KiB/s). Format for bwlimit is |
|
Path to a local certificate, which will be used to verify TLS connections. Ignored if |
|
Extended information for adding CephFS storage. |
|
Default image format Choices:
|
|
The Ceph filesystem name |
|
Mount CephFS through FUSE. Choices:
|
|
The client keyring to be used. |
|
Maximal number of protected backups per guest. Use -1 for unlimited. |
|
The hostname or IP address of the monhost. |
|
The options to pass to the CephFS mount. |
|
The password for the storage system. |
|
The path to be used within the CephFS. Default: |
|
Retention options for backups. For details, see Backup Retention. See https://pve.proxmox.com/pve-docs/vzdump.1.html#vzdump_retention for an overview. |
|
The subdir to be used within the CephFS. The Proxmox default is ‘/’. |
|
The username for the storage system. |
|
Extended information for adding CIFS storage. |
|
The required domain for the CIFS share. |
|
Default image format Choices:
|
|
Maximal number of protected backups per guest. Use -1 for unlimited. |
|
The options to pass to the CIFS mount. |
|
The required password for the storage system. |
|
The mount path of the directory on the node(s). |
|
Preallocation mode for raw and qcow2 images. The default is Choices:
|
|
Retention options for backups. For details, see Backup Retention. See https://pve.proxmox.com/pve-docs/vzdump.1.html#vzdump_retention for an overview. |
|
The required hostname or IP address of the remote storage system. |
|
The required share to be used from the remote storage system. |
|
The minimum SMB version to use for. |
|
Enable support for creating snapshots through volume backing-chains. Choices:
|
|
The subdir to be used within the CIFS. |
|
The required username for the storage system. |
|
The content types that can be stored on this storage.
Choices:
|
|
Extended information for adding Directory storage. |
|
Default image format Choices:
|
|
Assume the given path is an externally managed mountpoint and consider the storage offline if it is not mounted. Using a Default: |
|
Maximal number of protected backups per guest. Use -1 for unlimited. |
|
The required path of the direcotry on the node(s). |
|
Preallocation mode for raw and qcow2 images. The default is Choices:
|
|
Retention options for backups. For details, see Backup Retention. See https://pve.proxmox.com/pve-docs/vzdump.1.html#vzdump_retention for an overview. |
|
Enable support for creating snapshots through volume backing-chains. Choices:
|
|
Flag to disable the storage. Choices:
|
|
Extended information for adding ESXi storage. |
|
The password for the ESXi system. |
|
Use this port to connect to the storage instead of the default one. |
|
The required hostname or IP address of the remote ESXi system. |
|
Disable TLS certificate verification, only enable on fully trusted networks. Choices:
|
|
The required username for the ESXi system. |
|
Extended information for adding iSCSI storage. |
|
The required hostname or IP address of the remote storage system as the portal address. |
|
The required iSCSI target. |
|
Extended information for adding iSCSI storage. |
|
The required hostname or IP address of the remote storage system as the portal address. |
|
The required iSCSI target. |
|
Extended information for adding LVM storage. |
|
The base volume. This is mostly useful when the LVM volume group resides on a remote iSCSI server. |
|
Called “Wipe Removed Volumes” in the web UI. Zero-out data when removing LVs. Choices:
|
|
Wipe step size in MiB. Choices:
|
|
Wipe throughput (cstream -t parameter value), up to 10 MiB/s by default. |
|
Enable support for creating snapshots through volume backing-chains. Choices:
|
|
Only list logical volumes tagged with Choices:
|
|
The required LVM volume group name. This must point to an existing volume group. |
|
Extended information for adding LVM-Thin storage. |
|
The required name of the LVM thin pool. |
|
The required LVM volume group name. This must point to an existing volume group. |
|
The name of the storage displayed in the storage list. |
|
Extended information for adding NFS storage. |
|
The required path of the NFS export. |
|
Default image format Choices:
|
|
Maximal number of protected backups per guest. Use -1 for unlimited. |
|
The options to pass to the NFS service. (e.g., version, pNFS). |
|
The mount path of the directory on the node(s). |
|
Preallocation mode for raw and qcow2 images. The default is Choices:
|
|
Retention options for backups. For details, see Backup Retention. See https://pve.proxmox.com/pve-docs/vzdump.1.html#vzdump_retention for an overview. |
|
The required IP address or DNS name of the NFS server. |
|
Enable support for creating snapshots through volume backing-chains. Choices:
|
|
A list of nodes where this storage is available. Required when |
|
Extended information for adding Proxmox Backup Server as storage. |
|
The required datastore to use from the Proxmox Backup Server. |
|
An existing encryption key for the datastore. Use Must be provided as a JSON-encoded string. |
|
The fingerprint of the Proxmox Backup Server system. |
|
Base64-encoded, PEM-formatted public RSA key. Used to encrypt a copy of the encryption-key which will be added to each encrypted backup. |
|
The namespace to use from the Proxmox Backup Server. |
|
The required password for the Proxmox Backup Server. |
|
Use this port to connect to the storage instead of the default one. |
|
The hostname or IP address of the Proxmox Backup Server. |
|
The required username for the Proxmox Backup Server. |
|
Extended information for adding RBD storage. |
|
The Data Pool (for erasure coding only). |
|
The client keyring to be used (for external clusters). |
|
Always access rbd through krbd kernel module. Choices:
|
|
The hostname or IP address of the monhost (for external clusters). |
|
The RBD Namespace. |
|
The required RBD pool name. |
|
The RBD Id. |
|
Indicate that this is a single storage with the same contents on all nodes (or all listed in the Choices:
|
|
The state of the defined storage type to perform. Choices:
|
|
The storage type/protocol to use when adding the storage. Choices:
|
|
If Choices:
|
|
Validate the TLS certificates used for the connection to the Proxmox VE API. May be set through the environment variable Choices:
|
|
Extended information for adding ZFS over iSCSI storage. |
|
The ZFS blocksize parameter. A power of 2 with optional |
|
The host group for comstar views. Only for |
|
The target group for comstar views. Only for |
|
The iSCSI target implementation used on the remote machine.
Choices:
|
|
The target portal group for Linux LIO targets. Only for |
|
Disable write caching on the target. Choices:
|
|
The required name of the ZFS pool to use. |
|
The required hostname or IP address of the remote storage system as the portal address. |
|
Use ZFS thin-provisioning. Choices:
|
|
The required iSCSI target. |
|
Base path where to look for the created ZFS block devices. Set automatically during creation if not specified. Usually |
|
Extended information for adding ZFS storage. |
|
The ZFS blocksize parameter. A power of 2 with optional k or m suffix. |
|
The mount point of the ZFS pool/filesystem. |
|
The required name of the ZFS pool to use. |
|
Use ZFS thin-provisioning. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Action group: community.proxmox.proxmox |
Use |
|
Support: full |
Can run in |
|
Support: full |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- Authentication
Complete guide for the Proxmox API authentication
Examples
- name: Add PBS storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
nodes: ["de-cgn01-virt01", "de-cgn01-virt02"]
state: present
name: backup-backupserver01
type: pbs
pbs_options:
server: proxmox-backup-server.example.com
username: backup@pbs
password: password123
datastore: backup
fingerprint: "F3:04:D2:C1:33:B7:35:B9:88:D8:7A:24:85:21:DC:75:EE:7C:A5:2A:55:2D:99:38:6B:48:5E:CA:0D:E3:FE:66"
content: ["backup"]
- name: Add NFS storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
nodes: ["de-cgn01-virt01", "de-cgn01-virt02"]
state: present
name: net-nfsshare01
type: nfs
nfs_options:
server: 10.10.10.94
export: "/mnt/storage01/s01nfs01"
content: ["rootdir", "images"]
- name: Add iSCSI storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
nodes: ["de-cgn01-virt01", "de-cgn01-virt02", "de-cgn01-virt03"]
state: present
type: iscsi
name: net-iscsi01
iscsi_options:
portal: 10.10.10.94
target: "iqn.2005-10.org.freenas.ctl:s01-isci01"
content: ["rootdir", "images"]
- name: Remove storage from Proxmox VE Cluster
community.proxmox.proxmox_storage:
state: absent
name: net-nfsshare01
type: nfs
- name: Add ZFS storage to Proxmox VE Cluster
community.proxmox.proxmox_storage:
state: present
name: zfspool-storage
type: zfspool
content: ["rootdir", "images"]
zfspool_options:
pool: rpool/data
sparse: true
- name: Update ZFS storage on Proxmox VE Cluster
community.proxmox.proxmox_storage:
state: present
name: zfspool-storage
type: zfspool
content: ["images"]
zfspool_options:
pool: rpool/data
sparse: true
update: true
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Status message about the storage action. Returned: success Sample: |