← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1857447] [NEW] Listing servers by vm_state does not work

 

Public bug reported:

Description
===========

In nova api reference [1], we know that we can list instances by status
or vm_state, note that vm_state should work for admin only. But
actually, listing instances by vm_state does not work as excepted in
queens 17.0.3. I checked the master branch, it should have the same
issue.

I added some logs and did the following tests:

* searching by status:

curl -g -i -X GET
http://<url>:<port>/v2.1/servers/detail?status=SOFT_DELETED

the logs:

Searching by: {'deleted': False, 'vm_state': ['soft-delete'], 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2384
Filters are {'deleted': False, 'vm_state': ['soft-delete'], 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2494

* searching by vm_state:

curl -g -i -X GET
http://<url>:<port>/v2.1/servers/detail?vm_state=DELETED

the logs:

Searching by: {'deleted': False, u'vm_state': u'DELETED', 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2384
Filters are {'deleted': False, u'vm_state': u'DELETED', 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2494


As you can see, nova does not process search option 'vm_state' the same way as search option 'status'.


References
==========

[1].https://docs.openstack.org/api-ref/compute/?expanded=delete-server-
detail,force-delete-server-forcedelete-action-detail,list-servers-detail
#list-server-request

** Affects: nova
     Importance: Undecided
     Assignee: Fan Zhang (fanzhang)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Fan Zhang (fanzhang)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1857447

Title:
  Listing servers by vm_state does not work

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========

  In nova api reference [1], we know that we can list instances by
  status or vm_state, note that vm_state should work for admin only. But
  actually, listing instances by vm_state does not work as excepted in
  queens 17.0.3. I checked the master branch, it should have the same
  issue.

  I added some logs and did the following tests:

  * searching by status:

  curl -g -i -X GET
  http://<url>:<port>/v2.1/servers/detail?status=SOFT_DELETED

  the logs:

  Searching by: {'deleted': False, 'vm_state': ['soft-delete'], 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2384
  Filters are {'deleted': False, 'vm_state': ['soft-delete'], 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2494

  * searching by vm_state:

  curl -g -i -X GET
  http://<url>:<port>/v2.1/servers/detail?vm_state=DELETED

  the logs:

  Searching by: {'deleted': False, u'vm_state': u'DELETED', 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2384
  Filters are {'deleted': False, u'vm_state': u'DELETED', 'project_id': u'ddc5e1deb69b4b0a83a9cad2ba6dd4c6'} get_all /usr/lib/python2.7/site-packages/nova/compute/api.py:2494

  
  As you can see, nova does not process search option 'vm_state' the same way as search option 'status'.


  References
  ==========

  [1].https://docs.openstack.org/api-ref/compute/?expanded=delete-
  server-detail,force-delete-server-forcedelete-action-detail,list-
  servers-detail#list-server-request

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1857447/+subscriptions