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

Re: AW: [Xen-users] snapshot - backup for xen vm's



Thanks a lot! It really helps.

Let me summarise some backup ideas here: (only for file-backed image Dom U)

Dom 0: LVM
Dom U: file-backed image,  LVM inside Dom U.

Backup dom U:

idea 1:  given by Petersson Mats

# xm save domU somefile
# cp domU.img domU.img.bak
# cp somefile somefile.bak
# xm restore somefile

note: save / restore for full-virtual is only available in Xen 3.10.

idea 2: given by Fajar, correct me if I misunderstand.

1), assume I put all guest images in dom 0 /var/lib/xen/images (image1, image2 ...) each image is a guest system. 2), make snapshot for /var/lib/xen/images. question: if image1 is 10G, image2 is 20G, how large the snapshot needs? 30G enough? I am quit sure how snapshot works when it is a very big image file.
3), mount snapshot
4), copy image1 .... copy image2.......
5), umount
6), remove snapshot.
question: the image1.bak actually is a backup of a running guest system, when I start the system by this image1.bak, the system is gonna be OK? It is like a reboot a running system, isn't it? correct me. plz. or maybe some reference for my stupid question.

---
compare: idea 1 seems easier to do, but the system would be unavailable for 10 or more mins, copy 10G file isn't so quick.....
idea 2 seems more complicate, but it make the system running 24 hours.

Is there any better ideas for backing up xen guest file based dom U ? please advise.

Thanks a lot for all kind people in the xen-list.

cheers,
x




Fajar A. Nugraha wrote:

Xin Chen wrote:
Does this snapshot backup idea work with image?

I didn't put guest system as partition, I put them as image, one huge
image. Does this backup way work with image?

"backup from vm with mounting an archive nfs-server", like Josef did,
works pretty much for any kind of setup since you're doing backups from
domU (not 0). But in that case you don't create a snapshot first.

An example whre this might be good, is if you only have small files
which rarely changed (think php web pages, config files, etc.).

An example where this might be BAD :
- You have mysql or oracle
- Store data on LARGE datafiles (say several hundred MBs)
- Your database server is busy, accessed and updated all the time
- You "backup" the datafile by copying it to remote nfs server while the
db server is running
Which leads to unrecoverable, inconsistent database.

My initial suggestion to Josef's question was to use LVMs for domU
storage, and use LVM snapshot to create a "consistent" view of the
filesystem at that time.

If you use file-backed image domU, stored on domU filesystem, then you
can still use LVM snapshots. It just requires a few different steps.
Assuming your dom0 is stored on LVM (not partition):
- create an LVM snapshot of dom0's fileystem
- mount that snapshot
- backup your image from that snapshot

Note that in this case you backup the entire domU HD image, and NOT
their content. If your domU uses LVM setup (inside the domU), then this
is pretty much the only option you have. You can backup the disk image,
but not the content directly.

However,
If you use those file-based disk images as direct partitions on domU,
you can mount the file from that snapshot to get their content.
If your domU use partition setup (not LVM setup), you can use kpartx and
create block device entries.

cause I don't wanna to save /restore everytime when I backup the guest
system. It takes 10 mins downtime!

You don't have to. Not if you just want to backup the disk image or its
content.
Regards,

Fajar


cheers!

it-news (Josef Lahmer) wrote:

dear ralf schenk,
dear Fajar,

i've useing the xensource installation iso which does lvm on dom0 by
default and i am quite happy with this installation.

now i'm using backup from vm with mounting an archive nfs-server
store and copy the important files.



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.