ovirt_storage_domain – Module to manage storage domains in oVirt/RHV¶
Requirements¶
The below requirements are needed on the host that executes this module.
- python >= 2.7
- ovirt-engine-sdk-python >= 4.3.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.3.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_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_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_storage_domain:
    name: data_localfs
    host: myhost
    data_center: mydatacenter
    localfs:
      path: /path/to/data
# Add data iSCSI storage domain:
- 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_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_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_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_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_storage_domain:
    state: imported
    name: data_fcp
    host: myhost
    data_center: mydatacenter
    fcp: {}
# Update OVF_STORE:
- ovirt_storage_domain:
    state: update_ovf_store
    name: domain
# Create ISO NFS storage domain
- 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_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_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:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Ondra Machacek (@machacekondra)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
