Ignore:
Timestamp:
Feb 16, 2009, 11:52:01 PM (16 years ago)
Author:
iannucci
Message:

RAM quotas at remctl; RAM quota exception script, table, and usage in -web and -remote-create; /etc/nocreate support

Location:
trunk/packages/invirt-web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/validation.py

    r2064 r2132  
    66import string
    77import dns.resolver
    8 from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall
     8from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall, Owner
    99from invirt.config import structs as config
    1010from invirt.common import InvalidInput, CodeError
    1111
    12 MAX_MEMORY_TOTAL = 512
    13 MAX_MEMORY_SINGLE = 512
    1412MIN_MEMORY_SINGLE = 16
    1513MAX_DISK_TOTAL = 50
     
    9290    returned.
    9391    """
    94     if machine is not None and machine.memory > MAX_MEMORY_SINGLE:
    95         # If they've been blessed, let them have it
    96         return machine.memory
     92    (quota_total, quota_single) = Owner.getQuotas(machine.owner if machine else owner)
     93
    9794    if not on:
    98         return MAX_MEMORY_SINGLE
     95        return quota_single
    9996    machines = getMachinesByOwner(owner, machine)
    10097    active_machines = [m for m in machines if m.name in g.xmlist_raw]
    10198    mem_usage = sum([x.memory for x in active_machines if x != machine])
    102     return min(MAX_MEMORY_SINGLE, MAX_MEMORY_TOTAL-mem_usage)
     99    return min(quota_single, quota_total-mem_usage)
    103100
    104101def maxDisk(owner, machine=None):
  • trunk/packages/invirt-web/debian/changelog

    r2063 r2132  
     1invirt-web (0.0.19) unstable; urgency=low
     2
     3  * modified quota checking to refer to invirt.database.Owner for quotas and defaults
     4
     5 -- Peter A. Iannucci <iannucci@mit.edu>  Mon, 16 Feb 2009 23:49:21 -0500
     6
    17invirt-web (0.0.18) unstable; urgency=low
    28
Note: See TracChangeset for help on using the changeset viewer.