mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 19:26:48 +00:00
check_user_quota added up the vCPUs, memory and disks of the user's VMs, but skipped a VM whose host failed a TCP probe. A host that was down therefore let users exceed their quota, and the probe always failed for ssh computes named by an ssh_config alias or reached through ProxyJump, so their VMs were never counted. A VM that could not be read turned the page into the error page instead. - Hosts are checked with Compute.status, the connection WebVirtCloud uses, once per host. A VM that cannot be read (host down, VM gone) makes the usage unknown: clone and resize up are refused with their own message (fail closed). - A request that adds nothing is not checked, so a user over quota can still shrink a VM. Users without limits, and an exceeded instance count (from the database), need no host either. - Memory resize of a running VM changes only the current memory, but the quota was charged with the submitted maximum. It is now charged with no change, and resize_mem gets the current maximum, so a VM that shuts down meanwhile cannot take an unchecked one. - The VM page no longer computes the quota on every load (it read every VM of the user on every host for a "quota reached" banner). The limit is reported when a change is refused. The test that expected a down host to pass the quota now expects it to be refused. Checked against the test hosts: with a VM behind an ssh_config alias the previous code counted 29 vCPUs, the new one 31; with a VM on an unreachable host the previous code allowed +1 vCPU, the new one refuses it after 5.1 s and allows -1 at once. The new tests fail on the previous code, except the ones guarding unchanged behaviour. |
||
|---|---|---|
| .. | ||
| api | ||
| fixtures | ||
| migrations | ||
| templates | ||
| templatetags | ||
| __init__.py | ||
| apps.py | ||
| forms.py | ||
| livetest.py | ||
| models.py | ||
| test_change_network.py | ||
| test_change_xml.py | ||
| test_clone_permission.py | ||
| test_console_rule.py | ||
| test_console_settings_access.py | ||
| test_create_instance.py | ||
| test_create_rollback.py | ||
| test_destroy.py | ||
| test_disk_isolation.py | ||
| test_error_handling.py | ||
| test_gstfsd.py | ||
| test_index.py | ||
| test_index_host_alerts.py | ||
| test_list_rpc.py | ||
| test_list_unreachable.py | ||
| test_live_clone.py | ||
| test_live_create.py | ||
| test_live_dataloss.py | ||
| test_live_guest.py | ||
| test_live_iso.py | ||
| test_live_xml.py | ||
| test_live_xml_effects.py | ||
| test_quota.py | ||
| test_quota_lock.py | ||
| test_root_pass.py | ||
| test_security_mutations.py | ||
| test_template_flag.py | ||
| test_update_console.py | ||
| test_xss.py | ||
| tests.py | ||
| urls.py | ||
| utils.py | ||
| views.py | ||