W3cubDocs

/Ansible

ngine_io.cloudstack.cs_storage_pool – Manages Primary Storage Pools on Apache CloudStack based clouds.

Note

This plugin is part of the ngine_io.cloudstack collection (version 2.2.2).

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 ngine_io.cloudstack.

To use it in a playbook, specify: ngine_io.cloudstack.cs_storage_pool.

New in version 0.1.0: of ngine_io.cloudstack

Synopsis

  • Create, update, put into maintenance, disable, enable and remove storage pools.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.6
  • cs >= 0.9.0

Parameters

Parameter Choices/Defaults Comments
allocation_state
string
    Choices:
  • enabled
  • disabled
  • maintenance
Allocation state of the storage pool.
api_http_method
string
    Choices:
  • get
  • post
HTTP method used to query the API endpoint.
If not given, the CLOUDSTACK_METHOD env variable is considered.
api_key
string / required
API key of the CloudStack API.
If not given, the CLOUDSTACK_KEY env variable is considered.
api_secret
string / required
Secret key of the CloudStack API.
If not set, the CLOUDSTACK_SECRET env variable is considered.
api_timeout
integer
Default:
10
HTTP timeout in seconds.
If not given, the CLOUDSTACK_TIMEOUT env variable is considered.
api_url
string / required
URL of the CloudStack API e.g. https://cloud.example.com/client/api.
If not given, the CLOUDSTACK_ENDPOINT env variable is considered.
api_verify_ssl_cert
string
Verify CA authority cert file.
If not given, the CLOUDSTACK_VERIFY env variable is considered.
capacity_bytes
integer
Bytes CloudStack can provision from this storage pool.
capacity_iops
integer
Bytes CloudStack can provision from this storage pool.
cluster
string
Name of the cluster.
hypervisor
string
Required when creating a zone scoped pool.
Possible values are KVM, VMware, BareMetal, XenServer, LXC, HyperV, UCS, OVM, Simulator.
managed
boolean
    Choices:
  • no
  • yes
Whether the storage pool should be managed by CloudStack.
Only considered on creation.
name
string / required
Name of the storage pool.
pod
string
Name of the pod.
provider
string
Default:
"DefaultPrimary"
Name of the storage provider e.g. SolidFire, SolidFireShared, DefaultPrimary, CloudByte.
scope
string
    Choices:
  • cluster
  • zone
The scope of the storage pool.
Defaults to cluster when cluster is provided, otherwise zone.
state
string
    Choices:
  • present
  • absent
State of the storage pool.
storage_tags
list / elements=string
Tags associated with this storage pool.

aliases: storage_tag
storage_url
string
URL of the storage pool.
Required if state=present.
zone
string / required
Name of the zone in which the host should be deployed.

Notes

Note

  • A detailed guide about cloudstack modules can be found in the CloudStack Cloud Guide.
  • This module supports check mode.

Examples

- name: ensure a zone scoped storage_pool is present
  ngine_io.cloudstack.cs_storage_pool:
    zone: zone01
    storage_url: rbd://admin:[email protected]/poolname
    provider: DefaultPrimary
    name: Ceph RBD
    scope: zone
    hypervisor: KVM

- name: ensure a cluster scoped storage_pool is disabled
  ngine_io.cloudstack.cs_storage_pool:
    name: Ceph RBD
    zone: zone01
    cluster: cluster01
    pod: pod01
    storage_url: rbd://admin:[email protected]/poolname
    provider: DefaultPrimary
    scope: cluster
    allocation_state: disabled

- name: ensure a cluster scoped storage_pool is in maintenance
  ngine_io.cloudstack.cs_storage_pool:
    name: Ceph RBD
    zone: zone01
    cluster: cluster01
    pod: pod01
    storage_url: rbd://admin:[email protected]/poolname
    provider: DefaultPrimary
    scope: cluster
    allocation_state: maintenance

- name: ensure a storage_pool is absent
  ngine_io.cloudstack.cs_storage_pool:
    name: Ceph RBD
    zone: zone01
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
allocation_state
string
success
The state of the storage pool.

Sample:
enabled
capacity_iops
integer
when available
IOPS CloudStack can provision from this storage pool

Sample:
60000
cluster
string
when scope is cluster
The name of the cluster.

Sample:
Cluster01
created
string
success
Date of the pool was created.

Sample:
2014-12-01T14:57:57+0100
disk_size_allocated
integer
success
The pool's currently allocated disk space.

Sample:
2443517624320
disk_size_total
integer
success
The total size of the pool.

Sample:
3915055693824
disk_size_used
integer
success
The pool's currently used disk size.

Sample:
1040862622180
hypervisor
string
when available
Hypervisor related to this storage pool.

Sample:
KVM
id
string
success
UUID of the pool.

Sample:
a3fca65a-7db1-4891-b97c-48806a978a96
overprovision_factor
string
success
The overprovision factor of the storage pool.

Sample:
2.0
path
string
success
The storage pool path used in the storage_url.

Sample:
poolname
pod
string
when scope is cluster
The name of the pod.

Sample:
Cluster01
scope
string
success
The scope of the storage pool.

Sample:
cluster
state
string
success
The state of the storage pool as returned by the API.

Sample:
Up
storage_capabilities
dictionary
success
Capabilities of the storage pool.

Sample:
{'VOLUME_SNAPSHOT_QUIESCEVM': 'false'}
storage_tags
list / elements=string
success
the tags for the storage pool.

Sample:
['perf', 'ssd']
suitable_for_migration
boolean
success
Whether the storage pool is suitable to migrate a volume or not.

zone
string
success
The name of the zone.

Sample:
Zone01


Authors

  • Netservers Ltd. (@netservers)
  • René Moser (@resmo)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ngine_io/cloudstack/cs_storage_pool_module.html