[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] restoring backup from an LVM Guest OS on KVM Lucid

On 10/04/2010 04:47 PM, Tapas Mishra wrote:
Yes Justin that does help.
I need one more information.
When I used virt-manager had installed the guest OS in and LVM.
The process of creating a ext4 and swap in that LVM was taken care by
How does virt-manager do that?

virt-manager isn't something that I know much about personally (sorry).

But, my understanding is that it uses both the libvirt API (a
virtualisation programming interface) for some things, plus leverages
other virtualisation utilities for things.

I *think* the installation part may be done by "virt-install", but
that's from my looking at the "dependency" list of virt-manager, on
it's website:

  (near the bottom, where it says "Pre-requisites"

Suppose I take an rsync backup of the filesystem on LVM.(Swap wont be backed
up in fact it is not needed)
Then on the other server if I want to use this rsync backup i.e. want to
boot from the os whose backup was taken is how is that done?

It sounds like you're going to be doing a "very manual" migration,
rather than using the automated tools.

Guests have pretty much two components:

  * Disk images (LVM, images files, etc)
  * XML definition for the guest, containing relevant info

Are you comfortable using a command line?

If so, with the disk image part of things, which you mentioned you have
in LVM, I'd probably look at manually creating the LVM partitions on
"server B", matching the size of the partitions on "server A".  Then
use "dd" or a similar utility to copy the data to the new partitions.
(being very careful of course)

That would likely get the data from server A to server B.  Then you
need to get the XML definition file from server A and load that into
server B.  Using the command line, it's very simple. :)

To get the XML definition file for a guest, use the "virsh" command
line utility:

  $ sudo virsh dumpxml myguestname

That will spit out the XML definition on the command line, so you would
need to redirect it to a file.  Something like:

  $ sudo virsh dumpxml myguestname > /tmp/myguestname.xml

Take a look in the file, you'll notice that it contains things like the
path to the image file, the MAC address of the virtual network adapter,
and that kind of thing.  Useful to know, if you need to modify things
at some point.  :)

Anyway, to load the XML definition file, you can use the virsh utility,
but this time on server B.  (after you've copied the xml file across)

  $ sudo virsh define /path/to/xml/file_name.xml

That will load in the definition for the guest, without starting it.

You can then use virt-manager to control the guest as you want.  ie.
start it, stop it, view its console, etc.

I have a suspicion that virt-manager may also include the ability to
load an existing XML file, but it's not something I've looked at, so you
might want to investigate first. :)

Note that all this, is for the "do it yourself" version of migration.

If you move your guests onto shared storage (for example NFS or iSCSI),
then you can do migrations "live" from server A to server B (to server
C, D, E. etc) while the guests are still running, all from within
virt-manager.  If you plan on doing much guest migration in the future,
this is something you should look into. :)

All good?

Regards and best wishes,

Justin Clift

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]