ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

:rocket: Feature request: `vm_snapshot` module should support duplicate label names #269

Closed shoriminimoe closed 10 months ago

shoriminimoe commented 1 year ago

Is your feature request related to a problem? Please describe.

The vm_snapshot module does not currently support creating a VM snapshot with a label that already exists.

Describe the solution you'd like

As a user, I should be able to create a VM snapshot with the vm_snapshot module using a label even if a snapshot with that label already exists on the target VM.

Describe alternatives you've considered

This can be done with the API module.

justinc1 commented 1 year ago

This is intentional. Later we want to use snapshot for something (like create a new VM from it), and we need to identify the source snapshot. With unique labels the label can be used as identifier. If labels are duplicated, we need to search for snapshot UUID and/or create timestamp to figure out which of many possible source snapshots to select. The vm_clone module accepts two snapshot related parameters - source_snapshot_label and source_snapshot_uuid to make both cases possible.

Duplicate snapshot labels are norm with scheduled snapshots in HyperCore. There is no way to automatically create daily snapshots with labels my-daily-snap-20231001, my-daily-snap-20231002 etc. But you can do this in ansible. Would that help to cover the usecase you have?

shoriminimoe commented 10 months ago

This is intentional. Later we want to use snapshot for something (like create a new VM from it), and we need to identify the source snapshot. With unique labels the label can be used as identifier. If labels are duplicated, we need to search for snapshot UUID and/or create timestamp to figure out which of many possible source snapshots to select. The vm_clone module accepts two snapshot related parameters - source_snapshot_label and source_snapshot_uuid to make both cases possible.

Duplicate snapshot labels are norm with scheduled snapshots in HyperCore. There is no way to automatically create daily snapshots with labels my-daily-snap-20231001, my-daily-snap-20231002 etc. But you can do this in ansible. Would that help to cover the usecase you have?

This makes sense. The use case I was thinking of deals with the interaction with the web UI and Ansible. The UI allows users to create multiple snapshots with the same label. It was just a behavioral difference I wanted to bring up in case it was not intentional.

justinc1 commented 10 months ago

Maybe we should add a paragraph to documentation to clarify this.