[
https://issues.apache.org/jira/browse/CLOUDSTACK-7908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14228448#comment-14228448
]
ASF GitHub Bot commented on CLOUDSTACK-7908:
--------------------------------------------
GitHub user bhaisaab opened a pull request:
https://github.com/apache/cloudstack/pull/48
CLOUDSTACK-7908: Add user_id column to vm_instance table
- Adds column to VMInstance DAO
- Adds column in vm_instance table
- Adds column in the UserVMJoinVO
- Adds default admin user which has UID = 2
- Adds migration path that sets user_id to first user of the accountId that
owns the vm in vm_instance table
- Add arg on list VMs API to query by userId, add support in query layer
- Refactor VMInstanceVO and child classes to accept userId
- Add code to let service layer pass userId if loggedIn user belongs to same
account as the owner executing an API call or use first user from owner
account
- In case of CPVM and SSVM use system user ID
- Fix unit tests and spring injections
Signed-off-by: Rohit Yadav <[email protected]>
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/cloudstack useraccount-refactoring
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/48.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #48
----
commit 1e25886bd229a3b7b7aecafe2dc7eaeede47982e
Author: Rohit Yadav <[email protected]>
Date: 2014-11-28T11:37:02Z
CLOUDSTACK-7908: Add user_id column to vm_instance table
- Adds column to VMInstance DAO
- Adds column in vm_instance table
- Adds column in the UserVMJoinVO
- Adds default admin user which has UID = 2
- Adds migration path that sets user_id to first user of the accountId that
owns the vm in vm_instance table
- Add arg on list VMs API to query by userId, add support in query layer
- Refactor VMInstanceVO and child classes to accept userId
- Add code to let service layer pass userId if loggedIn user belongs to same
account as the owner executing an API call or use first user from owner
account
- In case of CPVM and SSVM use system user ID
- Fix unit tests and spring injections
Signed-off-by: Rohit Yadav <[email protected]>
----
> Addition of userid field to vm_instance table to identify user that created
> the VM
> ----------------------------------------------------------------------------------
>
> Key: CLOUDSTACK-7908
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7908
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.3.0
> Environment: 4.3.0
> Reporter: David Williams
> Assignee: Rohit Yadav
> Priority: Minor
> Fix For: 4.5.0, 4.6.0
>
>
> It would be handy/helpful if the userid of the user that created a VM was
> recorded in the database in the vm_instance table. Currently, the only way I
> know of to find the user that deployed a VM is by checking the logs. There's
> an owner field in the vm_instance table but this seems to be the account ID
> of the account the user belongs to.
> By being able to find the user that deployed a VM, it makes VM cleanups much
> easier since you know who to contact for each VM to check if it can be
> deleted. A similar thing in the other tables for the other resources would be
> useful too when trying to cleanup networks and volumes, etc. Also, if this
> change went ahead, then the API and GUI could be changed also to show the
> user details for the VM when listing the VM's details.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)