Skip to content

Commit

Permalink
Adding documentation and changelog
Browse files Browse the repository at this point in the history
Documenting the ability to rename network interfaces on snapshot
restore.

Signed-off-by: Andrew Laucius <[email protected]>
  • Loading branch information
andrewla committed Jan 10, 2025
1 parent 3710891 commit bf47436
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ and this project adheres to
support for `-h` help flag to the Jailer. The Jailer will now print the help
message with either `--help` or `-h`.

- [#4731](https://github.com/firecracker-microvm/firecracker/pull/4731): Added
support for modifying the host TAP device name during snapshot restore.

### Changed

### Deprecated
Expand Down
32 changes: 32 additions & 0 deletions docs/snapshotting/network-for-clones.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,38 @@ Otherwise, packets originating from the guest might be using old Link Layer
Address for up to arp cache timeout seconds. After said timeout period,
connectivity will work both ways even without an explicit flush.

### Renaming host device names

In some environments where the jailer is not being used, restoring a snapshot
may be tricky because the tap device on the host will not be the same as the tap
device that the original VM was mapped to when it was snapshotted, as when the
tap device come from a pool of such devices.

In this case you can use the `network_overrides` parameter to snapshot restore
to specify which network device (based on the name inside the VM, such as
"eth0") maps to which host tap device (e.g. "vmtap01").

This may require reconfiguration of the networking inside the VM so that it is
still routable externally. The [network setup documentation](../network-setup.md)
in the "In The Guest" section describes what the typical setup is. If you are
not using network namespaces or the jailer, then the guest will have to be
made aware (via vsock or other channel) that it needs to reconfigure its
network to match the network configured on the tap device.

If the new TAP device, say `vmtap3` has been configured to use a guest address
of `172.16.3.2` then after snapshot restore you would run something like:

```bash
# Clear out the previous addr and route
ip addr flush dev eth0
ip route flush dev eth0

# Configure the new address
ip addr add 172.16.3.2/30 dev eth0
ip route add defaul via 172.16.3.1/30 dev eth0
```


# Ingress connectivity

The above setup only provides egress connectivity. If in addition we also want
Expand Down

0 comments on commit bf47436

Please sign in to comment.