kvm.snapshot_restore
Restore a KVM virtual machine to a specified snapshot. For clustered hosts, this turns on maintenance mode for the cluster. Once the restore is completed, it doesn't turn maintenance mode off so you should use rvc cluster disable-maintenance-mode to turn it off when ready.
JSON-RPC Request
{"jsonrpc":"2.0","id":1,"method":"kvm.snapshot_restore","params":{"hostname":"kvm1","snapshot":"disk0.kvm1-2024-10-30-161923.764"}}
Request Parameters
| Argument | Type | Description | Required |
|---|---|---|---|
hostname | String | The name of the virtual machine. | Yes |
snapshot | String | The name of the snapshot to restore. | Yes |
JSON-RPC Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Restoring snapshot disk0.kvm1-2024-10-30-161923.764 for kvm1..."
}
RVC CLI Example
rvc kvm snapshot-restore --hostname kvm1 --snapshot disk0.kvm1-2024-10-30-161923.764
Response
Restoring snapshot disk0.kvm1-2024-10-30-161923.764 for kvm1...
Maintenance mode set to enabled.
kvm1 successfully restored to snasphot disk0.kvm1-2024-10-30-161923.764.
Removing recent snapshots...
Removing snapshot disk0.kvm1-2024-10-30-162647.862...
Recent snapshots removed successfully.
Snapshot synchronization completed.