1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 19:26:48 +00:00
webvirtcloud/instances
catborise fb3f686532 fix(instances): the quota counts every VM and refuses what it cannot verify
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.
2026-10-05 12:26:57 +03:00
..
api fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
fixtures Instances overhaul 2020-07-13 15:33:09 +06:00
migrations fix(computes): VM ownership survives a move or a short absence 2026-10-04 01:08:11 +03:00
templates fix(instances): the quota counts every VM and refuses what it cannot verify 2026-10-05 12:26:57 +03:00
templatetags lint with black python. convert f style strings to old one. some small fixes 2020-11-05 12:34:31 +03:00
__init__.py Fixe migrations for new deployments 2020-05-28 18:19:25 +06:00
apps.py format python code with black 2022-11-02 08:54:35 +03:00
forms.py feat(console): VNC is the only console type 2026-10-04 01:08:11 +03:00
livetest.py fix(instances): domain edits start from the persistent definition 2026-10-04 01:08:11 +03:00
models.py fix(instances): lists show a VM that cannot be read as unknown 2026-10-05 11:03:32 +03:00
test_change_network.py fix(instances): change the edited NIC instead of adding a new one 2026-10-04 01:08:11 +03:00
test_change_xml.py fix(instances): the XML editor saves only while the VM is shut off 2026-10-04 19:13:20 +03:00
test_clone_permission.py fix(instances): clone name and MAC read the same dhcpd.conf 2026-10-04 19:39:29 +03:00
test_console_rule.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_console_settings_access.py fix(instances): show console settings and the VNC password only to console managers 2026-10-02 22:04:05 +03:00
test_create_instance.py fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
test_create_rollback.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_destroy.py fix(instances): destroy and volume delete no longer lose disks 2026-10-04 01:08:11 +03:00
test_disk_isolation.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_error_handling.py fix(instances): failures reach the user; no redirect to other sites 2026-10-04 12:23:54 +03:00
test_gstfsd.py fix: stop ignoring SIGCHLD process-wide 2026-10-04 13:40:53 +03:00
test_index.py fix(instances): guard mutations and refresh lists after sync 2026-09-28 14:56:19 +03:00
test_index_host_alerts.py fix(instances): host errors on the instance list are for administrators 2026-10-05 11:49:46 +03:00
test_list_rpc.py perf(instances): instance lists read a VM's info once per row 2026-10-05 10:17:47 +03:00
test_list_unreachable.py fix(instances): lists show a VM that cannot be read as unknown 2026-10-05 11:03:32 +03:00
test_live_clone.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_live_create.py fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
test_live_dataloss.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_live_guest.py test(instances): the guest sees the hardware WebVirtCloud configures 2026-10-04 16:39:02 +03:00
test_live_iso.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_live_xml.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_live_xml_effects.py fix(instances): disk and agent channel changes on paused VMs 2026-10-04 17:10:49 +03:00
test_quota.py fix(instances): the quota counts every VM and refuses what it cannot verify 2026-10-05 12:26:57 +03:00
test_quota_lock.py fix(instances): disk edits keep their XML; changes lock per VM 2026-10-04 01:08:11 +03:00
test_root_pass.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_security_mutations.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_template_flag.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_update_console.py feat(console): VNC is the only console type 2026-10-04 01:08:11 +03:00
test_xss.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
tests.py feat(console): VNC is the only console type 2026-10-04 01:08:11 +03:00
urls.py fix: add an authorization matrix test and close the endpoints it finds 2026-10-02 20:33:12 +03:00
utils.py fix(instances): the quota counts every VM and refuses what it cannot verify 2026-10-05 12:26:57 +03:00
views.py fix(instances): the quota counts every VM and refuses what it cannot verify 2026-10-05 12:26:57 +03:00