Skip to content

Commit a1988c6

Browse files
mingshuoqiuinnobead
authored andcommitted
Add network config suggestions for VM running Ubuntu
Signed-off-by: Chris Chiu <[email protected]>
1 parent d8c0860 commit a1988c6

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

docs/vm/backup-restore.md

+36
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,24 @@ The `State` will be set to `Ready` once the backup is complete.
5858

5959
Users can either restore a new VM or replace an existing VM using this backup.
6060

61+
:::note
62+
63+
The network configuration of a virtual machine running an Ubuntu release later than 16.04 is likely managed by `netplan` by default. Before creating backups, you must stop the virtual machine, edit the configuration (**Edit Config > Advanced Options**), and then restart the virtual machine. Use the following `network` settings as reference for DHCP configuration.
64+
65+
```YAML
66+
network:
67+
ethernets:
68+
enp1s0:
69+
dhcp4: true
70+
dhcp6: true
71+
dhcp-identifier: mac
72+
version: 2
73+
```
74+
75+
The restored virtual machine retains the machine ID of the original virtual machine. If `dhcp-identifier: mac` is not specified, the restored virtual machine receives the same IP address from the DHCP server because `netplan` uses the machine ID as the DHCP client identifier by default. This is why you must configure the `network` settings before creating backups of virtual machines running Ubuntu. Failure to do so may result in unexpected behavior and potential network conflicts.
76+
77+
:::
78+
6179
### Restore a new VM using a backup
6280

6381
To restore a new VM from a backup, follow these steps:
@@ -174,6 +192,24 @@ The `State` will be set to `Ready` once the snapshot is complete.
174192
175193
Users can either restore a new VM or replace an existing VM using this snapshot.
176194
195+
:::note
196+
197+
The network configuration of a virtual machine running an Ubuntu release later than 16.04 is likely managed by `netplan` by default. Before creating snapshots, you must stop the virtual machine, edit the configuration (**Edit Config > Advanced Options**), and then restart the virtual machine. Use the following `network` settings as reference for DHCP configuration.
198+
199+
```YAML
200+
network:
201+
ethernets:
202+
enp1s0:
203+
dhcp4: true
204+
dhcp6: true
205+
dhcp-identifier: mac
206+
version: 2
207+
```
208+
209+
The restored virtual machine retains the machine ID of the original virtual machine. If `dhcp-identifier: mac` is not specified, the restored virtual machine receives the same IP address from the DHCP server because `netplan` uses the machine ID as the DHCP client identifier by default. This is why you must configure the `network` settings before creating snapshot of virtual machines running Ubuntu. Failure to do so may result in unexpected behavior and potential network conflicts.
210+
211+
:::
212+
177213
### Restore a new VM using a snapshot
178214

179215
To restore a new VM from a snapshot, follow these steps:

docs/vm/create-vm.md

+18
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,24 @@ network:
297297

298298
You can also use the `Advanced > Cloud Config Templates` feature to create a pre-defined cloud-init configuration template for the VM.
299299

300+
:::note
301+
302+
The network configuration of a virtual machine running an Ubuntu release later than 16.04 is likely managed by `netplan` by default. Please use the following `network` settings as reference for DHCP configuration to prevent IP address conflicts when restoring a virtual machine from a snapshot or backup.
303+
304+
```YAML
305+
network:
306+
ethernets:
307+
enp1s0:
308+
dhcp4: true
309+
dhcp6: true
310+
dhcp-identifier: mac
311+
version: 2
312+
```
313+
314+
If dhcp-identifier: mac is not specified, the restored virtual machine will receive the same IP address from the DHCP server. This happens because netplan defaults to using the machine ID as the DHCP client identifier. As a result, the restored virtual machine will receive the same IP address from the DHCP server and lead to IP address conflicts.
315+
316+
:::
317+
300318
#### Installing the QEMU guest agent
301319
The QEMU guest agent is a daemon that runs on the virtual machine instance and passes information to the host about the VM, users, file systems, and secondary networks.
302320

0 commit comments

Comments
 (0)