Earlier  
Posted Nick Remark
#openstack-nova - 2017-10-04
19:39:18 mriedem nova list --tenant f7832bfb6daf4a00b6c5687b2ab756fd totally works for me
19:39:27 mriedem as the admin and ^ is the demo tenant in devstack
19:39:38 melwitt oh, cool
19:39:41 rybridges I also tried using the raw python binding like so: nova_client.servers.list(detailed=True, search_opts={'tenant_id': '9dfb1c98d6224351b55ca6dd8e4246c6'}) but it does not seem to be filtering. it only returns the servers in the tenant which i instantiated the novaclient with. that tenant btw is admin so it should be able to query machines from other tenants.
19:40:12 rybridges novaclient version is 7.1.3
19:40:47 mriedem i'm on 9.1.0
19:40:48 rybridges ahh ok nova list --tenant is working
19:40:57 mriedem yeah, use the help to see what's supported
19:40:58 mriedem nova help list
19:41:00 rybridges used to be --tenant_id
19:41:12 rybridges was a bit confusing b/c docs make it sound like tenant_id will work
19:41:26 mriedem the api reference docs != the nova cli
19:42:17 rybridges right
19:42:27 rybridges well, nova list --tenant <id> does seem to work
19:42:34 rybridges now how can i do the same thing from the python binding
19:42:42 mriedem for review, gibi's bdm perf fixup series has my +2, https://review.openstack.org/#/q/topic:bug/1718226+(status:open+OR+status:merged) - it's pretty mechanical plumbing stuff
19:42:44 mriedem easy review
19:42:47 rybridges the docs just pointed me to the page i linked above
19:42:54 rybridges for a full list of search opts
19:43:45 rybridges but tenant, tenant_id, tenant-id, project, project_id, project-id all do not filter properly when using the python binding directly
19:44:18 mriedem rybridges: project_id and tenant_id are valid search opts to the GET /servers API
19:44:28 mriedem however, as noted in the docs, they only work if you're an admin making the request
19:44:43 mriedem so, are you doing this with an admin token
19:44:45 mriedem is the first question
19:45:01 rybridges when i instantiated the novaclient object in python
19:45:06 rybridges i passed it admin user/password
19:45:14 mriedem i guess the docs don't say this, but the nova cli help does
19:45:24 rybridges and i can list servers in the admin tenant
19:45:33 mriedem can you do: nova service-list?
19:45:55 rybridges when i pass a tenant id as a search opt, it still just returns the same servers that are in the admin tenant, not those in the project i specified
19:46:18 mriedem ok i think i see the issue
19:46:35 rybridges yes, nova.services.list() does work
19:46:38 rybridges from the python binding
19:46:44 mriedem https://review.openstack.org/#/c/426259/
19:46:47 rybridges with the instance of nova client that i created
19:46:56 mriedem yup so we suck at documenting things in the api reference...
19:47:34 rybridges oh
19:47:38 mriedem rybridges: so try searching with project_id
19:47:39 rybridges so i must specify all_tenants
19:47:40 mriedem rather than tenant_id
19:47:44 mriedem well try ^ first
19:47:49 rybridges i have tried with project_id and i get the same behavior
19:48:11 mriedem ok probably because of search_opts['project_id'] = context.project_id
19:48:21 mriedem it overwrites the requested project_id filter with the one in the token
19:48:23 mriedem which is your admin project
19:48:26 rybridges okay i see now
19:48:29 mriedem so yeah you have to specify all_tenants
19:48:31 rybridges this is working: nova.servers.list(detailed=True, search_opts={'project_id': '9dfb1c98d6224351b55ca6dd8e4246c6', 'all_tenants': True})
19:48:39 rybridges oof that sucks =(
19:48:40 mriedem yeah, we need to note this in the docs
19:48:58 mriedem i can push a patch in a bit
19:49:06 mriedem for the docs, not the actual api behavior
19:49:12 rybridges ok
19:49:18 rybridges that would be great
19:49:35 melwitt I think it used to be that all_tenants had to be passed to the CLI too but someone added automagic to do it if --tenant was passed since it's required for --tenant to work
19:51:14 rybridges okay one more thing
19:51:25 rybridges since in the python binding i have to pass all_tenants
19:51:32 rybridges whenever i want to filter by project id
19:51:52 rybridges does that mean that novaclient is actually pulling all of the instances for all tenants back, and then filtering based on project id on the front end?
19:52:01 rybridges we dont want that, because we have tens of thousands of instances
19:52:07 rybridges and filtering all of that on the front end would be very slow
19:52:26 mriedem rybridges: it is filtering server-side
19:52:33 rybridges okay
19:52:46 rybridges thank you ^.^
19:52:52 mriedem which release are you testing this on?
19:53:12 rybridges stable/ocata
19:53:31 mriedem is this penick's cluster?
19:53:46 rybridges heh yes, penick is our architect
19:53:52 mriedem he is our lord and savior
19:54:01 mriedem ignore that
19:54:03 rybridges yes he is my lord and savior as well
19:54:14 rybridges :)
19:54:25 jaypipes heh
19:54:40 jaypipes well, with penick, most people are always looking UP at him. :)
19:54:59 rybridges i am one of the few who does not have to look up
19:55:09 jaypipes rybridges: wow, lucky you :)
19:55:13 rybridges i have 6'7" so he is only a couple inches taller than me
19:55:18 rybridges i am**
19:55:18 jaypipes :)
19:56:07 jaypipes rybridges: basically, all of us nova cores have capitulated to all of penick's demands because we're all afraid he will crush us with his pinky finger if we give him any lip.
19:56:17 jaypipes rybridges: well, that and, you know, melwitt :)
19:56:42 rybridges bahahahaa
19:57:03 jaypipes rybridges: though melwitt could easily stomp on any of us with her boots :)
19:57:06 mriedem jaypipes: he doesn't have demands, because he know we can't fulfill anything for juno
19:57:17 jaypipes mriedem: lol, dig!
19:57:20 rybridges yea... freakin juno man
19:57:20 mriedem YES!
19:57:31 dansmith rybridges: that's what we call him
19:57:34 dansmith rybridges: "juno man"
19:57:41 dansmith like a superhero but...sadder
19:58:30 jaypipes edleafe: we ready on the alternate hosts/selection objects patches? just a rebase just now?
19:58:40 jaypipes edleafe: or blueprint changed...
20:02:02 edleafe jaypipes: I changed the structure of the Selection object to match the spec
20:02:10 jaypipes got it.
20:02:16 edleafe jaypipes: should be ready for review
20:02:32 edleafe jaypipes: working on the code that changes the return from select_destinations now
20:02:42 edleafe it's... involved :)
20:02:55 jaypipes indeed.
20:17:28 openstackgerrit Merged openstack/nova master: Fix inconsistency of 'NOTE:' description https://review.openstack.org/508074
20:22:46 melwitt clarkb: I think python-pastedeploy isn't being installed from the uca repo based on this http://logs.openstack.org/32/508432/1/check/gate-tempest-dsvm-full-devstack-plugin-ceph-ubuntu-xenial/575e932/logs/devstacklog.txt.gz#_2017-10-04_01_49_38_030 and trying installing it locally I'm able to do "from paste import deploy". so AFAICT the package isn't broken

Earlier   Later