cs_storage_pool - Manages Primary Storage Pools on Apache CloudStack based clouds.

New in version 2.4.

Synopsis

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

Requirements (on host that executes module)

  • python >= 2.6
  • cs >= 0.6.10

Options

parameter required default choices comments
allocation_state
no
  • enabled
  • disabled
Allocation state of the storage pool.
api_http_method
no get
  • get
  • post
HTTP method used.
api_key
no
API key of the CloudStack API.
api_region
no cloudstack
Name of the ini section in the cloustack.ini file.
api_secret
no
Secret key of the CloudStack API.
api_timeout
no 10
HTTP timeout.
api_url
no
URL of the CloudStack API e.g. https://cloud.example.com/client/api.
capacity_bytes
no
Bytes CloudStack can provision from this storage pool.
capacity_iops
no
Bytes CloudStack can provision from this storage pool.
cluster
no
Name of the cluster.
hypervisor
no
  • KVM
  • VMware
  • BareMetal
  • XenServer
  • LXC
  • HyperV
  • UCS
  • OVM
  • Simulator
Required when creating a zone scoped pool.
managed
no
Whether the storage pool should be managed by CloudStack.
Only considere on creation.
name
yes
Name of the storage pool.
pod
no
Name of the pod.
provider
no DefaultPrimary
Name of the storage provider e.g. SolidFire, SolidFireShared, DefaultPrimary, CloudByte.
scope
no
  • cluster
  • zone
The scope of the storage pool.
Defaults to cluster when cluster is provided, otherwise zone.
state
no present
  • present
  • absent
State of the storage pool.
storage_tags
no
Tags associated with this storage pool.
storage_url
no
URL of the storage pool.
Required if state=present.
zone
no
Name of the zone in which the host should be deployed.
If not set, default zone is used.

Examples

- name: ensure a zone scoped storage_pool is present
  local_action:
    module: 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
  local_action:
    module: cs_storage_pool
    name: Ceph RBD
    zone: zone01
    cluster: cluster01
    pod: pod01
    storage_url: rbd://admin:[email protected]/poolname
    provider: DefaultPrimary
    name: Ceph RBD
    scope: cluster
    allocation_state: disabled

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

- name: ensure a storage_pool is absent
  local_action:
    module: cs_storage_pool
    name: Ceph RBD
    state: absent

Return Values

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

name description returned type sample
allocation_state
The state of the storage pool.
success string enabled
capacity_iops
IOPS CloudStack can provision from this storage pool
when available int 60000
cluster
The name of the cluster.
when scope is cluster string Cluster01
created
Date of the pool was created.
success string 2014-12-01T14:57:57+0100
disk_size_allocated
The pool's currently allocated disk space.
success int 2443517624320
disk_size_total
The total size of the pool.
success int 3915055693824
disk_size_used
The pool's currently used disk size.
success int 1040862622180
hypervisor
Hypervisor related to this storage pool.
when available string KVM
id
UUID of the pool.
success string a3fca65a-7db1-4891-b97c-48806a978a96
overprovision_factor
The overprovision factor of the storage pool.
success string 2.0
path
The storage pool path used in the storage_url.
success string poolname
pod
The name of the pod.
when scope is cluster string Cluster01
scope
The scope of the storage pool.
success string cluster
state
The state of the storage pool as returned by the API.
success string Up
storage_capabilities
Capabilities of the torage pool.
success dict {'VOLUME_SNAPSHOT_QUIESCEVM': 'false'}
storage_tags
the tags for the storage pool.
success list ['perf', 'ssd']
suitable_for_migration
Whether the storage pool is suitable to migrate a volume or not.
success bool False
zone
The name of the zone.
success string Zone01

Notes

Note

  • Ansible uses the cs library’s configuration method if credentials are not provided by the arguments api_url, api_key, api_secret. Configuration is read from several locations, in the following order. - The CLOUDSTACK_ENDPOINT, CLOUDSTACK_KEY, CLOUDSTACK_SECRET and CLOUDSTACK_METHOD. CLOUDSTACK_TIMEOUT environment variables. - A CLOUDSTACK_CONFIG environment variable pointing to an .ini file, - A cloudstack.ini file in the current working directory. - A .cloudstack.ini file in the users home directory. Optionally multiple credentials and endpoints can be specified using ini sections in cloudstack.ini. Use the argument api_region to select the section name, default section is cloudstack. See https://github.com/exoscale/cs for more information.
  • A detailed guide about cloudstack modules can be found on http://docs.ansible.com/ansible/guide_cloudstack.html
  • This module supports check mode.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

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