[CentOS-virt] (KVM) How can I migrate VM in a non shared storage environment?

Thu Jun 24 21:22:05 UTC 2010
C.J. Adams-Collier <cjac at colliertech.org>

Note, the -x argument will keep the copy to a single partition

On Thu, 2010-06-24 at 14:12 -0300, Lucas Timm LH wrote:
> Create a new virtual machine on your storage. After this, boot some
> Linux distribution in your new virtual machine (I like SysrescueCD).
> Enable your ssh server, change the root password and so and back to
> your old virtual server and type:
> 
> 
> # dd if=/dev/sda | ssh root@(new_vm) "(dd of=/dev/sda)"
> 
> 
> Type the root password, shutdown the old VM and reboot your new vm.
> 
> 
> (PS: You don't need to shutdown the old vm to this proccess).
> 
> 
> I do this everytime, I don't like copy the HD files using cp, tar or
> rsync because it try to copy the /proc, /dev and a lot virtual
> devices. Using dd it copies just the HD bits, the boot sector, etc.
> 
> 2010/6/24 C.J. Adams-Collier <cjac at colliertech.org>
>         I often use rsync -a for remote systems or cp -a for local
>         systems.
>         I've also used dd.  You can have dd output to stdout, pipe it
>         to ssh and
>         have ssh output to dd on the other end.
>         
>         You can also connect to a SAN device on the source and dd from
>         the local
>         block device to the SAN device.
>         
>         Lots of ways to do it ;)
>         
>         Cheers,
>         
>         C.J.
>         
>         
>         On Thu, 2010-06-24 at 10:52 -0400, Kelvin Edmison wrote:
>         >
>         >
>         > On 24/06/10 7:17 AM, "Poh Yong Hwang" <yongsan at gmail.com>
>         wrote:
>         >
>         > > I have a server running CentOS 5.5 with KVM capabilities.
>         I need to migrate
>         > > all the VMs to another server with the exact same hardware
>         specs. The problem
>         > > is it is running on individual harddisks, not shared
>         storage. What is the best
>         > > way to migrate to minimise downtime?
>         >
>         > I've had good success using dd and nc (netcat) to copy the
>         contents of a
>         > disk or disk image from one machine to another, and
>         verifying the copy was
>         > successful with a md5sum or sha1sum of both the original and
>         copied disk.
>         >
>         > Kelvin
>         >
>         > _______________________________________________
>         > CentOS-virt mailing list
>         > CentOS-virt at centos.org
>         > http://lists.centos.org/mailman/listinfo/centos-virt
>         
>         
>         _______________________________________________
>         CentOS-virt mailing list
>         CentOS-virt at centos.org
>         http://lists.centos.org/mailman/listinfo/centos-virt
>         
> 
> 
> 
> -- 
> Lucas Timm, Goiânia/GO.
> http://timmerman.wordpress.com
> 
> (62) 9157-0789
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20100624/0cd67c0e/attachment-0004.sig>