Hello guys<div><br></div><div>I am trying to write a python script, which creates a new server on a compute node. As information sources I used the "Programming OpenStack Compute API - 1.1" guide [1] and the "OpenStack Compute Developer Guide - API v2" [2] book.</div>

<div><br></div><div>I managed to create API calls for retrieving the api token, flavors and images. All this went very smoothly thanks to the good documentation.</div><div><br></div><div>Strange enough, in my server create script seems to be some kind of syntax/format error, according to the error message I receive, when I execute the script. The system or rather the api tells me that the personality information for the server is malformed:</div>

<div>{"badRequest": {"message": "Bad personality format", "code": 400}}</div><div><br></div><div>However I can't figure out what is wrong, because my JSON string is in the correct syntax, as you can see on this website [4]. I checked the nova-api-log but I wans't able to extract more information from there. I posted the output of my nova-api-log at the end of my e-mail.</div>
<div><br></div><div>I uploaded my script into my git repository [3], if someone wants to scann the whole file. Has someone an idea what I might have overseen?</div>
<div><br></div><div>Thanks for your inputs.</div><div><br>Cheers,</div><div>Nicolas</div><div><br></div><div>## Supplementary</div><div><br></div><div>Nova-api.log</div><div><div>2012-03-24 09:33:19,903 DEBUG nova [-] HTTP PERF: 0.01919 seconds to GET <a href="http://127.0.0.1:35357" target="_blank">127.0.0.1:35357</a> /v2.0/tokens/a9a59cbd-a68f-473d-a6df-33c44fa2c485) from (pid=1197) getresponse /var/lib/nova/keystone/common/bufferedhttp.py:99</div>

<div>2012-03-24 09:33:19,916 DEBUG nova [-] HTTP PERF: 0.01223 seconds to GET <a href="http://127.0.0.1:35357" target="_blank">127.0.0.1:35357</a> /v2.0/tokens/a9a59cbd-a68f-473d-a6df-33c44fa2c485) from (pid=1197) getresponse /var/lib/nova/keystone/common/bufferedhttp.py:99</div>

<div>2012-03-24 09:33:19,917 DEBUG routes.middleware [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] No route matched for POST /4/servers from (pid=1197) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:97</div>

<div>2012-03-24 09:33:19,918 DEBUG routes.middleware [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] Matched POST /4/servers from (pid=1197) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:100</div><div>2012-03-24 09:33:19,918 DEBUG routes.middleware [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] Route path: '/{project_id}/servers', defaults: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x29adc50>} from (pid=1197) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:102</div>

<div>2012-03-24 09:33:19,918 DEBUG routes.middleware [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] Match dict: {'action': u'create', 'controller': <nova.api.openstack.wsgi.Resource object at 0x29adc50>, 'project_id': u'4'} from (pid=1197) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:103</div>

<div>2012-03-24 09:33:19,918 INFO nova.api.openstack.wsgi [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] POST <a href="http://192.168.163.20:8774/v1.1/4/servers" target="_blank">http://192.168.163.20:8774/v1.1/4/servers</a></div>
<div>
2012-03-24 09:33:20,595 INFO nova.api.openstack.wsgi [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] HTTP exception thrown: 400 Bad Request</div><div>Content-Type: text/html; charset=UTF-8</div><div>Content-Length: 0</div>

<div>2012-03-24 09:33:20,595 INFO nova.api.openstack.wsgi [1f576a54-c01e-46cf-9fb8-aa5c278dbce7 nodermatt 4] <a href="http://192.168.163.20:8774/v1.1/4/servers" target="_blank">http://192.168.163.20:8774/v1.1/4/servers</a> returned with HTTP 400</div>
</div><div><br></div><div><br></div><div>[1] <a href="http://docs.openstack.org/api/openstack-compute/programmer/content/booting-a-new-server.html" target="_blank">http://docs.openstack.org/api/openstack-compute/programmer/content/booting-a-new-server.html</a></div>

<div>[2] <a href="http://docs.openstack.org/api/openstack-compute/2/content/CreateServers.html" target="_blank">http://docs.openstack.org/api/openstack-compute/2/content/CreateServers.html</a></div><div>[3] <a href="https://github.com/nodermatt/IPA/blob/master/CreateServer.py" style="font-family:Arial,sans-serif;font-size:12pt">https://github.com/nodermatt/IPA/blob/master/CreateServer.py</a></div>
<div>[4] <a href="http://www.bodurov.com/JsonFormatter/view.aspx?json=%257B%2522server%2522%253A%257B%2522name%2522%253A%2520%2522Server-name%2522%252C%2520%2522imageRef%2522%253A%2520%2522http%253A%2F%2F192.168.163.20%253A8774%2Fv1.1%2F4%2Fimages%2F2%2522%252C%2520%2522flavorRef%2522%253A%2520%2522http%253A%2F%2F192.168.163.20%253A8774%2Fv1.1%2F4%2Fflavors%2F1%2522%252C%2520%2522metadata%2522%253A%2520%257B%2522My%2520Server%2520Name%2522%253A%2522Servername-meta%2522%257D%252C%2520%2522personality%2522%253A%2520%257B%2522path%2522%253A%2520%2522%2Fetc%2Fbanner.txt%2522%252C%2520%2522contents%2522%253A%2520%2522I%2520am%2520a%2520text%2520in%2520a%2520banner%2522%257D%2520%257D%257D" target="_blank">http://www.bodurov.com/JsonFormatter/view.aspx?json=%257B%2522server%2522%253A%257B%2522name%2522%253A%2520%2522Server-name%2522%252C%2520%2522imageRef%2522%253A%2520%2522http%253A%2F%2F192.168.163.20%253A8774%2Fv1.1%2F4%2Fimages%2F2%2522%252C%2520%2522flavorRef%2522%253A%2520%2522http%253A%2F%2F192.168.163.20%253A8774%2Fv1.1%2F4%2Fflavors%2F1%2522%252C%2520%2522metadata%2522%253A%2520%257B%2522My%2520Server%2520Name%2522%253A%2522Servername-meta%2522%257D%252C%2520%2522personality%2522%253A%2520%257B%2522path%2522%253A%2520%2522%2Fetc%2Fbanner.txt%2522%252C%2520%2522contents%2522%253A%2520%2522I%2520am%2520a%2520text%2520in%2520a%2520banner%2522%257D%2520%257D%257D</a><br clear="all">

<div><br></div>-- <br>Freundliche Grüsse,<br>Nicolas Odermatt<br><br><br>
</div>