FAQ
Hi,

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?

Thanks!

YongSan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.centos.org/pipermail/centos-virt/attachments/20100624/45a870a9/attachment.html

Search Discussions

  • Compdoc at Jun 24, 2010 at 9:54 am
    One way would be to boot the VMs with a product like Acronis or Ghost, and
    create an image of the VM's drive(s).



    Then create a new VM on the 2nd server that has nics with the same MAC
    addresses as the old VM, and storage with the same sizes, and restore the
    image there.









    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos-virt/attachments/20100624/383f648b/attachment.html
  • Kelvin Edmison at Jun 24, 2010 at 10:52 am

    On 24/06/10 7:17 AM, "Poh Yong Hwang" 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
  • C.J. Adams-Collier at Jun 24, 2010 at 1:02 pm
    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" 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
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    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/8f5341fd/attachment.bin
  • Lucas Timm LH at Jun 24, 2010 at 1:12 pm
    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" 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 --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos-virt/attachments/20100624/a2f200ca/attachment.html
  • C.J. Adams-Collier at Jun 24, 2010 at 5:22 pm
    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" 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: not available
    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.bin
  • Dennis J. at Jun 24, 2010 at 6:29 pm
    This can be useful in some cases:
    http://www.bouncybouncy.net/ramblings/posts/xen_live_migration_without_shared_storage/

    With the blocksync.py script on that page you can first make a copy of the
    block device while the VM is still running. Then shut down the VM and make
    another run only this time you only have to copy over the bits that have
    changed during the previous sync. Depending on HD/CPU/Net performance this
    can reduce the downtime a bit.

    Regards,
    Dennis
    On 06/24/2010 11:22 PM, C.J. Adams-Collier wrote:
    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


    _______________________________________________
    CentOS-virt mailing list
    CentOS-virt at centos.org
    http://lists.centos.org/mailman/listinfo/centos-virt
  • Christopher Hunt at Jun 28, 2010 at 12:17 pm
    +1 for dd + nc over ssh if necessary.

    This process can and probably will saturate your ethernet interface, so
    depending upon the amount of traffic the box pushes on the public
    interface the size of the partition and other factors, sometimes i add a
    crossover cable between unused interfaces on the 2 boxes and run the
    process over that interface, so it doesn't impact the running vms.

    Cheers
    -Chris
    On 6/24/2010 9:00 AM, centos-virt-request at centos.org wrote:

    Message: 3
    Date: Thu, 24 Jun 2010 10:52:57 -0400
    From: Kelvin Edmison<kelvin at kindsight.net>
    Subject: Re: [CentOS-virt] (KVM) How can I migrate VM in a non shared
    storage environment?
    To: Discussion about the virtualization on CentOS
    <centos-virt at centos.org>
    Message-ID:<C848E989.30D95%kelvin at kindsight.net>
    Content-Type: text/plain; charset="US-ASCII"




    On 24/06/10 7:17 AM, "Poh Yong Hwang"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


    End of CentOS-virt Digest, Vol 34, Issue 13
    *******************************************
  • C.J. Adams-Collier at Jun 28, 2010 at 12:27 pm
    If you do it often, you might consider listening for ssh connections on
    a separate port and using tc to keep things from getting out of hand:

    http://linux.die.net/man/8/tc

    Cheers,

    C.J.
    On Mon, 2010-06-28 at 09:17 -0700, Christopher Hunt wrote:
    +1 for dd + nc over ssh if necessary.

    This process can and probably will saturate your ethernet interface, so
    depending upon the amount of traffic the box pushes on the public
    interface the size of the partition and other factors, sometimes i add a
    crossover cable between unused interfaces on the 2 boxes and run the
    process over that interface, so it doesn't impact the running vms.

    Cheers
    -Chris
    On 6/24/2010 9:00 AM, centos-virt-request at centos.org wrote:

    Message: 3
    Date: Thu, 24 Jun 2010 10:52:57 -0400
    From: Kelvin Edmison<kelvin at kindsight.net>
    Subject: Re: [CentOS-virt] (KVM) How can I migrate VM in a non shared
    storage environment?
    To: Discussion about the virtualization on CentOS
    <centos-virt at centos.org>
    Message-ID:<C848E989.30D95%kelvin at kindsight.net>
    Content-Type: text/plain; charset="US-ASCII"




    On 24/06/10 7:17 AM, "Poh Yong Hwang"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


    End of CentOS-virt Digest, Vol 34, Issue 13
    *******************************************
    _______________________________________________
    CentOS-virt mailing list
    CentOS-virt at centos.org
    http://lists.centos.org/mailman/listinfo/centos-virt
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 198 bytes
    Desc: This is a digitally signed message part
    Url : http://lists.centos.org/pipermail/centos-virt/attachments/20100628/d2054da9/attachment.bin
  • Poh Yong Hwang at Jul 5, 2010 at 11:11 pm
    Hi All,

    Thanks for all your suggestion. Just a check, if i have a full backup on the
    server but due to the different specs of the hardware so i am unable to do a
    bare metal restore, can i just dump all the folders under /var/lib/libvirt
    which also includes the images folder? Will it work that way?

    Here is the folders in libvirt:

    [root at pop-kvm-web libvirt]# ls
    boot images iptables network qemu

    Thanks!

    yongsan

    On Tue, Jun 29, 2010 at 12:27 AM, C.J. Adams-Collier
    wrote:
    If you do it often, you might consider listening for ssh connections on
    a separate port and using tc to keep things from getting out of hand:

    http://linux.die.net/man/8/tc

    Cheers,

    C.J.
    On Mon, 2010-06-28 at 09:17 -0700, Christopher Hunt wrote:
    +1 for dd + nc over ssh if necessary.

    This process can and probably will saturate your ethernet
    interface, so
    depending upon the amount of traffic the box pushes on the public
    interface the size of the partition and other factors, sometimes i add a
    crossover cable between unused interfaces on the 2 boxes and run the
    process over that interface, so it doesn't impact the running vms.

    Cheers
    -Chris
    On 6/24/2010 9:00 AM, centos-virt-request at centos.org wrote:

    Message: 3
    Date: Thu, 24 Jun 2010 10:52:57 -0400
    From: Kelvin Edmison<kelvin at kindsight.net>
    Subject: Re: [CentOS-virt] (KVM) How can I migrate VM in a non shared
    storage environment?
    To: Discussion about the virtualization on CentOS
    <centos-virt at centos.org>
    Message-ID:<C848E989.30D95%kelvin at kindsight.net<C848E989.30D95%25kelvin at kindsight.net>
    Content-Type: text/plain; charset="US-ASCII"




    On 24/06/10 7:17 AM, "Poh Yong Hwang"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


    End of CentOS-virt Digest, Vol 34, Issue 13
    *******************************************
    _______________________________________________
    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
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.centos.org/pipermail/centos-virt/attachments/20100706/e434a602/attachment.html

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos-virt @
categoriescentos
postedJun 24, '10 at 7:17a
activeJul 5, '10 at 11:11p
posts10
users7
websitecentos.org
irc#centos

People

Translate

site design / logo © 2022 Grokbase