How to clone from a template with a proper network interface?

Sraw

New Member
May 31, 2018
2
0
1
24
When I create a VM of Centos6.9, and then I convert it to a template.

After that, I clone a VM from this template, but the problem is the name of network interface.

As Proxmox generates a new MAC address, in `/etc/udev/rules.d/70-persistent-net.rules`, there is a new device named `eth1` with the new generated MAC address. But in `/etc/sysconfig/network-scripts`, there is only device eth0.

If I delete `70-persistent-net.rules` and reboot the VM, it will be regenerated and the device name will be `eth0`, then everything works well.

So my question is, how to clone from a template and let the new cloned VM have the proper network interface settings?
 
You can remove the 70-persistent-net.rules from de template.
Actually, I have tried but failed. Then I try `ln -s /dev/null /path/to/70-persistent-net.rules` and it works.

Although it works, I am still confusing about it... Why just deleting doesn't work but create a soft link to `null` can work. :/
 

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!