sylve_vm_snapshot_rollback (Resource)
Rolls a sylve_vm back to a prior sylve_vm_snapshot. This is a one-shot ACTION, not persistent state – modeled the same way hashicorp/null’s null_resource models triggered actions. Applying this resource for the first time performs the rollback immediately; nothing happens again unless trigger changes, which recreates the resource and fires the rollback again (e.g. bump trigger to a new timestamp/uuid to roll back to the same snapshot a second time – Terraform has no way to know you want that from unchanged config alone). destroying this resource does NOT undo anything; there is no “rollback the rollback” – if you need that, take a new sylve_vm_snapshot before rolling back. Sylve itself hardcodes destroying any newer state as part of the rollback – there is no partial or non-destructive rollback option server-side.
Example Usage
# A one-shot ACTION, not persistent state -- modeled like
# hashicorp/null's null_resource. Applying this the first time performs
# the rollback immediately. Nothing happens again unless `trigger`
# changes, which recreates the resource and fires the rollback again.
# Destroying this resource does NOT undo anything -- there is no
# "rollback the rollback"; take a new sylve_vm_snapshot first if you
# might want to go back.
resource "sylve_vm_snapshot_rollback" "restore" {
rid = sylve_vm.example.rid
snapshot_id = tonumber(sylve_vm_snapshot.before_upgrade.id)
trigger = "restore-1" # bump this to any new value to fire the rollback again
}
Schema
Required
rid(Number) RID of the sylve_vm to roll back.snapshot_id(Number) ID of the sylve_vm_snapshot to roll back to.trigger(String) Arbitrary string. Changing it re-fires the rollback (see the resource’s own description for why this is necessary – there is no other way to ask Terraform to repeat a one-shot action against otherwise-unchanged config).
Read-Only
id(String) Terraform resource identity. Not a real external ID – just “- " for display.