scale_computing.hypercore.snapshot_schedule module – Manage snap schedule to configure the desired schedule of snapshot creation.

Note

This module is part of the scale_computing.hypercore collection (version 1.6.0).

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 scale_computing.hypercore.

To use it in a playbook, specify: scale_computing.hypercore.snapshot_schedule.

New in scale_computing.hypercore 1.0.0

Synopsis

  • Create and delete an automated VM snapshot schedule on HyperCore API endpoint /rest/v1/VirDomainSnapshotSchedule.

Parameters

Parameter

Comments

cluster_instance

dictionary

Scale Computing HyperCore instance information.

auth_method

string

Select login method. If not set, the value of the SC_AUTH_METHOD environment variable will be used.

Value local - username/password is verified by the HyperCore server (the local users).

Value oidc - username/password is verified by the configured OIDC provider.

Choices:

  • "local" ← (default)

  • "oidc"

host

string / required

The HyperCore instance URL.

If not set, the value of the SC_HOST environment variable will be used.

For example “https://10.1.2.3:443”.

password

string / required

Password used for authentication.

If not set, the value of the SC_PASSWORD environment variable will be used.

timeout

float

Timeout in seconds for the connection with the Scale Computing HyperCore API instance.

If not set, the value of the SC_TIMEOUT environment variable will be used.

username

string / required

Username used for authentication.

If not set, the value of the SC_USERNAME environment variable will be used.

name

string / required

Snapshot schedule’s name.

Serves as unique identifier across all snapshot schedules.

recurrences

list / elements=dictionary

The recurrence rules we want to set for the snapshot schedule.

Default: []

frequency

string / required

The frequency of the recurrence.

The value must comply with RFC-2445.

A valid example is FREQ=WEEKLY;INTERVAL=1;BYDAY=TU.

local_retention

integer / required

Retention time in seconds.

name

string / required

The recurrence’s name.

remote_retention

integer

Remote retention time in seconds.

If either not set or set to either 0 or None, remote_retention will be assigned local_retention‘s value.

start

string / required

The start of the snapshot schedule in the local timezone timestamp.

state

string / required

The desired state of the snapshot schedule object.

Use absent to ensure the snapshot schedule will be absent from the API and present to ensure snapshot schedule will remain present on the API.

Choices:

  • "present"

  • "absent"

Notes

Note

  • The record return value will be changed from list (containing a single item) to dict. There will be no release where both old and new variant work at the same time. The change will happen with release 3.0.0. To ease migration, the only change between last 1.x or 2.x release and 3.0.0 release will be changing the record return value. List of deprecation changes includes examples to help with transition.

  • check_mode is not supported.

See Also

See also

scale_computing.hypercore.snapshot_schedule_info

Retrieve information about an automated VM snapshot schedule.

scale_computing.hypercore.vm_replication

Handles VM replications.

Examples

- name: Setup snapshot schedule
  scale_computing.hypercore.snapshot_schedule:
    name: demo-snap-schedule
    state: present
    recurrences:
      - name: weekly-tuesday
        frequency: "FREQ=WEEKLY;INTERVAL=1;BYDAY=TU"  # RFC-2445
        start: "2010-01-01 00:00:00"
        local_retention: "{{ 10 * 7*24*60*60 }}"  # 10 days, unit seconds
        remote_retention:  # optional, None or 0 means same as local_retention.

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

record

list / elements=dictionary

The created or deleted snapshot schedule from the HyperCore API endpoint /rest/v1/VirDomainSnapshotSchedule.

Returned: success

name

string

Human-readable snapshot schedule name

Returned: success

Sample: "demo-snap-schedule"

recurrences

list / elements=dictionary

Snapshot scheduling rules

Returned: success

Sample: {"frequency": "FREQ=WEEKLY;INTERVAL=1;BYDAY=TU", "local_retention": 1296000, "name": "weekly-tuesday", "remote_retention": 3024000, "replication": true, "start": "2010-01-01 00:00:00"}

uuid

string

Unique identifier

Returned: success

Sample: "74df5b47-c468-4626-a7e4-34eca13b2f81"

Authors

  • Tjaž Eržen (@tjazsch)