Skip to content

Commit 4ac480b

Browse files
committed
Adding documentation and changelog
Documenting the ability to rename network interfaces on snapshot restore. Signed-off-by: Andrew Laucius <[email protected]>
1 parent ad4ea19 commit 4ac480b

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,20 @@ and this project adheres to
116116
Support for VMGenID via DeviceTree bindings exists only on mainline 6.10 Linux
117117
onwards. Users of Firecracker will need to backport the relevant patches on
118118
top of their 6.1 kernels to make use of the feature.
119+
119120
- [#4732](https://github.com/firecracker-microvm/firecracker/pull/4732),
120121
[#4733](https://github.com/firecracker-microvm/firecracker/pull/4733),
121122
[#4741](https://github.com/firecracker-microvm/firecracker/pull/4741),
122123
[#4746](https://github.com/firecracker-microvm/firecracker/pull/4746): Added
123124
official support for 6.1 microVM guest kernels.
125+
124126
- [#4743](https://github.com/firecracker-microvm/firecracker/pull/4743): Added
125127
support for `-h` help flag to the Jailer. The Jailer will now print the help
126128
message with either `--help` or `-h`.
127129

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

130135
### Deprecated

docs/snapshotting/network-for-clones.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,66 @@ Otherwise, packets originating from the guest might be using old Link Layer
142142
Address for up to arp cache timeout seconds. After said timeout period,
143143
connectivity will work both ways even without an explicit flush.
144144

145+
### Renaming host device names
146+
147+
In some environments where the jailer is not being used, restoring a snapshot
148+
may be tricky because the tap device on the host will not be the same as the tap
149+
device that the original VM was mapped to when it was snapshotted, as when the
150+
tap device come from a pool of such devices.
151+
152+
In this case you can use the `network_overrides` parameter to snapshot restore
153+
to specify which guest network device maps to which host tap device.
154+
155+
For example, if we have a network interface named `eth0` in the snapshotted
156+
microVM. We can override it to point to the host device `vmtap01` during
157+
snapshot resume, like this:
158+
159+
160+
```bash
161+
curl --unix-socket /tmp/firecracker.socket -i \
162+
-X PUT 'http://localhost/snapshot/load' \
163+
-H 'Accept: application/json' \
164+
-H 'Content-Type: application/json' \
165+
-d '{
166+
"snapshot_path": "./snapshot_file",
167+
"mem_backend": {
168+
"backend_path": "./mem_file",
169+
"backend_type": "File"
170+
},
171+
"enable_diff_snapshots": true,
172+
"resume_vm": false,
173+
"network_overrides": [
174+
{
175+
iface_id: "eth0",
176+
host_dev_name": "vmtap01"
177+
}
178+
]
179+
}'
180+
```
181+
182+
This may require reconfiguration of the networking inside the VM so that it is
183+
still routable externally. The
184+
[network setup documentation](../network-setup.md) in the "In The Guest" section
185+
describes what the typical setup is. If you are not using network namespaces or
186+
the jailer, then the guest will have to be made aware (via vsock or other
187+
channel) that it needs to reconfigure its network to match the network
188+
configured on the tap device.
189+
190+
If the new TAP device, say `vmtap3` has been configured to use a guest address
191+
of `172.16.3.2` then after snapshot restore you would run something like:
192+
193+
```bash
194+
# In the guest
195+
196+
# Clear out the previous addr and route
197+
ip addr flush dev eth0
198+
ip route flush dev eth0
199+
200+
# Configure the new address
201+
ip addr add 172.16.3.2/30 dev eth0
202+
ip route add defaul via 172.16.3.1/30 dev eth0
203+
```
204+
145205
# Ingress connectivity
146206

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

0 commit comments

Comments
 (0)