Hoping I can get some help here. I am using the virt-clone command to get an image of VyOS (open source linux router). The clone works fine but when I copy the image to another KVM host and install it the NIC card number changes. ports eth0 and eth1 turn into eth2 & eth3 on the new instance. Is there a way to keep this from happening?
on the original server I run:
vyos@vyos:~$ show int
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 - u/u
eth1 - u/u
lo 127.0.0.1/8 u/u
::1/128
vyos@vyos:~$
I then shutdown and clone:
virt-clone --original vyos --name vyos_clone --file vyos_clone
I copy the new cloned file to a different kvm host and run:
virt-install -n vyos --description "Vyos Server" --ram 1024 --vcpus 1 --os-type=linux --disk /VMs/vyos_clone,device=disk,bus=virtio,size=15,sparse=true,format=raw --graphics none --network=default,model=virtio --network=network:HUB1,model=virtio --import --noautoconsole --autostart
I start the servie with virsh start vyos
but when I view the interfaces the numbering has changed:
vyos@vyos:~$ show int
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth2 - u/u
eth3 - u/u
lo 127.0.0.1/8 u/u
::1/128
vyos@vyos:~$
Is there a way I can force the new VM/Domain to use eth0 and eth1 instead of eth2 & eth3?
I need these to stay the same so that I can write some scripts.
****** Update
I tried running the sysprep and it looks like it does not recognize the vyos's operating system:
> # virt-sysprep -a /VMs/vyos_clone [ 0.0] Examining the guest ... virt-sysprep: error: no operating systems were found in the guest
> image
>
> If reporting bugs, run virt-sysprep with debugging enabled and include
> the complete output:
>
> virt-sysprep -v -x [...]
I also tried editing the xml using virsh edit and taking out the mac addresses and restarting the domain but that did not fix the issue.
Thanks for your help C