Hi,<br><br><br>I have been performing tests with OpenNebula and noticed that using command line I am not able to delete user while it has some VMs running (it is ok). But, using OCA API this operation is possible and causes some strange behaviour. Details below:<br>
<br>a) using command line (deleting user test11 is not possible, because it has running one-4014 vm instance):<br><br>oneadmin@main:~$ oneuser list<br> ID USER PASSWORD<br> 0 oneadmin 4ff88aaddbd209d8026924c2cc2836b408698823<br>
3 test11 4ff88aaddbd209d8026924c2cc2836b408698823<br><br>oneadmin@main:~$ onevm list<br> ID USER NAME STAT CPU MEM HOSTNAME TIME<br> 4014 test11 one-4014 runn 0 0K root24 00 00:00:32<br>
<br>oneadmin@main:~$ oneuser delete 3<br>The user 3 still has VMs defined, aborting user delete.<br><br>b) using OCA API (in my case Python OCA API):<br><br>So, I am deleting user 'test11' using following code:<br>
<br>#!/usr/bin/python<br>import oca<br><br>c = oca.Client('oneadmin:free','<a href="http://localhost:2633/RPC2">http://localhost:2633/RPC2</a>')<br><br>usr = oca.user.UserPool(c)<br><a href="http://usr.info">usr.info</a>(oca.ALL)<br>
<br>for i in usr:<br> if <a href="http://i.name">i.name</a> == 'test11':<br> i.delete()<br><br>After it command 'onevm list' returns output:<br><br>oneadmin@main:~$ onevm list<br> ID USER NAME STAT CPU MEM HOSTNAME TIME<br>
/usr/lib/one/ruby/client_utilities.rb:143:in `Float': invalid value for Float(): "" (ArgumentError)<br> from /usr/lib/one/ruby/client_utilities.rb:143:in `data_str'<br> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `collect'<br>
from /usr/lib/one/ruby/client_utilities.rb:139:in `each'<br> from /usr/lib/one/ruby/client_utilities.rb:139:in `collect'<br> from /usr/lib/one/ruby/client_utilities.rb:139:in `data_str'<br>
from /usr/lib/one/ruby/client_utilities.rb:138:in `collect'<br> from /usr/lib/one/ruby/client_utilities.rb:138:in `data_str'<br> from /usr/bin/onevm:208:in `list_short'<br> from /usr/bin/onevm:682<br>
<br>At this moment I am not able to perform any action using onevm command.<br><br>In this situation I had to fix it by manual modifcation in vm_pool table in opennebula database (I removed records that belonged to deleted user).<br>
<br>Question is following: Do I have to ensure before deleting user that it does not have any running VM instances? Or this is unplanned behaviour and should be fixed?<br>
<br>I am using OpenNebula version 2.0.1.<br><br>Best regards<br>Piotr Kandziora<br><br><br><br>