trycua/cua

[Lume] VM Snapshot Management

Open

#15 opened on 2025年2月5日

GitHub で見る
 (1 comment) (1 reaction) (0 assignees)HTML (16,722 stars) (1,051 forks)batch import
good first issue

説明

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 state
  • VZMacOSVirtualMachine.restoreSnapshot(_:) - Restores VM to a previous snapshot
  • Snapshot data can be written to disk using write(toFile:) and loaded using init(contentsOf:)

This native support makes implementation straightforward, mainly requiring:

  1. CLI interface to expose snapshot functions
  2. Snapshot management system
  3. 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>

コントリビューターガイド