[one-users] OCA API / deleting user
Daniel Molina Aranda
danmolin at fdi.ucm.es
Fri Feb 4 09:48:29 PST 2011
Hi,
The current implementation require that the applications, built upon
the OCA API, check that kind of things.
This functionality will be added to the OpenNebula Core in upcoming
releases, this way the application wont have to take into account this
kind of stuff.
Regards.
On 4 February 2011 00:06, Piotr Kandziora <raveenpl at gmail.com> wrote:
> Hi,
>
>
> 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:
>
> a) using command line (deleting user test11 is not possible, because it has
> running one-4014 vm instance):
>
> oneadmin at main:~$ oneuser list
> ID USER PASSWORD
> 0 oneadmin 4ff88aaddbd209d8026924c2cc2836b408698823
> 3 test11 4ff88aaddbd209d8026924c2cc2836b408698823
>
> oneadmin at main:~$ onevm list
> ID USER NAME STAT CPU MEM HOSTNAME TIME
> 4014 test11 one-4014 runn 0 0K root24 00 00:00:32
>
> oneadmin at main:~$ oneuser delete 3
> The user 3 still has VMs defined, aborting user delete.
>
> b) using OCA API (in my case Python OCA API):
>
> So, I am deleting user 'test11' using following code:
>
> #!/usr/bin/python
> import oca
>
> c = oca.Client('oneadmin:free','http://localhost:2633/RPC2')
>
> usr = oca.user.UserPool(c)
> usr.info(oca.ALL)
>
> for i in usr:
> if i.name == 'test11':
> i.delete()
>
> After it command 'onevm list' returns output:
>
> oneadmin at main:~$ onevm list
> ID USER NAME STAT CPU MEM HOSTNAME TIME
> /usr/lib/one/ruby/client_utilities.rb:143:in `Float': invalid value for
> Float(): "" (ArgumentError)
> from /usr/lib/one/ruby/client_utilities.rb:143:in `data_str'
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `collect'
> from /usr/lib/one/ruby/client_utilities.rb:139:in `each'
> from /usr/lib/one/ruby/client_utilities.rb:139:in `collect'
> from /usr/lib/one/ruby/client_utilities.rb:139:in `data_str'
> from /usr/lib/one/ruby/client_utilities.rb:138:in `collect'
> from /usr/lib/one/ruby/client_utilities.rb:138:in `data_str'
> from /usr/bin/onevm:208:in `list_short'
> from /usr/bin/onevm:682
>
> At this moment I am not able to perform any action using onevm command.
>
> 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).
>
> 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?
>
> I am using OpenNebula version 2.0.1.
>
> Best regards
> Piotr Kandziora
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
--
Daniel Molina, Cloud Technology Engineer/Researcher
DSA Research Group: web http://dsa-research.org and blog
http://blog.dsa-research.org
OpenNebula Open Source Toolkit for Cloud Computing: http://www.OpenNebula.org
More information about the Users
mailing list