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

listVirtualMachines does not show instances belonging to a project #3343

Closed
NuxRo opened this issue May 21, 2019 · 11 comments
Closed

listVirtualMachines does not show instances belonging to a project #3343

NuxRo opened this issue May 21, 2019 · 11 comments

Comments

@NuxRo
Copy link
Contributor

NuxRo commented May 21, 2019

Relevant email thread https://lists.apache.org/thread.html/6aca3e7b99816eef127ce516e5ef93bddb7a60a53e72762d5af3c050@%3Cdev.cloudstack.apache.org%3E

As a user I have created a project and in it I created a few VMs. These VMs will not show up in "listVirtualMachines" unless the project is specified.

e.g.

(localcloud) 🐱 > list virtualmachines
(localcloud) 🐱 > 
(localcloud) 🐱 > list virtualmachines projectid=b9a75ec4-82fc-4e88-8733-022df7956143 filter=id,
count = 2
virtualmachine:
id = 7b7259ac-ac89-43e7-9772-5f7866762be3
================================================================================
id = 0a1bb820-2ad6-4a71-bda0-29bb0ead6781
@NuxRo
Copy link
Contributor Author

NuxRo commented May 21, 2019

ping @ustcweizhou @PaulAngus

@PaulAngus
Copy link
Member

@ustcweizhou did you say that you guys are planning on changing this behaviour or just that you would also like to see it changed?

@ustcweizhou
Copy link
Contributor

@PaulAngus We have some changes in 4.7.1 to list all project resources in default view. That's the default behavior in our fork. As you can see, it breaks the backwards compatibility.
We need to make more changes before creating a pull request to mainstream. I will look into it.

@PaulAngus
Copy link
Member

PaulAngus commented May 22, 2019

ok, cool. I'll assign this to you if you don't mind so 'people' can see that it's kinda 'in-hand'.

(or not, as you dont appear in the assignees list !?)

@PaulAngus PaulAngus assigned PaulAngus and unassigned PaulAngus May 22, 2019
@PaulAngus PaulAngus added this to the 4.13.0.0 milestone May 22, 2019
@rohityadavcloud
Copy link
Member

@NuxRo known limitation, you've to pass projectid=-1 to list them all. This pattern exists for all list apis of various resources like routers, etc.

@ustcweizhou
Copy link
Contributor

@rhtyd that's very nice. good to know it.
Can we add it cloudstack api document ?
As far as I know, it exists for all commands extend BaseListProjectAndAccountResourcesCmd.java, right ?

@richardlawley
Copy link
Contributor

Just come across this - would be nice if there was a way that you could list all "things" regardless of project or not. Right now it looks like you have to do project=-1 to get anything in a project, and miss the project param for anything not in a project.

@rohityadavcloud rohityadavcloud self-assigned this Jun 25, 2019
@rohityadavcloud rohityadavcloud modified the milestones: 4.13.0.0, 4.14.0.0 Jul 3, 2019
@rohityadavcloud
Copy link
Member

The workaround is to either specify a specific projectid= or projectid=-1.

A resource under a project is owned by a project (a project account) than a member of the project, which is why such resources are not shown in the default list APIs/views. If we allow listing of all resources, then it may break the UI semantics (backward compatibility). A middle ground could be if listall=true is provided than all resources where user can access on could be listed on. Since we're close to 4.13.0.0, I've moved this to the next major milestone. cc @PaulAngus @ustcweizhou @NuxRo

@NuxRo
Copy link
Contributor Author

NuxRo commented Jul 3, 2019

Thanks Rohit, that makes sense. To be honest I would not have raised this issue had I known about projectid=-1, but that listall=true does not sound too bad if it could be done.

@andrijapanicsb andrijapanicsb modified the milestones: 4.14.0.0, 4.15.0.0 Jan 3, 2020
@weizhouapache
Copy link
Member

probably fixed by #3894

@rohityadavcloud
Copy link
Member

rohityadavcloud commented Aug 12, 2020

Fixed in #3894 you've to specify listall=true and projectid=-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants