| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2017-10-04 | |||
| 19:28:08 | openstackgerrit | Matt Riedemann proposed openstack/nova master: use already loaded BDM in instance. |
|
| 19:28:09 | openstackgerrit | Matt Riedemann proposed openstack/nova master: use already loaded BDM in instance.create https://review.openstack.org/483969 | |
| 19:28:17 | cfriesen | is there a way to boot an instance from a volume-exposed-as-cdrom, install to another volume-exposed-as-disk, then unmount the CDROM volume? Or to change boot order of volumes in the instance after it's created? | |
| 19:36:29 | rybridges | Hello. Did we remove the ability to list servers by project/tenant id in the novaclient? | |
| 19:36:52 | rybridges | nova list --tenant-id <tenant_id> is not working. same if i try with openstack client | |
| 19:37:11 | rybridges | have tried all combinations of tenant_id, tenant-id, project_id, project-id in both openstack client and novaclient | |
| 19:37:25 | rybridges | but I see it in the documentation here https://developer.openstack.org/api-ref/compute/#listServers | |
| 19:37:37 | mriedem | rybridges: which version of novaclient? | |
| 19:38:30 | mriedem | nova help list | |
| 19:38:32 | mriedem | shows me: | |
| 19:38:37 | mriedem | --tenant [<tenant>] Display information from single tenant (Admin | |
| 19:38:38 | mriedem | only). | |
| 19:39:01 | melwitt | you might have to specific --all-tenants too. and make sure tenant is a UUID | |
| 19:39:04 | melwitt | *specify | |
| 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 | jaypipes | :) | |
| 19:55:18 | rybridges | i am** | |
| 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 | mriedem | YES! | |