kvm.snapshot-consolidate
Merge the oldest snapshots of a KVM virtual machine into the latest snapshot, keeping the number of snapshots given by snapshots. The result is synchronized to the other cluster node.
JSON-RPC Request
{"jsonrpc":"2.0","id":1,"method":"kvm.snapshot_consolidate","params":{"hostname":"kvm1","snapshots":1}}
Request Parameters
| Argument | Type | Description | Required |
|---|---|---|---|
hostname | String | The name of the virtual machine. | Yes |
snapshots | Integer | The number of snapshots to keep. The oldest snapshots beyond this number are merged into the latest snapshot. The virtual machine must have at least two snapshots; otherwise, the result is Nothing to consolidate. | No |
JSON-RPC Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "Consolidating 1 oldest snapshot for kvm1...\n2 snapshots for kvm1 were consolidated."
}
RVC CLI Example
rvc kvm snapshot-consolidate --hostname kvm1 --snapshots 1
Response
Consolidating 1 oldest snapshot for kvm1...
2 snapshots for kvm1 were consolidated.