ngine-io / ansible-collection-cloudstack

CloudStack Ansible Collections
https://galaxy.ansible.com/ngine_io/cloudstack
GNU General Public License v3.0
21 stars 28 forks source link

Missing functionality to create volume snapshots #23

Open onitake opened 4 years ago

onitake commented 4 years ago
SUMMARY

Migrated from: https://github.com/ansible/ansible/issues/53264

There is currently no CloudStack module that can create volume snapshots.

The cs_volume module has a snapshot parameter, but apparently, it's only used to create a new volume from a snapshot.

I request a full-featured cs_volumesnapshot module that wraps the API calls:

A separate cs_volumesnapshotpolicy module may also be useful, wrapping

ISSUE TYPE
COMPONENT NAME

lib/ansible/modules/cloud/cloudstack

ADDITIONAL INFORMATION

Example usage of the module would look like this:

- name: create volume snapshot
  cs_volumesnapshot:
    name: web-vm-1-volume-snapshot-1
    volume: web-vm-1-volume
  delegate_to: localhost

- name: create volume snapshot from VM snapshot
  cs_volumesnapshot:
    name: web-vm-1-volume-snapshot-1
    volume: web-vm-1-volume
    vmsnapshot: web-vm-1-snapshot-1
  delegate_to: localhost

- name: revert to volume snapshot
  cs_volumesnapshot:
    name: web-vm-1-volume-snapshot-1
    state: reverted
  delegate_to: localhost

- name: delete volume snapshot
  cs_volumesnapshot:
    name: web-vm-1-volume-snapshot-1
    state: absent
  delegate_to: localhost