Quota charges attached volumes twice since 4.22.1 (cumulative + per-VM usage_volume records from #11531)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
The double charge comes from two usage_volume helper rows per attached volume, one with vm_id NULL and one with vm_id set, which each produce a usage_type = 6 record in cloud_usage. Start by reproducing the row counts in usage_volume, cloud_usage and quota_usage after a Usage run, then trace how #11531 introduced the per-VM row. Done means each attached volume is billed once per hour, and the choice of which record kind Quota bills is settled with the maintainers first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
problem
Since #11531 (4.22.1), Usage intentionally writes two kinds of usage_volume helper rows for an attached volume: a cumulative row (vm_id NULL) and a per-VM row (vm_id set). Both generate an hourly usage_type = 6 (VOLUME) record in cloud_usage, one with and one without vm_instance_id.
The Quota plugin treats both records as billable, so every attached volume is charged twice.
versions
- CloudStack 4.22.1.1 (management, usage)
- KVM, Ceph RBD primary storage
- Quota enabled with a volume tariff (
usage_type = 6)
steps to reproduce
- Enable Quota and configure a tariff for usage type 6.
- Create a data volume and attach it to a running VM (events
VOLUME.CREATE, thenVOLUME.ATTACH). - After the next Usage run, check
cloud_usage.usage_volume. There are two rows withdeleted IS NULL, one withvm_idNULL and one withvm_idset to the VM. - Check
cloud_usage.cloud_usagefor that volume and hour. There are twousage_type = 6records with the sameraw_usage: one withvm_instance_idNULL and one withvm_instance_idset. - Check
cloud_usage.quota_usage. There is one row percloud_usagerecord, both with the samequota_used, so the account balance is debited twice.
Example, one volume and one hour:
| cloud_usage.vm_instance_id | records | quota_used |
|---|---|---|
| NULL (cumulative) | 1 | 0.0081 |
| set (per-VM) | 1 | 0.0081 |
expected
A volume should be charged once per hour. Quota should bill only one of the two record kinds, for example the cumulative record (vm_instance_id NULL), since that is the one that is consistent with pre-#11531 behaviour.
notes
- Today, root volumes on new VMs don't show the double charge, because the second
usage_volumeinsert fails on the old(volume_id, created)unique key (#13909 / #13933). Once that key is widened in 4.22.2, root volumes will get both rows too, and will also be double-charged by Quota. - Our workaround: an hourly job sets
deleted = createdon per-VMusage_volumerows whenever an active cumulative row exists for the same volume. Per-VM records then stop being generated for that volume, and the cumulative row keeps billing it through detach and re-attach. Records written before we found this had to be removed by hand.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.4k
- Merge medio
- 9 d 12 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/cloudstack
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14545 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14530 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug status:has-work-around
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14465 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
4.23.0.0: restartVPC cleanup=true with public IPs on two VLANs fails with UnsupportedOperationException and leaves the VPC without a backup routerPosiblemente ocupada @bernardodemarco la tomó hace 6 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14430 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
apache/cloudstack#14427 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/cloudstack
Issues similares
-
status:pending type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EngineHub/WorldGuard#2329 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 6 días
-
Update spring-security to 7.1.3Abiertotype: dependency-upgrade
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
spring-projects/spring-session#4156 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
quarkiverse/quarkus-langchain4j#3127 · 1 comentario ·
Los mantenedores suelen responder en 1 día