ngine_io / ngine_io.cloudstack / 2.3.0 / module / cs_volume Manages volumes on Apache CloudStack based clouds. | "added in version" 0.1.0 of ngine_io.cloudstack" Authors: Jefferson Girão (@jeffersongirao), René Moser (@resmo)ngine_io.cloudstack.cs_volume (2.3.0) — module
Install with ansible-galaxy collection install ngine_io.cloudstack:==2.3.0
collections: - name: ngine_io.cloudstack version: 2.3.0
Create, destroy, attach, detach, extract or upload volumes.
- name: create volume within project and zone with specified storage options ngine_io.cloudstack.cs_volume: name: web-vm-1-volume project: Integration zone: ch-zrh-ix-01 disk_offering: PerfPlus Storage size: 20
- name: create/attach volume to instance ngine_io.cloudstack.cs_volume: name: web-vm-1-volume zone: zone01 disk_offering: PerfPlus Storage size: 20 vm: web-vm-1 state: attached
- name: detach volume ngine_io.cloudstack.cs_volume: name: web-vm-1-volume zone: zone01 state: detached
- name: remove volume ngine_io.cloudstack.cs_volume: name: web-vm-1-volume zone: zone01 state: absent
- name: Extract DATA volume to make it downloadable ngine_io.cloudstack.cs_volume: state: extracted name: web-vm-1-volume zone: zone01 register: data_vol_out
- name: Create new volume by downloading source volume ngine_io.cloudstack.cs_volume: state: uploaded name: web-vm-1-volume-2 zone: zone01 format: VHD url: "{{ data_vol_out.url }}"
vm: description: - Name of the virtual machine to attach the volume to. type: str url: description: - URL to which the volume would be extracted on I(state=extracted) - or the URL where to download the volume on I(state=uploaded). - Only considered if I(state) is C(extracted) or C(uploaded). type: str mode: choices: - http_download - ftp_upload default: http_download description: - Mode for the volume extraction. - Only considered if I(state=extracted). type: str name: description: - Name of the volume. - I(name) can only contain ASCII letters. required: true type: str size: description: - Size of disk in GB type: int tags: aliases: - tag description: - List of tags. Tags are a list of dictionaries having keys I(key) and I(value). - 'To delete all tags, set a empty list e.g. I(tags: []).' elements: dict type: list zone: description: - Name of the zone in which the volume should be deployed. required: true type: str force: default: false description: - Force removal of volume even it is attached to a VM. - Considered on I(state=absent) only. type: bool state: choices: - present - absent - attached - detached - extracted - uploaded default: present description: - State of the volume. type: str domain: description: - Name of the domain the volume to be deployed in. type: str format: choices: - QCOW2 - RAW - VHD - VHDX - OVA description: - The format for the volume. - Only considered if I(state=uploaded). type: str account: description: - Account the volume is related to. type: str api_key: description: - API key of the CloudStack API. - If not given, the C(CLOUDSTACK_KEY) env variable is considered. required: true 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. required: true type: str project: description: - Name of the project the volume to be deployed in. type: str max_iops: description: - Max iops type: int min_iops: description: - Min iops type: int snapshot: description: - The snapshot name for the disk volume. - Required one of I(disk_offering), I(snapshot) if volume is not already I(state=present). type: str custom_id: description: - Custom id to the resource. - Allowed to Root Admins only. type: str device_id: description: - ID of the device on a VM the volume is attached to. - Only considered if I(state) is C(attached). type: int shrink_ok: default: false description: - Whether to allow to shrink the volume. type: bool api_secret: description: - Secret key of the CloudStack API. - If not set, the C(CLOUDSTACK_SECRET) env variable is considered. required: true type: str poll_async: default: true description: - Poll async jobs until job has finished. type: bool api_timeout: default: 10 description: - HTTP timeout in seconds. - If not given, the C(CLOUDSTACK_TIMEOUT) env variable is considered. type: int disk_offering: description: - Name of the disk offering to be used. - Required one of I(disk_offering), I(snapshot) if volume is not already I(state=present). type: str display_volume: description: - Whether to display the volume to the end user or not. - Allowed to Root Admins only. type: bool api_http_method: choices: - get - post default: get description: - HTTP method used to query the API endpoint. - If not given, the C(CLOUDSTACK_METHOD) env variable is considered. type: str api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
attached: description: Date of the volume was attached. returned: success sample: 2014-12-01T14:57:57+0100 type: str created: description: Date of the volume was created. returned: success sample: 2014-12-01T14:57:57+0100 type: str device_id: description: Id of the device on user vm the volume is attached to (not returned when detached) returned: success sample: 1 type: int display_name: description: Display name of the volume. returned: success sample: web-volume-01 type: str domain: description: Domain the volume belongs to returned: success sample: example domain type: str group: description: Group the volume belongs to returned: success sample: web type: str id: description: ID of the volume. returned: success sample: null type: str name: description: Name of the volume. returned: success sample: web-volume-01 type: str project: description: Project the volume belongs to returned: success sample: Production type: str size: description: Size of disk volume. returned: success sample: 20 type: int state: description: State of the volume returned: success sample: Attached type: str type: description: Disk volume type. returned: success sample: DATADISK type: str url: description: The url of the uploaded volume or the download url depending extraction mode. returned: success when I(state=extracted) sample: http://1.12.3.4/userdata/387e2c7c-7c42-4ecc-b4ed-84e8367a1965.vhd type: str vm: description: Name of the vm the volume is attached to (not returned when detached) returned: success sample: web-01 type: str zone: description: Name of zone the volume is in. returned: success sample: ch-gva-2 type: str