-1

Can someone please provide me with a sample file for Packer creating OS image? I have this one:

{
  "builders": [{
    "type": "openstack",
    "ssh_username": "ubuntu",
    "tenant_name": "mytenant",
    "flavor": "m1.tiny",
    "identity_endpoint": "http://1.2.3.4:5000/",
    "availability_zone": "az1",
    "source_image": "Ubuntu 16.04 With Proxy",
    "image_name": "Ubuntu 16.04 With Proxy and Python"
  }],

  "provisioners": [
    {
      "type": "shell",
      "script": "python.sh"
    }
  ]

}

but OS always returns:

==> openstack: Error launching source server: Invalid request due to incorrect syntax or missing required parameters.

I have no idea what I am missing.

Of course i have correct OS_ env values preset for my Nova API.

Misko
  • 1,542
  • 2
  • 19
  • 31

1 Answers1

1

You have to use source_image_name or use the ID to reference the image

From the docs:

  • source_image (string) - The ID or full URL to the base image to use. This is the image that will be used to launch a new server and provision it. Unless you specify completely custom SSH settings, the source image must have cloud-init installed so that the keypair gets assigned properly.

  • source_image_name (string) - The name of the base image to use. This is an alternative way of providing source_image and only either of them can be specified.

See source_image

Community
  • 1
  • 1
Rickard von Essen
  • 4,110
  • 2
  • 23
  • 27
  • Thanks, but I am still not there: I had to ad "networks" parameter with the UUID of my network and now I am here again - http://pastebin.com/9ht1MkYT – Misko Jan 13 '17 at 08:04
  • Dump http request/responses to the nova api with tcpdump, wirkeshark or httpry. Or if you can check in OpenStack the request/response that failes. pastbin that but be sure to remove any credentials. I guess that your nova api doesn't work as expected. – Rickard von Essen Jan 13 '17 at 16:51
  • For me, in addition to the networks, I needed to add the ID of the floating IP address I was using too. You can get that using `openstack floating ip list` cmd. – Paulito.Bandito Oct 12 '22 at 15:43