[SOLVED] when cloning a kvm VM the mac address is renewed

Discussion in 'Proxmox VE: Installation and configuration' started by stephane de Labrusse, Jul 4, 2016.

  1. stephane de Labrusse

    Joined:
    Jul 2, 2016
    Messages:
    11
    Likes Received:
    0
    Hi
    I don't know if it is a feature or a bug, but when I do a full clone of a kvm virtual machine by the WebUI, the mac address of the new machine is not the same than the source machine.

    When I read this https://pve.proxmox.com/wiki/Duplicate_Virtual_Machines I do understand that if you want a new mac address you must remove the NIC after the cloning and add a new one.

    I run the last proxmox version :

    root@htpc:~# apt list proxmox* pve*
    Listing... Done
    proxmox-ve/now 4.2-48 all [installed,local]
    pve-cluster/now 4.0-39 amd64 [installed,local]
    pve-container/now 1.0-62 all [installed,local]
    pve-firewall/now 2.0-25 amd64 [installed,local]
    pve-firmware/now 1.1-8 all [installed,local]
    pve-ha-manager/now 1.0-28 amd64 [installed,local]
    pve-kernel-4.4.6-1-pve/now 4.4.6-48 amd64 [installed,local]
    pve-libspice-server1/now 0.12.5-2 amd64 [installed,local]
    pve-manager/now 4.2-2 amd64 [installed,local]
    pve-qemu-kvm/now 2.5-14 amd64 [installed,local]

    When I do a backup and then I restore it to another VM ID, the mac address is the same, so I have an immediate workaround because I mainly use proxmox to virtualise SME Server and the Mac address is used in the configuration database to set the IP. Therefore if the mac change, you must reconfigure you vm before to use the network.
     
  2. dea

    dea Member
    Proxmox Subscriber

    Joined:
    Feb 6, 2009
    Messages:
    118
    Likes Received:
    0
    It is a feature (I assume to be absolutely sure that two vm are not running with the same MAC).
     
  3. stephane de Labrusse

    Joined:
    Jul 2, 2016
    Messages:
    11
    Likes Received:
    0
    Thanks a lot for your answer. Virtualbox asks if you want to reinitialise the Mac addresses of all NIC by a checkbox just before to clone the VM,....that would be a nice NFR.

    I will go with the backup and restoration process
     
  4. dea

    dea Member
    Proxmox Subscriber

    Joined:
    Feb 6, 2009
    Messages:
    118
    Likes Received:
    0
    No, It's more simple.
    If you want the same MAC, copy and paste the original MAC over the new (modified).
     
  5. stephane de Labrusse

    Joined:
    Jul 2, 2016
    Messages:
    11
    Likes Received:
    0
    Indeed, it is another solution, but ..... Sorry for my impertinence ...I'm just coming from a full Virtualbox solution and I feel that the time to clone a machine is really long (much longer than VB). The backup/restoration process is a quick and easy way.

    Maybe I can be the bug also... As I said I'm a newby here.
     
  6. stephane de Labrusse

    Joined:
    Jul 2, 2016
    Messages:
    11
    Likes Received:
    0
    I tested the solution to copy and paste the old Mac address to the new machine, and it doesn't work, the new machine is looking to the old NIC without finding it....it seems like the udev rules as changed something.

    EDIT:
    Maybe something specific to SME Server 9(centos6 based) but every new mac add a new rule to /etc/udev/rules.d/70-persistent-net.rules with a new NIC name (eth1,eth2,eth3...). Of course it is not good for me :)
     
    #6 stephane de Labrusse, Jul 4, 2016
    Last edited: Jul 4, 2016
  7. fabian

    fabian Proxmox Staff Member
    Staff Member

    Joined:
    Jan 7, 2016
    Messages:
    3,183
    Likes Received:
    492
    the time to clone depends very much on whether you are doing a full or a linked clone and on the underlying storage technology and speed.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. LnxBil

    LnxBil Well-Known Member

    Joined:
    Feb 21, 2015
    Messages:
    3,494
    Likes Received:
    309
    One thing that does also change by cloning is the system UUID, which is needed for Windows Activation.
     
  9. stephane de Labrusse

    Joined:
    Jul 2, 2016
    Messages:
    11
    Likes Received:
    0
    Indeed the clone linked is much more faster than a full clone :

    I solved my issue by the backup and the restore feature...do a backup of your vm, then in the storage view restore the backup to another vm ID
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice