Skip to content

Commit

Permalink
docs: Update snapshot/restore documentation
Browse files Browse the repository at this point in the history
Add a section about restoring VM with new Net FDs explicitly passed
to ch-remote via 'net_fds' parameter

Signed-off-by: Purna Pavan Chandra <[email protected]>
  • Loading branch information
pupacha committed May 3, 2024
1 parent bc8fb42 commit 3bb9651
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/snapshot_restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ component in the state it was left before the snapshot occurred.
## Restore a Cloud Hypervisor VM

Given that one has access to an existing snapshot in `/home/foo/snapshot`,
it is possible to create a new VM based on this snapshot with the following
it is possible to create a new VM based on this snapshot with the following
command:

```bash
Expand Down Expand Up @@ -93,6 +93,17 @@ start using it.
At this point, the VM is fully restored and is identical to the VM which was
snapshot earlier.

## Restore a VM with new Net FDs
For a VM created with FDs explicitly passed to NetConfig, the snapshot `config.json` will contain invalid fds, for example `"fds":[-1,-1,-1,-1]`. New net FDs have to be passed to restore the VM properly with the syntax `net_fds=[<net_id>@[<fd1>,<fd2>,..],..]`
```bash
# First terminal
./cloud-hypervisor --api-socket /tmp/cloud-hypervisor.sock

# Second terminal
./ch-remote --api-socket=/tmp/cloud-hypervisor.sock restore source_url=file:///home/foo/snapshot net_fds=[net1@[23,24],net2@[25,26]]
```
In the above mentioned example, FDs 23, 24 will be associated to NetConfig with id 'net1' and FDS 25, 26 to NetConfig with id 'net2'.
## Limitations
VFIO devices and Intel SGX are out of scope.

0 comments on commit 3bb9651

Please sign in to comment.