Skipping quota at start and doing it later? [message #30102] |
Sun, 11 May 2008 17:10 |
Gregor Mosheh
Messages: 62 Registered: April 2007
|
Member |
|
|
Hey guys.
Some of our VPSs take well over an hour to start up after an unexpected
shutdown, thanks to vzquota. Reading the man page, it seems that vzquota
cannot be skipped and then done later once the services are up. Am I
correct about that, or IS there a way to skip quota checking until after
the VPS has started?
--
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/
"Remember that no one cares if you can back up,
only if you can restore." - AMANDA
|
|
|
|
|
|
Re: Skipping quota at start and doing it later? [message #30111 is a reply to message #30110] |
Mon, 12 May 2008 15:30 |
Gregor Mosheh
Messages: 62 Registered: April 2007
|
Member |
|
|
Matt Ayres wrote:
> Which version of the vzctl RPM do you have installed? On my
> vzctl-3.0.22-1 I see the following in /etc/init.d/vz:
My versions:
vzctl-3.0.22-1
vzctl-lib-3.0.22-1
ovzkernel-2.6.18-53.1.13.el5.028stab053.10
vzquota-3.0.11-1
I have the same paragraph in the init script.
What I read is:
If fastboot and disk_quota are both yes,
make sure that quota isn't already running,
then run vzquota on.
In our case, neither FASTBOOT nor DISK_QUOTA are set in the conf files,
yet vzquota runs anyway (normally good, but after a power failure very
time consuming). The --nocheck option is not mentioned in the man pages
nor does it seem effective. What am I missing here?
My hack was to add a "vzquota off" line right above the "vzquota on"
line. It's effective, but not as great as a "real" solution.
--
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/
"Remember that no one cares if you can back up,
only if you can restore." - AMANDA
|
|
|
|
Re: Skipping quota at start and doing it later? [message #30114 is a reply to message #30113] |
Mon, 12 May 2008 16:41 |
TheWiseOne
Messages: 66 Registered: September 2005 Location: Pennsylvania
|
Member |
|
|
Gregor Mosheh wrote:
> Matt Ayres wrote:
>> All you have to do is set VZFASTBOOT=yes in /etc/vz/vz.conf and VPS's
>> will be started without quota and then will be restarted to calculate
>> the quota after all have been started.
>
> I think I see where we're misconnecting. You say that FASTBOOT will
> cause all VPSs to start, then those with fastboot will be re-started
> later so their quota info can run?
>
> What I'd really like it to skip the quota recalculation entirely,
> achieve the same effect I currently do with vzquota off (repairing
> quota file without recalculating) and vzquota on (turning quota on).
>
VZFASTBOOT is the option. /etc/vz/vz.conf is the main Virtuozzo config,
not a VPS/Container config file -- it is a global option, it cannot be
set per-Container. If you set that option in vz.conf then you will
achieve the effect you desire.
If you look at the code, it checks in VZFASTBOOT is set to yes, if it is
then it starts the VPS with vzquota nocheck. Once all VPS's are started
it will iterate over all VPS's stopping them, calculating the quota, and
starting the VPS back up.
---
if [ "x${VZFASTBOOT}" = "xyes" -a "x${DISK_QUOTA}" =
"xyes" ];
then
$VZQUOTA stat ${veid} >/dev/null 2>&1
if [ $? -eq 6 ]; then
if $VZQUOTA show ${veid} 2>&1 | grep
"vzquota : (warning) Quota is running" >/dev/null 2>&1; then
$VZQUOTA on ${veid} --nocheck
>/dev/null 2>&1
---
That does the check I stated above, VPS's are started with an
out-of-sync quota.
---
need_restart="${need_restart}
${veid}"
---
This sets a flag that this VPS needs to be restarted normally later on
in the script. The normal restart will cause the quota to be fully checked.
I assure you this is the option you want enabled.
Thanks,
Matt
|
|
|
|
|
|
Re: Skipping quota at start and doing it later? [message #30118 is a reply to message #30115] |
Mon, 12 May 2008 18:00 |
|
Gregor Mosheh wrote:
> Matt Ayres wrote:
>> VZFASTBOOT is the option. /etc/vz/vz.conf is the main Virtuozzo
>> config, not a VPS/Container config file
>
> Ah; my mistake. I misread you and the script.
>
>
>> This sets a flag that this VPS needs to be restarted normally later
>> on in the script. The normal restart will cause the quota to be
>> fully checked.
>> I assure you this is the option you want enabled.
>
> Hm, I'll take your word for it, though it doesn't sound right. I don't
> want them to be restarted with a full quota recalculation - I don't
> want quota recalculation at all. These fellas have 250 GB quotas and
> are using most of it, so the recalculation takes 60+ minutes per VPS.
>
I guess that if you can live w/o disk quotas you can disable this
entirely and forget about the problem you have. Option to set is
DISK_QUOTA=no (in /etc/vz/vz.conf)
|
|
|
|
Re: Skipping quota at start and doing it later? [message #30197 is a reply to message #30119] |
Thu, 15 May 2008 13:07 |
|
Gregor Mosheh wrote:
> Kir Kolyshkin wrote:
>
>> I guess that if you can live w/o disk quotas you can disable this
>> entirely and forget about the problem you have. Option to set is
>> DISK_QUOTA=no (in /etc/vz/vz.conf)
>>
>
> Sure, but we DO want quotas to be enforced. I just don't want to wait 90
> minutes for recalculating disk usage at startup, when I know that the
> usage hasn't changed since the power went out.
It was suggested earlier in this thread that if you will comment out the
following line
need_restart="${need_restart} ${veid}"
in /etc/init.d/vz you get the exact behavior you ask for. Can you
confirm (or deny) this?
If you can confirm, a parameter can be added to vz.conf making this
restart optional.
|
|
|
Re: Skipping quota at start and doing it later? [message #30200 is a reply to message #30197] |
Thu, 15 May 2008 17:00 |
Gregor Mosheh
Messages: 62 Registered: April 2007
|
Member |
|
|
Gregor wrote:
>> Sure, but we DO want quotas to be enforced. I just don't want to wait
>> for recalculating disk usage at startup, when I know that the
>> usage hasn't changed since the power went out.
Kir Kolyshkin wrote:
> It was suggested earlier in this thread that if you will comment out the
> following line
> need_restart="${need_restart} ${veid}"
> in /etc/init.d/vz you get the exact behavior you ask for. Can you
> confirm (or deny) this?
I did not try that mechanism. I didn't see "--nocheck" in the vzquota
man page, and when running it manually during the initial steps of the
problem, the flag had no effect (quota checking still ran). As such, I
didn't accept that "vzquota on --nocheck" would accomplish my goal, even
if the later step of restarting were skipped.
I already had in place a change to the init script, which runs "vzquota
off" before running "vzquota on" in order to repair the quota file and
then come back up.
It goes something like this, and I'd be glad to provide the complete script.
# fastboot means to turn quota off,
# effectively repairing the quota file or doing nothing
if QUOTA and VZFASTBOOT; then vzquota off $VEID ; fi
# now turn quota on as usual
if QUOTA; vzquota on $VEID ; fi
I'm sure some folks actually like the current behavior, of their VPSs
starting, then restarting over the course of an hour to recalculate disk
usage, but this hack worked great for my needs.
--
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/
"Remember that no one cares if you can back up,
only if you can restore." - AMANDA
|
|
|