Hello,
As a preliminary matter, I know that (one of) the correct way(s) to do what I'm about to ask about is to deploy a VM with Cloud-Init and then set it up with an automation tool like Ansible. Mostly I'm posting this because I'm not ready to learn to use Ansible yet, as I'm in the middle of learning several other things (Proxmox firewall config, at the moment), but still want to make sure I'm deploying my cloned guests correctly.
(Without Ansible or something similar, cloud-init doesn't get you a set-up, ready-to-use, fully-configured system, which is what got me thinking about this. I'm trying to figure out the feasibility of pre-configuring a machine and cloning it without any sort of automated deployment tools.)
These are the items I know I'd have to change.
As a preliminary matter, I know that (one of) the correct way(s) to do what I'm about to ask about is to deploy a VM with Cloud-Init and then set it up with an automation tool like Ansible. Mostly I'm posting this because I'm not ready to learn to use Ansible yet, as I'm in the middle of learning several other things (Proxmox firewall config, at the moment), but still want to make sure I'm deploying my cloned guests correctly.
(Without Ansible or something similar, cloud-init doesn't get you a set-up, ready-to-use, fully-configured system, which is what got me thinking about this. I'm trying to figure out the feasibility of pre-configuring a machine and cloning it without any sort of automated deployment tools.)
These are the items I know I'd have to change.
- In particular, I use reserved DHCP addresses on my firewall for static IP addresses, so I depend on each guest having a unique MAC address. But apparently just cloning a VM or LXC doesn't automatically change the MAC on existing virtual NICs (preserving them is a reasonable default). So I'd need to either clone them without the NICs, or change the MACs afterwards.
- Linux guests each have a machine-id. (See: https://man7.org/linux/man-pages/man5/machine-id.5.html ). Cloning the guest won't alter the machine-id, so I'd have to do that manually as well.
- Unique SSH public key. There's a lot of debate on whether you actually need to have a unique public key for each guest, especially in a small home/home office with one human user, but I think you'll end up with more than one as soon as you start using SSH keys to automate things...
- Non-root user/non-root user and password. Honestly, if you want to change any of these and plan to deploy any number of guests, I think you have to use cloud-init or something similar.
- Am I missing anything from the list of required changes to avoid having two VMs step on each other?
- If not, do y'all think it would be a useful feature request to add a pair of new options to the guest clone GUI in Proxmox:
- [ ] randomize machine-id (for Linux) and
- [ ] randomize NIC MAC addresses (with an option to choose which NICs, or all of them)?