community.proxmox.proxmox_storage module – Manage storage in PVE clusters and nodes
Note
This module is part of the community.proxmox collection (version 2.0.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 |
|
Path to a local certificate, which will be used to verify TLS connections. Ignored if |
|
Extended information for adding CephFS storage. |
|
The client keyring to be used. |
|
The Ceph filesystem name |
|
The hostname or IP address of the monhost. |
|
The password for the storage system. |
|
The path to be used within the CephFS. Default: |
|
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. |
|
The required password for the storage system. |
|
The preallocation mode for raw and qcow2 images. |
|
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. |
|
The required path of the direcotry on the node(s). |
|
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. |
|
The name of the storage displayed in the storage list. |
|
Extended information for adding NFS storage. |
|
The required path of the NFS export. |
|
The options to pass to the NFS service. (e.g., version, pNFS). |
|
The preallocation mode for raw and qcow2 images. |
|
The required IP address or DNS name of the NFS server. |
|
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. |
|
The namespace to use from the Proxmox Backup Server. |
|
The required password for the Proxmox Backup Server. |
|
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 required RBD pool name. |
|
The state of the defined storage type to perform. Choices:
|
|
The storage type/protocol to use when adding the storage. 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 storage. |
|
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: none |
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"
export: "/mnt/storage01/b01pbs01"
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
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: |