I first created a ‘template’ vm containing all stuff I need and using a temporarily ip adres.
In the network config file of eth0 (/etc/sysconfig/network-scripts/ifcfg-eth0) I comment out the HWADDRESS line, else it will not come up with another mac address…
Stop this ‘template’ vm as it is just used for cloning.
Create a backup : vzdump –dumpdir /path/to/backupdir –snapshot 101
Restore in new container : vzrestore /path/to/backupdir/backupfile_of_container_101 102 or vzrestore –storage ‘storagename’ /path/to/backupdir/backupfile_of_container_101 102
Create a new mac for eth0 : vzctl set 102 –netif_add eth0
Modify the hostname in the proxmox webinterface.
Bootup the vm and open a vnc console.
Change the ip address in /etc/sysconfig/network-scripts/ifcfg-eth0
Go to /etc/ssh and remove all keys : rm -f /etc/ssh/*key*
Restart the ssh server so it will regenerate keys : service sshd restart