cloudscale_ch.cloud.volume_snapshot module – Manage volume snapshots on the cloudscale.ch IaaS service
Note
This module is part of the cloudscale_ch.cloud collection (version 2.5.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 cloudscale_ch.cloud.
To use it in a playbook, specify: cloudscale_ch.cloud.volume_snapshot.
New in cloudscale_ch.cloud 2.5.0
Synopsis
- Get, create, update, delete volume snapshots on the cloudscale.ch IaaS service.
Parameters
Parameter | Comments |
|---|---|
api_timeout integer | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the Default: |
api_token string / required | cloudscale.ch API token. This can also be passed in the |
api_url string added in cloudscale_ch.cloud 1.3.0 | cloudscale.ch API URL. This can also be passed in the Default: |
name string | Name of the volume snapshot. Either name or uuid are required. |
source_volume string | UUID of the volume this snapshot belongs to. If name and source_volume are present, a new volume snapshot is created. This parameter has no effect on existing volume snapshots (uuid option is present). |
state string | State of the volume snapshot. Choices:
|
tags dictionary | Tags assigned to the volume snapshot. Set this to |
uuid string | UUID of the volume snapshot. |
Notes
Note
- If uuid option is provided, it takes precedence over name for volume snapshot selection. This allows to update the volume snapshot’s name.
- If no uuid option is provided, name is used for volume snapshot selection. If more than one volume snapshot with this name exists, execution is aborted.
- To revert a snapshot use the volume module.
- All operations are performed using the cloudscale.ch public API v1.
- For details consult the full API documentation: https://www.cloudscale.ch/en/api/v1.
- A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at https://control.cloudscale.ch.
Examples
# Create a volume snapshot for a volume
- name: Create a volume snapshot
cloudscale_ch.cloud.volume_snapshot:
name: 'pre-dist-upgrade'
source_volume: '2db69ba3-1864-4608-853a-0771b6885a3a'
tags: {}
api_token: xxxxx
# Get a volume snapshot by name
- name: Get facts of a volume snapshot
cloudscale_ch.cloud.volume_snapshot:
name: 'pre-dist-upgrade'
api_token: xxxxx
# Delete a volume snapshot
- name: Delete a volume snapshot
cloudscale_ch.cloud.volume_snapshot:
uuid: '351d461c-2333-455f-b788-db11bf0b4aa2'
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
created_at string | The creation date and time of the resource. Returned: state == present Sample: |
href string | The API URL to get details about this volume snapshot. Returned: state == present Sample: |
name string | The display name of the volume snapshot. Returned: state == present Sample: |
size_gb string | The size of the volume in GB. Returned: state == present Sample: |
source_volume dictionary | The source volume this volume snapshot belongs to. Returned: state == present Sample: |
state string | The current status of the volume. Returned: success Sample: |
status string | The current status of the volume snapshot. Returned: success Sample: |
tags dictionary | Tags associated with the volume. Returned: state == present Sample: |
uuid string | The unique identifier for this volume snapshot. Returned: state == present Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/cloudscale_ch/cloud/volume_snapshot_module.html