ansible / ansible.builtin / v2.9.18 / module / cs_vmsnapshot Manages VM snapshots on Apache CloudStack based clouds. | "added in version" 2.0 of ansible.builtin" Authors: René Moser (@resmo) stableinterface | supported by communityansible.builtin.cs_vmsnapshot (v2.9.18) — module
pip
Install with pip install ansible==2.9.18
Create, remove and revert VM from snapshots.
- name: Create a VM snapshot of disk and memory before an upgrade cs_vmsnapshot: name: Snapshot before upgrade vm: web-01 snapshot_memory: yes delegate_to: localhost
- name: Revert a VM to a snapshot after a failed upgrade cs_vmsnapshot: name: Snapshot before upgrade vm: web-01 state: revert delegate_to: localhost
- name: Remove a VM snapshot after successful upgrade cs_vmsnapshot: name: Snapshot before upgrade vm: web-01 state: absent delegate_to: localhost
vm: description: - Name of the virtual machine. required: true type: str name: aliases: - display_name description: - Unique Name of the snapshot. In CloudStack terms display name. required: true type: str 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: []).' type: list version_added: '2.4' version_added_collection: ansible.builtin zone: description: - Name of the zone in which the VM is in. If not set, default zone is used. type: str state: choices: - present - absent - revert default: present description: - State of the snapshot. type: str domain: description: - Domain the VM snapshot is related to. type: str account: description: - Account the VM snapshot 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 VM is assigned to. type: str 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 description: description: - Description of the snapshot. type: str 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 snapshot_memory: default: false description: - Snapshot memory if set to true. type: bool api_verify_ssl_cert: description: - Verify CA authority cert file. - If not given, the C(CLOUDSTACK_VERIFY) env variable is considered. type: str
account: description: Account the vm snapshot is related to. returned: success sample: example account type: str created: description: date of the snapshot. returned: success sample: 2015-03-29T14:57:06+0200 type: str current: description: true if the snapshot is current returned: success sample: true type: bool description: description: description of vm snapshot returned: success sample: snapshot brought to you by Ansible type: str display_name: description: Display name of the snapshot. returned: success sample: snapshot before update type: str domain: description: Domain the vm snapshot is related to. returned: success sample: example domain type: str id: description: UUID of the snapshot. returned: success sample: a6f7a5fc-43f8-11e5-a151-feff819cdc9f type: str name: description: Name of the snapshot. returned: success sample: snapshot before update type: str project: description: Name of project the vm snapshot is related to. returned: success sample: Production type: str state: description: state of the vm snapshot returned: success sample: Allocated type: str type: description: type of vm snapshot returned: success sample: DiskAndMemory type: str