[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-users] Xen Image File vs LVM
On Mon, Aug 4, 2008 at 12:46 PM, Chris Edwards <cedwards@xxxxxxxxxxxxxxxx> wrote: 1. Yes, you can have a seperate LV per Xen guest OS and you should of course.
Third times the charm. I can create virtual machines but I can't click on "reply all". 2. LVM snapshots go something like this. Snapshotting is a way to take a "point-in-time" image of a filesystem. What this allows you is to do is access files that would normally be locked so you can back them up. The process is as follows:
Taking the snapshot
When you take the snapshot, you're
essentially creating a new LVM
device that appears to be a duplicate of the "real" filesystem at a
point in time. To do this we create another LVM device (using lvcreate)
with an argument of -s to indicate we want a snapshot and the -n
argument to name it. In this case LogVol00 is the original LV and
LVsnap is the name of the snapshot. You can name them whatever you want. lvcreate -l 500 -s -n LVsnap /dev/VolGroup00/LogVol00 Mounting the snapshotNext, we mount the snapshot somewhere else, we use /media/snap. We also mount it read only. mkdir /media/snap Do the backup
Now, backup /media/LVsnap like you would any other directory: Unmount and destroy the snapshotNow we have to unmount the snapshot and destroy it. The reason we destroy it because any I/O that takes place on the device uses space to track the differences betweeen the real and the snapshot filesystem. Plus, we've done our job so there's no reason to keep it around. 3. Migrating an LV depends some on whether you have to depend on a bootloader in the LV or not. You could do any of the following depending on your circumstances.unmount /media/LVsnap
dd if=/dev/VolGroup00/LVsnap | ssh -c arcfour 192.168.2.100 "dd of=/dev/VolGroup00/LogVol00"I don't think I have to tell you to be VERY careful with the last one. If you get the destination Logical Volume screwed up you will toast the destination. I specified arcfour for the cipher because it's much faster than the default. You will probably want to mess with dd's blocksize too as you can double the speed in which dd will copy if the blocksize is larger. Another option would be to use ddrestore or dd_restore in place of dd. Make sure you look at the syntax difference first. Both of these are faster than stock dd but if you bump the blocksize dd will almost keep up. I assume you only keep the VM OS on the LV and not all data. If so then it won't take long to copy. It takes about 45 min per 80 GB here. If you're running a 10GB OS LV then you can figure about 5 minutes. Grant _______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-users
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |