Snapshot

snapshot

This module allows you to create or remove a snapshot.

Example Syntax


name: Create snapshot
ionoscloudsdk.ionoscloud.snapshot:
  datacenter: 'AnsibleAutoTestCompute'
  volume: 'AnsibleAutoTestCompute'
  name: 'AnsibleAutoTestCompute'
  description: Ansible test snapshot
  wait_timeout: 600
register: result


name: Update snapshot
ionoscloudsdk.ionoscloud.snapshot:
  snapshot: 'AnsibleAutoTestCompute'
  description: Ansible test snapshot - RENAME
  state: update


name: Restore snapshot
ionoscloudsdk.ionoscloud.snapshot:
  datacenter: 'AnsibleAutoTestCompute'
  volume: 'AnsibleAutoTestCompute'
  snapshot: 'AnsibleAutoTestCompute'
  state: restore


name: Delete snapshot
ionoscloudsdk.ionoscloud.snapshot:
  snapshot: 'AnsibleAutoTestCompute'
  wait_timeout: 600
  state: absent

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "snapshot": {
        "href": "https://api.ionos.com/cloudapi/v6/snapshots/c77c9be7-fb6d-4747-ac3d-a8489d8499d1",
        "id": "c77c9be7-fb6d-4747-ac3d-a8489d8499d1",
        "metadata": {
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "created_date": "2023-05-29T12:57:58+00:00",
            "etag": "f47933bc5bead5ca05821105dc943e9f",
            "last_modified_by": "<USER_EMAIL>",
            "last_modified_by_user_id": "<USER_ID>",
            "last_modified_date": "2023-05-29T12:57:58+00:00",
            "state": "BUSY"
        },
        "properties": {
            "cpu_hot_plug": false,
            "cpu_hot_unplug": false,
            "description": "Ansible test snapshot",
            "disc_scsi_hot_plug": false,
            "disc_scsi_hot_unplug": false,
            "disc_virtio_hot_plug": false,
            "disc_virtio_hot_unplug": false,
            "licence_type": "UNKNOWN",
            "location": "gb/lhr",
            "name": "AnsibleAutoTestCompute",
            "nic_hot_plug": false,
            "nic_hot_unplug": false,
            "ram_hot_plug": false,
            "ram_hot_unplug": false,
            "sec_auth_protection": false,
            "size": 10.0
        },
        "type": "snapshot"
    }
}

For more examples please check out the tests here.

state: present

  
name: Create snapshot
ionoscloudsdk.ionoscloud.snapshot:
  datacenter: 'AnsibleAutoTestCompute'
  volume: 'AnsibleAutoTestCompute'
  name: 'AnsibleAutoTestCompute'
  description: Ansible test snapshot
  wait_timeout: 600
register: result

Available parameters for state present:

NameRequiredDescription

datacenter str

True

The datacenter in which the volumes reside.

volume str

True

The name or UUID of the volume.

description str

False

Human-readable description.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: absent

  
name: Delete snapshot
ionoscloudsdk.ionoscloud.snapshot:
  snapshot: 'AnsibleAutoTestCompute'
  wait_timeout: 600
  state: absent

Available parameters for state absent:

NameRequiredDescription

snapshot str

True

The ID or name of an existing snapshot.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: update

  
name: Update snapshot
ionoscloudsdk.ionoscloud.snapshot:
  snapshot: 'AnsibleAutoTestCompute'
  description: Ansible test snapshot - RENAME
  state: update

Available parameters for state update:

NameRequiredDescription

snapshot str

True

The ID or name of an existing snapshot.

licence_type str

False

OS type of this snapshot Options: ['UNKNOWN', 'WINDOWS', 'WINDOWS2016', 'WINDOWS2022', 'RHEL', 'LINUX', 'OTHER']

cpu_hot_plug bool

False

Hot-plug capable CPU (no reboot required).

cpu_hot_unplug bool

False

Hot-unplug capable CPU (no reboot required).

ram_hot_plug bool

False

Hot-plug capable RAM (no reboot required).

ram_hot_unplug bool

False

Hot-unplug capable RAM (no reboot required).

nic_hot_plug bool

False

Hot-plug capable NIC (no reboot required).

nic_hot_unplug bool

False

Hot-unplug capable NIC (no reboot required).

disc_scsi_hot_plug bool

False

Hot-plug capable SCSI drive (no reboot required).

disc_scsi_hot_unplug bool

False

Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.

disc_virtio_hot_plug bool

False

Hot-plug capable Virt-IO drive (no reboot required).

disc_virtio_hot_unplug bool

False

Hot-unplug capable Virt-IO drive (no reboot required). Not supported with Windows VMs.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: restore

  
name: Restore snapshot
ionoscloudsdk.ionoscloud.snapshot:
  datacenter: 'AnsibleAutoTestCompute'
  volume: 'AnsibleAutoTestCompute'
  snapshot: 'AnsibleAutoTestCompute'
  state: restore

Available parameters for state restore:

NameRequiredDescription

datacenter str

True

The datacenter in which the volumes reside.

volume str

True

The name or UUID of the volume.

snapshot str

True

The ID or name of an existing snapshot.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

Last updated