Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Nova REST API: --user-data equivalent

This is probably going to turn out to be a silly question, but I've been unable to figure it out myself. I can create a new server and have a script run at create time from the command line like this:

nova boot --user-data ./ --image Ubuntu-Basic --flavor m1.small myinstance

And I can create a new server from the REST API by encoding the script in Base64 and sending this:

   "server": {
      "flavorRef": "",
      "imageRef": "",
      "name": "test-2",
      "personality": [
            "contents":"<Base64 encoded script>",

When I do it from the command line, the script gets run at create time. However, when I do it from the REST API, it just gets copied into the provided path and never seems to get run. Is there a way to mimic the --user-data behavior from the REST API? Or is there a better/different way of getting scripts into the server to run at create time?