我使用curl命令遇到错误“ 400 Bad request”。 执行此命令时,我有一个使用的令牌
curl -s -X "X-Auth-Token: $OS_TOKEN" POST
http://127.0.0.1/compute/v2.1/servers
-H "Content-Type: application/json"
-d '{ "server": { "name": "VM1","imageRef": "aaab4dfd-8d9c-409e-a821-
a0137e49e869","flavorRef" : "42","flavorRef":
"http://127.0.0.1/flavors/42",
"networks" : [{ "uuid" : "7697d4c6-5b4c-4ea9-a1d6-af7d7f716f2b" }] }}'
我得到的结果是
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3600 100 3331 100 269 3331 269 0:00:01 --:--:-- 0:00:01 94736
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> <hr> <address>Apache/2.4.27 (Ubuntu) Server at 127.0.0.1 Port 80</address> </body></html>
令牌是正确的,因为我将其用于其他任务。 请帮忙,我在上面粘贴了3个多小时,在google中搜索了官方的Web openstack,但是什么也没有。
重点是我想在openstack中创建虚拟机。 提前致谢。