There are two questions when I am using Proxmox

SmithCruise

New Member
Oct 14, 2019
12
0
1
34
First, sometimes I want to reinstall VM's system, I have to delete VM, then create a new machine and configure the same IP address. Is there any way to reinstall VM's system easier( Like one-click to reinstall it ).

Second, When I create a new VM, I want a allocate IP from my IP pool, how should I configure it?
 
You can create a VM, then make it a Template. From that you can re-create a new VM very quickly, with one click (or maybe more than one really, but it is very very quick and simple). You can also take a backup of a VM, and generate new VMs from that backup, again with only a few clicks.

In all of the above cases, you could have issues with IP addresses, since the VM will have had a specific IP address allocated when you created it.

To get around this, you can use Cloud-Init. Cloud-Init allows you to change the IP address allocated to a VM from the Proxmox GUI. However, it requires that the VM be correctly configured to use Cloud-Init. The easiest method to do so is to download a pre-created Cloud-Init supporting installation ISO for the OS you want. There is one for Ubuntu, Centos and so on that you can download. Search for the name of the OS you wants and CloudInit or Cloud-Init and ISO and you should find some.

Alternatively, you can add Cloud-Init to an existing VM. I'm sure this is very easy if you know how, but I've not managed to get it to work myself.

Yet another alternative is to set the VM to use DHCP, and then create a DHCP server in another VM or CT. You would then configure the DHCP server to allocate a particular IP to a device with a particular MAC address, that being the MAC address of the VM you want to allocate the IP address to.

Many have asked for DHCP facilities to be built into Proxmox for just this purpose, including me, but the consensus is that it isn't a good idea and it is best to have a VM or CT for that purpose. You can't really argue with this logic because by doing it yourself you will have full control of all variables.

One final thing. If you don't want to mess with Cloud-Init or DHCP, there is one final option. When creating the original VM, give it an unused IP that you will never allocate to a running VM. It could even be a fake IP. Then create new VMs from a Template or a Backup, and simple login via console, change the Ip to a real one, and all will be well. Maybe. :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!