openstack server show <name> doesn't work if the instance name contains special characters such as parentheses
Issue
-
Create an instance with the name
test(test)
.$ openstack server list +--------------------------------------+------------+--------+---------------------------------+--------------+-----------------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+------------+--------+---------------------------------+--------------+-----------------+ | 9e42a051-c2e1-4838-b469-61c95d4624f0 | test(test) | ACTIVE | xxxxxxxx_network0=192.168.0.1 | image0 | xxxxxxxx_flavor | +--------------------------------------+------------+--------+---------------------------------+--------------+-----------------+
-
However,
openstack server show 'test(test)'
doesn't work.
Nova API returns no instances.$ openstack server show 'test(test)' No server with a name or ID of 'test(test)' exists. $ openstack server show 'test(test)' --debug : REQ: curl -g -i -X GET http://10.0.0.100:8774/v2.1/servers?name=test%28test%29 -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.79" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256}1d261ced5fbcac0cb539fba7012e658f72cd6c9e988547240ed36868a4d94861" -H "X-OpenStack-Nova-API-Version: 2.79" http://10.0.0.100:8774 "GET /v2.1/servers?name=test%28test%29 HTTP/1.1" 200 None RESP: [200] Content-Encoding: gzip Content-Type: application/json Date: Mon, 26 Jun 2023 06:49:42 GMT OpenStack-API-Version: compute 2.79 Server: Apache Transfer-Encoding: chunked Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version,Accept-Encoding X-OpenStack-Nova-API-Version: 2.79 x-compute-request-id: req-ad079070-09f1-49c7-a91f-9a6d49d51abc x-openstack-request-id: req-ad079070-09f1-49c7-a91f-9a6d49d51abc RESP BODY: {"servers": []} GET call to compute for http://10.0.0.100:8774/v2.1/servers?name=test%28test%29 used request id req-ad079070-09f1-49c7-a91f-9a6d49d51abc No server with a name or ID of 'test(test)' exists.
Environment
- Red Hat OpenStack Platform 17.1
- Red Hat OpenStack Platform 17.0
- Red Hat OpenStack Platform 16.2
- Red Hat OpenStack Platform 16.1
- Red Hat OpenStack Platform 13
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.