Subject: Re: [vserver] [Q] HOWTO copy /etc/vserver
From: Corey Wright <undefined@pobox.com>
Date: Fri, 16 Jan 2009 08:31:08 -0600

On Fri, 16 Jan 2009 07:20:18 -0600
"John Alberts" <john.m.alberts@gmail.com> wrote:

> On Fri, Jan 16, 2009 at 12:33 AM, randall <randall@songshu.org> wrote:
> > Roderick A. Anderson wrote:
> >> What I'd like to do is make a copy of the /etc/vservers directory,
> >> possibly while the guests are running.  Since there several links
> >> created when a guest is started I have concerns about just doing a
> >> tarball of the directory.
> >>
> >> Any suggestions, thoughts, or ideas on this?
> >
> > just a taught,
> > personally i have tried copying Vservers but with mixed results,
> > especially if any myql database was involved, so i prefer to turn them
> > of when i do the copying (i use rsync -ac , but that might not be
> > usefull for just one time copy)
> >
> > i always make a LVM Snapshot after shutting down the vservers so i can
> > start the servers again quickly and limit the downtime.
> 
> Well, this that's not really anything specific to vservers.  You can't
> copy a running mysql db unless you either use mysqlhotcopy or your
> flush and read lock all of your db tables.  Yes, an LVM snapshot is
> the perfect way to minimize downtime.  Just shutdown the vserver,
> create a snapshot and start the vserver again.  You shouldn't be down
> for more than a minute and you'll have a nice non running static copy
> of the files to make a copy of.

unless you are moving the vserver instead of copying it, so you have
downtime until the vserver is up and running on the new machine.  for this
i find it quickest if i rsync the vserver while running and then again
after stopping the vserver.  the first "running" rsync gets the bulk of the
files copied over and usually a few extra due to temporary
directories/files that only exist while the vserver is running, but it's
all cleaned up when i do the second "stopped" rsync after stopping the
vserver (and it's pretty fast as the bulk of the data was already
transfered in the first rsync).

but this is really all off-topic as the original question was about moving
the /etc/vservers (metadata) directory while running and not the actual
vservers themselves.  neither of our methods satisfy the "while running"
requirement.  (not that i haven't liked the thoughtful, stimulating
discussion of backup/copying/moving vservers as i had forgotten about
lvm-snapshots.  i can even snapshot /etc/vservers as all of my setups are
root-on-lvm-on-raid.)

corey
-- 
undefined@pobox.com