LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-22-2011, 08:21 AM   #1
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 257

Rep: Reputation: 31
ubuntu move kvm guest from one host to another


I have a host with 4 VMs on it. How do I move them to another host?

The first host is dying and I want to move the VMs to another host. I tried to copy the files under /vms from one host to another and then copy the files under /etc/libvirt/qemu to the other host. I then ran "virsh" and it does not see them.

I'm missing something. Please help
Thank you
 
Old 04-18-2011, 06:12 PM   #2
dariusb12
LQ Newbie
 
Registered: Feb 2011
Posts: 9

Rep: Reputation: 1
thllgo, not sure if this helps but you can use the --import feature of virt-install. Basically, what you have to do is as follows:

1 - figure out how the guest OS is stored (image files, logical volume, etc.)
2 - read the contents of dumpxml xxxx (from virsh where xxxx is your guest OS) and write down the key parameters
3 - copy over the guest OS image (assuming it's an image) to your new host machine
4 - fire up virt-install and use the --import parameter

For instance, if your guest OS is on "virtual.img" in some directory (here it's /home/temp), you can fire it up on your new KVM host like this (the other parameters are made up):

virt-install \
--accelerate -v \
-w bridge:br0 \
-n virtual1a \
-r 2000 \
--os-variant=rhel5.4 \
--vnc \
--import \
--disk path=/home/temp/virtual1.img

Step 2 is the trickier part if it's a LV or something (an image file is nice because you can just copy it over). Also, for step 4, you're virt-install parameters should be informed by what you see from the dumpxml results (step 2). It seems like you should be able to skip virt-install and somehow "dump" and "import" directly in virsh, but we haven't tried that. Anyway, hope that helps.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM Guest to Host Bridge Hijacking F14 goatboyx Linux - Virtualization and Cloud 2 03-05-2011 02:09 PM
[SOLVED] Qemu-kvm file sharing Linux host Xp guest problems Linux.tar.gz Linux - Virtualization and Cloud 6 11-23-2010 05:57 AM
KVM: run guest commands from host without SSH s7upify Linux - Virtualization and Cloud 1 08-16-2010 02:29 PM
Share between Qemu-Kvm host and guest Alexvader General 1 06-13-2010 03:07 PM
Has anyone attempted running OS/2 guest under KVM (or other host)? kaza Linux - Virtualization and Cloud 3 05-16-2010 02:53 PM


All times are GMT -5. The time now is 12:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration