can't get server list with --tenant under admin

Asked by dongwenjuan on 2016-09-13

In dwj tenant, there is a VM
root@devstack:~/doctor/tests# source dwj_openrc
root@devstack:~/doctor/tests# nova list
+--------------------------------------+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+----------+
| 459185d1-243b-4308-829b-5b7fe4b4ccd3 | dwj | ACTIVE | - | Running | |
+--------------------------------------+------+--------+------------+-------------+----------+

In admin project, I use --all-tenants
root@devstack:~/doctor/tests# nova list --all-tenants
+--------------------------------------+------+----------------------------------+--------+------------+-------------+----------+
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+--------------------------------------+------+----------------------------------+--------+------------+-------------+----------+
| 459185d1-243b-4308-829b-5b7fe4b4ccd3 | dwj | da2974b97a7a4889bb7baa4f0df22922 | ACTIVE | - | Running | |
+--------------------------------------+------+----------------------------------+--------+------------+-------------+----------+

But why i specify the project, the API returns null? Is there anything i missed?
root@devstack:~/doctor/tests# nova list --tenant dwj
+----+------+-----------+--------+------------+-------------+----------+
| ID | Name | Tenant ID | Status | Task State | Power State | Networks |
+----+------+-----------+--------+------------+-------------+----------+
+----+------+-----------+--------+------------+-------------+----------+

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nova Edit question
Assignee:
No assignee Edit question
Solved by:
dongwenjuan
Solved:
2016-09-13
Last query:
2016-09-13
Last reply:
2016-09-13
William Grant (wgrant) said : #1

nova list's --tenant option takes a tenant ID, not a tenant name. So "nova list --tenant da2974b97a7a4889bb7baa4f0df22922" should do what you want.

dongwenjuan (dong-wenjuan) said : #2

Hi William Grant,

Oh, it works. Thanks a lot~ :)

BR,
dwj