KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

Copy Guest From Another System?

3 replies [Last post]
dawall
User offline. Last seen 7 weeks 5 days ago. Offline
Joined: Jul 14 2010
Points: 3

I have what I thought was a simple question but I cannot find an answer after searching the web for most of the morning. My goal is to copy a KVM Guest to another system. Both systems are running KVM under RedHat 5.5 Server on similar hardware (x86 64-bit). The guest is running RedHat as well, but it could also be running Windows Server 2008. It takes most of a couple days to install and setup software on the original guest. Instead of duplicating that effort each time I need a new server, I would like to simply copy (clone, export/import) the original, then update the system name and IP Address once it has been copied. This strategy works quite well when using VMWare for virtualization. They provide a tool to copy an image from one host to another. Once at the target I bring up the copy and fix up name and address. In a couple of hours (most of which is the tool copying data across the network) I have two systems running the application set. Our team wants to support both VMWare to KVM, that's why I need the technique to copy images to another server when on KVM. KVM must have a way to do what is quite easy in VMWare. Any pointers to the instructions?

Thanks!

Dave Wall

mark
User offline. Last seen 7 weeks 2 days ago. Offline
Joined: Jul 14 2010
Points: 5
Did you think about using a

Did you think about using a LVM volume for the data of the guest and copy the LVM volume? That way you would get a copy of the guest and after that you could alter some files and copy the config to start the guest. It should be doable I think.

herda05
User offline. Last seen 6 weeks 4 days ago. Offline
Joined: Jul 22 2010
Points: 4
Use the migration steps in the guide
herda05
User offline. Last seen 6 weeks 4 days ago. Offline
Joined: Jul 22 2010
Points: 4
Straight VM copy to another server

Dave,

You can also use the virt-install command to do an import if you have copied over the disk image. Here's an example of
one from my host:

sudo virt-install --name acce1 --ram=1024 --os-type=windows --os-variant=win2k3 --hvm --virt-type=kvm --import --disk=/kvm/images/rmtDC-clone.img --network bridge=virbr0

There's some help on virt-install by simply typing virt-install --help at the terminal.

Dan H.

Post new comment

The content of this field is kept private and will not be shown publicly.