The snapshot-editor
is a program for modification of Firecracker snapshots.
Firecracker snapshot consists of 2 files:
vmstate
file: file with Firecracker internal data such as vcpu states, devices states etc.memory
file: file with guest memory.
This command is used to merge a
diff
snapshot memory file on top of a base memory file.Note You can also use
rebase-snap
(deprecated) tool for this.Arguments:
MEMORY_PATH
- path to thememory
fileDIFF_PATH
- path to thediff
fileUsage:
snapshot-editor edit-memory rebase \ --memory-path <MEMORY_PATH> \ --diff-path <DIFF_PATH>Example:
snapshot-editor edit-memory rebase \ --memory-path ./memory_file \ --diff-path ./diff_file
This command is used to remove specified registers from vcpu states inside vmstate snapshot file.
Arguments:
VMSTATE_PATH
- path to thevmstate
fileOUTPUT_PATH
- path to the file where the output will be placed[REGS]
- set of u32 values representing registers ids as they are defined in KVM. Can be both in decimal and in hex formats.Usage:
snapshot-editor edit-vmstate remove-regs \ --vmstate-path <VMSTATE_PATH> \ --output-path <OUTPUT_PATH> \ [REGS]...Example:
./snapshot-editor edit-vmstate remove-regs \ --vmstate-path ./vmstate_file \ --output-path ./new_vmstate_file \ 0x1 0x2
This command is used to print version of the provided vmstate file.
Arguments:
VMSTATE_PATH
- path to thevmstate
fileUsage:
snapshot-editor info-vmstate version --vmstate-path <VMSTATE_PATH>Example:
./snapshot-editor info-vmstate version --vmstate-path ./vmstate_file
This command is used to print the vCPU states inside vmstate snapshot file.
Arguments:
VMSTATE_PATH
- path to thevmstate
fileUsage:
snapshot-editor info-vmstate vcpu-states --vmstate-path <VMSTATE_PATH>Example:
./snapshot-editor info-vmstate vcpu-states --vmstate-path ./vmstate_file
This command is used to print the vmstate of snapshot file in readable format thus, making it easier to compare vmstate of 2 snapshots.
Arguments:
VMSTATE_PATH
- path to thevmstate
fileUsage:
snapshot-editor info-vmstate vm-state --vmstate-path <VMSTATE_PATH>Example:
./snapshot-editor info-vmstate vm-state --vmstate-path ./vmstate_file