community.proxmox.proxmox_ceph_osd module – Manage osd.
Note
This module is part of the community.proxmox collection (version 1.6.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_ceph_osd.
New in community.proxmox 1.5.0
Synopsis
- This module allows you to add or delete an osd.
- You can also in, out or scrub an osd.
Requirements
The below requirements are needed on the host that executes this module.
- proxmoxer >= 2.0
- requests
Parameters
Parameter | Comments |
|---|---|
api_host string / required | Specify the target host of the Proxmox VE cluster. Uses the |
api_password string | Specify the password to authenticate with. Uses the |
api_port integer | Specify the target port of the Proxmox VE cluster. Uses the |
api_timeout integer | Time limit for requests towards the Proxmox VE API. Default: |
api_token_id string | Specify the token ID. Uses the |
api_token_secret string | Specify the token secret. Uses the |
api_user string / required | Specify the user to authenticate with. Uses the |
ca_path path | Path to a local certificate, which will be used to verify TLS connections. Ignored if |
cleanup boolean | |
crush_device_class string | Set the device class of the OSD in crush. Used with |
db_dev string | Block device name for block.db. Used with |
db_dev_size integer | If a block.db is requested but the size is not given, will be automatically selected by bluestore_block_db_size from the ceph database (osd or global section) or config (osd or global section) in that order. If this is not available, it will be sized 10% of the size of the OSD device. Fails if the available size is not enough. Used with |
deep boolean | If set, instructs a deep scrub instead of a normal one. Used with Choices:
|
dev string | Block device name. Required when |
encrypted boolean | |
node string / required | The cluster node name. |
osdid integer | Osd id. Required when |
osds_per_device integer | OSD services per physical device. Used with |
state string / required | create, delete, in, out or scrub Choices:
|
validate_certs boolean | Validate the TLS certificates used for the connection to the Proxmox VE API. Currently defaults to Uses the Choices:
|
wal_dev string | Block device name for block.wal. Used with |
wal_dev_size integer | If a block.wal is requested but the size is not given, will be automatically selected by bluestore_block_wal_size from the ceph database (osd or global section) or config (osd or global section) in that order. If this is not available, it will be sized 1% of the size of the OSD device. Fails if the available size is not enough. Used with |
Attributes
Attribute | Support | Description |
|---|---|---|
action_group | Action group: community.proxmox.proxmox | Use |
check_mode | Support: full This action does not modify state. | Can run in |
diff_mode | Support: none This action does not modify state. | Will return details on what has changed (or possibly needs changing in |
Examples
- name: Add an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
dev: /dev/sdb
state: present
- name: Delete an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
cleanup: true
state: absent
- name: Scrub an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
deep: true
state: scrub
- name: Out an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
state: out
- name: In an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
state: in
- name: Start an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
state: start
- name: Stop an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
state: stop
- name: Restart an osd
community.proxmox.proxmox_ceph_osd:
api_host: proxmox-01.example.com
api_user: root@pam
api_password: secret
node: proxmox-01
osdid: 2
state: restart
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
msg string | The output message that the module generates. Returned: always |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/community/proxmox/proxmox_ceph_osd_module.html