Skip to content

Commit

Permalink
Fix customize ubuntu docs to clean the vm properly (#3846)
Browse files Browse the repository at this point in the history
  • Loading branch information
vignesh-goutham authored Oct 27, 2022
1 parent 7cca295 commit fffb8c5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/content/en/docs/reference/vsphere/customize-ovas.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,29 @@ Restart containerd service with the `sudo systemctl restart containerd` command.

After you have customized the VM, you need to convert it to a template.

### Reset the machine-id and power off the VM
### Cleanup the machine and power off the VM

This step is needed because of a [known issue in Ubuntu](https://kb.vmware.com/s/article/82229) which results in the clone VMs getting the same DHCP IP

```
sudo su
echo -n > /etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
cloud-init clean -l --machine-id
```

Delete the hostname from file
```
/etc/hostname
```
Delete the networking config file
```
rm -rf /etc/netplan/50-cloud-init.yaml
```
Edit the cloud init config to turn `preserve_hostname` to false
```
vi /etc/cloud/cloud.cfg
```

Power the VM down
Expand Down

0 comments on commit fffb8c5

Please sign in to comment.