Make a clone of a virtual guest operating system in RHEL 5
Xen in Red Hat 5 does not include a guest OS cloning feature. However, there are two other ways to clone a guest: dd and LVM snapshots. This article explains the LVM snapshot method, which is easy and can be performed online. The procedure is simple. First create a snapshot. In this example, guest2 is a snapshot of guest1. #lvcreate -L [ขนาดเนื้อที่] -s -n guest02 /dev/VG0/guest01 Next, check that the command worked with:
lvscan
ACTIVE Original ‘/dev/VG0/guest01’ [4.91 GB] inherit ACTIVE Snapshot ‘/dev/VG0/guest02’ [4.91 GB] inherit The output shows guest2 as an LVM snapshot and guest1 as a normal LVM volume. Copy the guest1 configuration to guest2 with this command.
cp /etc/xen/guest01 /etc/xen/guest02
Edit /etc/xen/guest02. Change guest1 to guest2. Set the MAC address on the “vif=” line to a value different from guest1, and also change the UUID so that it differs from guest1. Start guest2 with: #xm create guest02 You can then manage guest2 with Red Hat’s virt-manager using this command. #virt-manager