community.general.cs_storage_pool (0.1.1) — module

Manages Primary Storage Pools on Apache CloudStack based clouds.

Authors: Netservers Ltd. (@netservers), René Moser (@resmo)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

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


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: ensure a zone scoped storage_pool is present
  cs_storage_pool:
    zone: zone01
    storage_url: rbd://admin:SECRET@ceph-mons.domain/poolname
    provider: DefaultPrimary
    name: Ceph RBD
    scope: zone
    hypervisor: KVM
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: ensure a cluster scoped storage_pool is disabled
  cs_storage_pool:
    name: Ceph RBD
    zone: zone01
    cluster: cluster01
    pod: pod01
    storage_url: rbd://admin:SECRET@ceph-the-mons.domain/poolname
    provider: DefaultPrimary
    scope: cluster
    allocation_state: disabled
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: ensure a cluster scoped storage_pool is in maintenance
  cs_storage_pool:
    name: Ceph RBD
    zone: zone01
    cluster: cluster01
    pod: pod01
    storage_url: rbd://admin:SECRET@ceph-the-mons.domain/poolname
    provider: DefaultPrimary
    scope: cluster
    allocation_state: maintenance
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: ensure a storage_pool is absent
  cs_storage_pool:
    name: Ceph RBD
    state: absent
  delegate_to: localhost

Inputs

    
pod:
    description:
    - Name of the pod.
    type: str

name:
    description:
    - Name of the storage pool.
    required: true
    type: str

zone:
    description:
    - Name of the zone in which the host should be deployed.
    - If not set, default zone is used.
    type: str

scope:
    choices:
    - cluster
    - zone
    description:
    - The scope of the storage pool.
    - Defaults to cluster when C(cluster) is provided, otherwise zone.
    type: str

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the storage pool.
    type: str

api_key:
    description:
    - API key of the CloudStack API.
    - If not given, the C(CLOUDSTACK_KEY) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

api_url:
    description:
    - URL of the CloudStack API e.g. https://cloud.example.com/client/api.
    - If not given, the C(CLOUDSTACK_ENDPOINT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

cluster:
    description:
    - Name of the cluster.
    type: str

managed:
    description:
    - Whether the storage pool should be managed by CloudStack.
    - Only considered on creation.
    type: bool

provider:
    default: DefaultPrimary
    description:
    - Name of the storage provider e.g. SolidFire, SolidFireShared, DefaultPrimary, CloudByte.
    type: str

api_region:
    default: cloudstack
    description:
    - Name of the ini section in the C(cloustack.ini) file.
    - If not given, the C(CLOUDSTACK_REGION) env variable is considered.
    type: str

api_secret:
    description:
    - Secret key of the CloudStack API.
    - If not set, the C(CLOUDSTACK_SECRET) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    type: str

hypervisor:
    description:
    - Required when creating a zone scoped pool.
    - Possible values are C(KVM), C(VMware), C(BareMetal), C(XenServer), C(LXC), C(HyperV),
      C(UCS), C(OVM), C(Simulator).
    type: str

api_timeout:
    description:
    - HTTP timeout in seconds.
    - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is 10 seconds if not specified.
    type: int

storage_url:
    description:
    - URL of the storage pool.
    - Required if I(state=present).
    type: str

storage_tags:
    aliases:
    - storage_tag
    description:
    - Tags associated with this storage pool.
    type: list

capacity_iops:
    description:
    - Bytes CloudStack can provision from this storage pool.
    type: int

capacity_bytes:
    description:
    - Bytes CloudStack can provision from this storage pool.
    type: int

api_http_method:
    choices:
    - get
    - post
    description:
    - HTTP method used to query the API endpoint.
    - If not given, the C(CLOUDSTACK_METHOD) env variable is considered.
    - As the last option, the value is taken from the ini config file, also see the notes.
    - Fallback value is C(get) if not specified.
    type: str

allocation_state:
    choices:
    - enabled
    - disabled
    - maintenance
    description:
    - Allocation state of the storage pool.
    type: str

Outputs

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