Skip to content

Commit

Permalink
doc(snapshot_editor): updated docs
Browse files Browse the repository at this point in the history
Added info about new `snapshot-editor` function.

Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
  • Loading branch information
ShadowCurse committed Aug 25, 2023
1 parent 7caa682 commit 14f1161
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
34 changes: 31 additions & 3 deletions docs/snapshotting/snapshot-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,39 @@ Firecracker snapshot consists of 2 files:
devices states etc.
- `memory` file: file with guest memory.

`snapshot-editor` (currently) allows to modify only `vmstate` files only
on aarch64 platform.

## Usage

### `edit-memory` command

#### `rebase` subcommand

This command is used to merge a `diff` snapshot memory file on
top of a base memory file.

**None**
You can also use `rebase-snap` tool for this.

Arguments:

- `MEMORY_PATH` - path to the `memory` file
- `DIFF_PATH` - path to the `diff` file

Usage:

```bash
snapshot-editor edit-memory rebase \
--memory-path <MEMORY_PATH> \
--diff-path <DIFF_PATH>
```

Example:

```bash
snapshot-editor edit-memory rebase \
--memory-path ./memory_file \
--diff-path ./diff_file
```

### `edit-vmstate` command

#### `remove-regs` subcommand (aarch64 only)
Expand Down
13 changes: 12 additions & 1 deletion docs/snapshotting/snapshot-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,23 @@ created by a subsequent `/snapshot/create` API call. The order in which the
snapshots were created matters and they should be merged in the same order
in which they were created. To merge a `diff` snapshot memory file on
top of a base, users should copy its content over the base. This can be done
using the `rebase-snap` tool provided with the firecracker release:
using the `rebase-snap` or `snapshot-editor` tools provided with the
firecracker release:

`rebase-snap` example:

```bash
rebase-snap --base-file path/to/base --diff-file path/to/layer
```

`snapshot-editor` example:

```bash
snapshot-editor edit-memory rebase \
--memory-path path/to/base \
--diff-path path/to/layer
```

After executing the command above, the base would be a resumable snapshot memory
file describing the state of the memory at the moment of creation of the layer.
More layers which were created later can be merged on top of this base.
Expand Down

0 comments on commit 14f1161

Please sign in to comment.