Bug #5464

Deleting a group that owns images used by running VMs breaks those VMs

Added by Roy Keene almost 3 years ago. Updated almost 3 years ago.

Status:PendingStart date:10/17/2017
Priority:NormalDue date:
Assignee:-% Done:


Category:Core & System
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 5.2


In OpenNebula 5.2.0 (and likely newer) deleting a group that owns images used by VMs prevents snapshots (and likely) other operations from being performed on those VMs due to quota look operations failing.

Solutions I have investigated:
1. Soft-delete of groups;
2. Chown images found in this state (to whom?); but most likely answer:
3. Return an error deleting groups that own resources (like is done if there are members)

opennebula-5.4.1-nodelusergroupowning.diff Magnifier (1.08 KB) Roy Keene, 10/17/2017 06:13 PM


#1 Updated by Roy Keene almost 3 years ago

Output with patch (attached) applied:

[test] root@aurae-dashboard:~# onegroup create x
ID: 100
[test] root@aurae-dashboard:~# onegroup delete 100
[test] root@aurae-dashboard:~# onegroup create x
ID: 101
[test] root@aurae-dashboard:~# oneimage chgrp 0 101
[test] root@aurae-dashboard:~# onegroup list
  ID NAME                          USERS       VMS            MEMORY         CPU
   0 oneadmin                          2         -                 -           -
   1 users                             0   0 /   -      0M /       -  0.0 /    -
 101 x                                 0   0 /   -      0M /       -  0.0 /    -
[test] root@aurae-dashboard:~# onegroup delete 101
[one.group.delete] Cannot delete group. Group 101 owns images
[test] root@aurae-dashboard:~#

A better solution would be to add a method to each class (or to PoolSQL) to find all objects owned by a given UID/GID, a later patch may implement that

Also available in: Atom PDF