good first issue
Description
Current Behavior
Currently lume does not support creating, managing, or restoring VM snapshots.
Desired Behavior
Ability to:
- Create named snapshots of running or stopped VMs
- List available snapshots for a VM
- Restore VMs to previous snapshots
- Delete snapshots
- Export/Import snapshots
Technical Implementation
macOS Virtualization.Framework already provides snapshot support through VZMacOSVirtualMachineSnapshot class, which offers:
VZMacOSVirtualMachine.takeSnapshot()- Creates a snapshot of the current VM stateVZMacOSVirtualMachine.restoreSnapshot(_:)- Restores VM to a previous snapshot- Snapshot data can be written to disk using
write(toFile:)and loaded usinginit(contentsOf:)
This native support makes implementation straightforward, mainly requiring:
- CLI interface to expose snapshot functions
- Snapshot management system
- Storage handling for snapshot files
Proposed CLI Commands
# Create snapshot
lume snapshot create <vm-name> [--name <snapshot-name>]
# List snapshots
lume snapshot list <vm-name>
# Restore snapshot
lume snapshot restore <vm-name> <snapshot-name>
# Delete snapshot
lume snapshot delete <vm-name> <snapshot-name>
# Export snapshot
lume snapshot export <vm-name> <snapshot-name> <output-path>
# Import snapshot
lume snapshot import <vm-name> <snapshot-path>