[Debian] Re: Bug#476535: vzctl: Possibility to mount/bind into VE fs

Christian Hofstaedtler ch+openvz at zeha.at
Thu Apr 24 04:23:33 EDT 2008


Hi!

> > >  Do we need a poststop as well?
> > 
> > You're right, I happen to be lazy and usually let the system to umount
> > all; but with high probability we should umount every manually mounted
> > cruft before stop tries to unmount the whole VE, so a prestop should
> > exist the same way prestart was implemented.
 
> > And by all means feel free to post it upstream, you may be more
> > familiar with the process than I am now.

We are doing similar things with the /etc/vz/conf/$VEID.mount and
/etc/vz/conf/$VEID.umount scripts; they are automatically handled by
vzctl, but I'm not sure this is documented (except somewhere buried 
in old VZ pdfs).

mount and umount obviously run at vzctl mount/umount time, which is
pretty much pre-start and post-stop, and also does the "right thing"
if manually starting/stopping a VE.
These scripts can also prevent a VE from starting/stopping, if they
return a non-zero value.

Maybe you want to look at these first?

Examples:
cat /etc/vz/conf/201004.mount
#!/bin/sh
mount -onoatime /dev/raid10/ve201004-pg /var/lib/vz/root/201004/srv/db/pg

cat /etc/vz/conf/201004.umount
#!/bin/sh
umount /dev/raid10/ve201004-pg
exit 0 # ignore error from umount


BTW, mounting filesystems into VEID/root probably breaks vzmigrate, 
so one needs to be careful :-)

-Christian



More information about the Debian mailing list