noderings.cloud.virtual_machine_snapshot module – Take and delete snapshots of NodeRings virtual machines

Note

This module is part of the noderings.cloud collection (version 0.2.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 noderings.cloud. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: noderings.cloud.virtual_machine_snapshot.

New in noderings.cloud 0.1.0

Synopsis

  • Takes a snapshot of a virtual machine’s disk, or deletes one.

  • Snapshots are matched by description, so use a unique description per snapshot, for example before-upgrade-2026-11-23.

  • The VM’s hosting provider must support snapshots.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.9

Parameters

Parameter

Comments

api_retries

integer

How many times a request is retried after rate limiting (HTTP 429) or a gateway error (HTTP 502, 503 or 504).

Orders (virtual machines, game servers, snapshots) are never retried blindly.

Default: 5

api_timeout

integer

Timeout in seconds for a single HTTP request.

Default: 60

api_token

aliases: token

string

A NodeRings service-account token.

Create one in the NodeRings console under Organization > Service accounts.

If not set, the value of the NODERINGS_TOKEN, NODERINGS_API_TOKEN or NR_API_TOKEN environment variable is used.

api_url

string

Base URL of the NodeRings API.

If not set, the value of the NODERINGS_API_URL environment variable is used.

Default: "https://api.noderings.com"

description

string / required

Description of the snapshot. Identifies it.

organization_id

string

Organization to act in, sent as the X-Organization-ID header.

Defaults to the organization the token belongs to.

If not set, the value of the NODERINGS_ORGANIZATION_ID or NR_ORGANIZATION_ID environment variable is used.

state

string

Whether the snapshot should exist.

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

Whether to validate the API’s TLS certificate.

Choices:

  • false

  • true ← (default)

virtual_machine

aliases: vm

string / required

Hostname or ID of the VM.

wait

boolean

Wait until the operation has finished before returning.

Choices:

  • false

  • true ← (default)

wait_timeout

integer

How long to wait, in seconds, when wait=true.

Default: 1800

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying the target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Notes

Note

  • All modules in this collection belong to the noderings.cloud.noderings action group, so connection options can be set once with module_defaults.

Examples

- name: Snapshot before upgrading
  noderings.cloud.virtual_machine_snapshot:
    vm: web-1
    description: before-upgrade-{{ ansible_date_time.date }}

- name: Delete it again
  noderings.cloud.virtual_machine_snapshot:
    vm: web-1
    description: before-upgrade-2026-11-23
    state: absent

Return Values

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

Key

Description

snapshot

dictionary

The snapshot. Empty after state=absent.

Returned: always

Sample: {"created_at": "2026-11-23T20:00:00Z", "description": "before-upgrade-2026-11-23", "id": "9c8b7a6d-0000-1111-2222-333344445555", "operation_status": "SNAPSHOT_OPERATION_STATUS_COMPLETED"}

Authors

  • Shaygun (@shaygun)