[Users] Skipping quota at start and doing it later?

Matt Ayres matta at tektonic.net
Mon May 12 12:41:09 EDT 2008


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


More information about the Users mailing list