Exercise: Cloning VMs with virt-clone
Clone kvm1 to a new VM host, kvm3, by executing the command below:
Check if the new VM is in the list, start it, then login to its console:
virt-clone --connect=qemu:///system -o kvm1 -n kvm3 -f /home/hostadm/KVM/kvm3.qcow2
Fix the host name:
virsh list --all
virsh start kvm3
virsh console kvm3
to the system as user hostadm, elevate privileges by running
sudo -s, then follow the procedure below to change the host name from
kvm1 to kvm3:
Edit file /etc/hostname and replace kvm1 by kvm3.
Reset the machine ID by running the following commands on kvm3:
Clear the DHCP leased IP settings:
Execute command reboot on kvm3:
Exit the VM console with ^] key combination.
rm -f /etc/machine-id
After reboot, the new VM should come up with the correct host name and the MAC address.