ovirt.ovirt.ovirt_storage_domain – Module to manage storage domains in oVirt/RHV¶
Note
This plugin is part of the ovirt.ovirt collection (version 1.3.0).
To install it use: ansible-galaxy collection install ovirt.ovirt
.
To use it in a playbook, specify: ovirt.ovirt.ovirt_storage_domain
.
New in version 1.0.0: of ovirt.ovirt
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.7
ovirt-engine-sdk-python >= 4.4.0
Parameters¶
Notes¶
Note
In order to use this module you have to install oVirt Python SDK. To ensure it’s installed with correct version you can create the following task: pip: name=ovirt-engine-sdk-python version=4.4.0
Examples¶
# Examples don't contain auth parameter for simplicity,
# look at ovirt_auth module to see how to reuse authentication:
# Add data NFS storage domain
- ovirt.ovirt.ovirt_storage_domain:
name: data_nfs
host: myhost
data_center: mydatacenter
nfs:
address: 10.34.63.199
path: /path/data
# Add data NFS storage domain with id for data center
- ovirt.ovirt.ovirt_storage_domain:
name: data_nfs
host: myhost
data_center: 11111
nfs:
address: 10.34.63.199
path: /path/data
mount_options: noexec,nosuid
# Add data localfs storage domain
- ovirt.ovirt.ovirt_storage_domain:
name: data_localfs
host: myhost
data_center: mydatacenter
localfs:
path: /path/to/data
# Add data iSCSI storage domain:
- ovirt.ovirt.ovirt_storage_domain:
name: data_iscsi
host: myhost
data_center: mydatacenter
iscsi:
target: iqn.2016-08-09.domain-01:nickname
lun_id:
- 1IET_000d0001
- 1IET_000d0002
address: 10.34.63.204
discard_after_delete: True
backup: False
critical_space_action_blocker: 5
warning_low_space: 10
# Since Ansible 2.5 you can specify multiple targets for storage domain,
# Add data iSCSI storage domain with multiple targets:
- ovirt.ovirt.ovirt_storage_domain:
name: data_iscsi
host: myhost
data_center: mydatacenter
iscsi:
target_lun_map:
- target: iqn.2016-08-09.domain-01:nickname
lun_id: 1IET_000d0001
- target: iqn.2016-08-09.domain-02:nickname
lun_id: 1IET_000d0002
address: 10.34.63.204
discard_after_delete: True
# Add data glusterfs storage domain
- ovirt.ovirt.ovirt_storage_domain:
name: glusterfs_1
host: myhost
data_center: mydatacenter
glusterfs:
address: 10.10.10.10
path: /path/data
# Create export NFS storage domain:
- ovirt.ovirt.ovirt_storage_domain:
name: myexportdomain
domain_function: export
host: myhost
data_center: mydatacenter
nfs:
address: 10.34.63.199
path: /path/export
wipe_after_delete: False
backup: True
critical_space_action_blocker: 2
warning_low_space: 5
# Import export NFS storage domain:
- ovirt.ovirt.ovirt_storage_domain:
state: imported
domain_function: export
host: myhost
data_center: mydatacenter
nfs:
address: 10.34.63.199
path: /path/export
# Import FCP storage domain:
- ovirt.ovirt.ovirt_storage_domain:
state: imported
name: data_fcp
host: myhost
data_center: mydatacenter
fcp: {}
# Update OVF_STORE:
- ovirt.ovirt.ovirt_storage_domain:
state: update_ovf_store
name: domain
# Create ISO NFS storage domain
- ovirt.ovirt.ovirt_storage_domain:
name: myiso
domain_function: iso
host: myhost
data_center: mydatacenter
nfs:
address: 10.34.63.199
path: /path/iso
# Create managed storage domain
# Available from ovirt 4.3 and ansible 2.9
- ovirt.ovirt.ovirt_storage_domain:
name: my_managed_domain
host: myhost
data_center: mydatacenter
managed_block_storage:
driver_options:
- name: rbd_pool
value: pool1
- name: rbd_user
value: admin
- name: volume_driver
value: cinder.volume.drivers.rbd.RBDDriver
- name: rbd_keyring_conf
value: /etc/ceph/keyring
driver_sensitive_options:
- name: secret_password
value: password
# Remove storage domain
- ovirt.ovirt.ovirt_storage_domain:
state: absent
name: mystorage_domain
format: true
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Ondra Machacek (@machacekondra)
Martin Necas (@mnecas)