Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong RUNNING_*_USED quota after VM transition from poweroff -> done #6355

Closed
3 tasks done
paczerny opened this issue Oct 17, 2023 · 1 comment · Fixed by OpenNebula/docs#2781
Closed
3 tasks done

Comments

@paczerny
Copy link
Member

paczerny commented Oct 17, 2023

Description
RUNNING_*_USED quota includes RUNNING_MEMORY_USED, RUNNING_CPU_USED, RUNNING_VMS_USED.
The command onevm terminate on VM in poweroff state temporary increase the RUNNING_*_USED quotas. If this exceeds the RUNNING_* quota, the command succeeds but the RUNNING_*_USED quotas are corrupted.

To Reproduce
As regular user userA create, deploy and poweroff VM

onevm create --cpu 1 --memory 1
onevm deploy <vm_id> <host_id>
onevm poweroff 

As admin set user running quota:

echo "VM = [ RUNNING_CPU = 1 ] " >quota.tmpl
oneuser quota userA quota.tmpl

Terminate the VM onevm terminate <vm_id>.
The oneuser show userA shows negative RUNNING_*_USED values.

Expected behavior
Correct values for the RUNNING_*_USED quotas after onevm terminate

Details

  • Affected Component: oned
  • Version: Tested on 6.8, but applies to all previous versions

Additional context
Same issue is for VM in suspend, stop, undeployed state

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@paczerny
Copy link
Member Author

paczerny commented Oct 17, 2023

Right now I'm working on #6341 , I've discover mre commands which corrupts the quota. I'll list all quota bugs here:

  • VM state poweroff, stop, suspend or undeployed -> command onevm chown, onevm chgrp corrupts VMS_USED quota
  • VM state poweroff -> command onevm undeploy corrupts RUNNING_* quotas

paczerny added a commit to OpenNebula/docs that referenced this issue Dec 5, 2023
@tinova tinova modified the milestones: Release 6.8.1, Release 6.8.2 Dec 12, 2023
rsmontero pushed a commit that referenced this issue Dec 12, 2023
* Remove useless default values from VM quotas, adapt chown and chgrp to it
* Fix VM transition from poweroff, stopped, suspended, undeployed to done when quotas are tmp exceeded
* Fix VM transition from poweroff to undeployed
* Fix VM transition from suspended to stopped

(cherry picked from commit 1e25904)
@rsmontero rsmontero modified the milestones: Release 6.8.2, Release 6.8.1 Jan 3, 2024
paczerny added a commit to OpenNebula/docs that referenced this issue Jan 18, 2024
rsmontero pushed a commit to OpenNebula/docs that referenced this issue Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment