faild curl command to create a server in openstack

asked 2020-05-20 18:52:50 -0500

Hi everyone, i’m newbie in openstack. i had install devstack on ubuntu 18.04.4 with virtualbox. I wanna create a server with curl command as shown below:

curl -v -X POST "http://192.168.56.107/compute/v2.1/servers/" -d '{"server": { "name" : "new-server","imageRef" : "dbf9b6ae-4f66-4fcb-943d-b5ece246c197","flavorRef" : "1", "networks":[ {"uuid":"1fb59143-fe44-48a1-8e81-366086ea4361"}]}}' -H "X-Auth-Token:$token" -H "Content-Type: application/json" | python -m json.tool

but Terminal displays the following message

POST /compute/v2.1/servers/ HTTP/1.1 Host: 192.168.56.107 User-Agent: curl/7.58.0 Accept: / X-Auth-Token:g…………………………………………………………………………... Content-Type: application/json Content-Length: 169

} [169 bytes data] * upload completely sent off: 169 out of 169 bytes < HTTP/1.1 404 Not Found < Date: Wed, 20 May 2020 13:29:08 GMT < Server: Apache/2.4.29 (Ubuntu) < Content-Length: 154 < Content-Type: text/html; charset=UTF-8 < x-openstack-request-id: req-c5255ae7-8502-4fbb-9a71-aa24d6a9057e < x-compute-request-id: req-c5255ae7-8502-4fbb-9a71-aa24d6a9057e < Connection: close < { [154 bytes data] 100 323 100 154 100 169 1638 1797 --:--:-- --:--:-- --:--:-- 3436 * Closing connection 0 No JSON object could be decoded

edit retag flag offensive close merge delete

Comments

image, network, or endpoint might be incorrect. What do you find in the Nova API log?

No JSON object could be decoded comes from the json.tool module.

Bernd Bausch gravatar imageBernd Bausch ( 2020-05-20 19:20:46 -0500 )edit

sorry. but, i didn't find the path to Nova API log. I checked /var/log and etc/nova and nothing !!!

tarik elmarrakchi gravatar imagetarik elmarrakchi ( 2020-05-25 18:26:00 -0500 )edit

Devstack uses the systemd journal for logging. See https://docs.openstack.org/devstack/l....

Bernd Bausch gravatar imageBernd Bausch ( 2020-05-25 19:58:35 -0500 )edit

I found :May 27 23:49:44.158181 tarik-VirtualBox devstack@n-api.service[650]: [pid: 1400|app: 0|req: 17/33] 192.168.56.107 () {60 vars in 1147 bytes} [Wed May 27 23:49:44 2020] POST /compute/v2.1/servers/ => generated 154 bytes in 3 msecs (HTTP/1.1 404) 5 headers in 236 bytes (2 switches on core 0)

tarik elmarrakchi gravatar imagetarik elmarrakchi ( 2020-05-27 19:02:16 -0500 )edit

This doesn't look like an error log. Find messages that correlate with your API request, for example messages at the same time or with the same request ID req-c5255ae7-8502-4fbb-9a71-aa24d6a9057e, and focus on ERRORs and WARNINGs.

Bernd Bausch gravatar imageBernd Bausch ( 2020-05-27 22:39:25 -0500 )edit