New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better openstack support #480
Comments
It looks like you can specify the auth url as the provider (rackspace/gophercloud@23f2a3a) but then things fall over with the packer references to 'cloudServersOpenStack' https://github.com/mitchellh/packer/blob/master/builder/openstack/builder.go#L64 It would be nice if packer could be used for something other than rackspace but I don't know how to do it given the current code. |
I'd like to see this as well, many people have been asking for it. I defer to @markpeek for now due to his knowledge on the subject, and tagged this as an enhancement. |
Would love to see this, trying to get packer working on our internal openstack cloud and hit this constraint. |
I fixed this issue in my openstack-postprocessor (see #540 for info on that). I'll see about adding the same generic model of URL to the builder. Mitchell -- if you need a separate PR for both, let me know and I'll branch 'em, otherwise I can do it all (both the post processor for openstack uploads and this general URL support for the openstack builder) in the same PR. |
We're close to getting a proper and cleaned up PR for this. |
Any updates on this? Or any documentation that can help in using Packer with private deployments? |
Same here. Trying to use packer with a Metacloud instance (based off OpenStack Havana IIRC) and I keep getting this:
The docs at http://www.packer.io/docs/builders/openstack.html say to check the "region"; as far as I can tell we don't use "region" in our config, so I don't know what to use here. |
I fixed the "Missing endpoint..." error above but discovering that we actually have a default region name of "RegionOne" with our Metacloud instance (discovered this by looking at output of This actually seems similar to #1142 in that it appears that packer or gophercloud is picking the wrong endpoint (probably the first one it discovers, as for me it's picking Volume, which happens to be the first in the list returned from I feel like the problem centers around what I should provide for My packer config:
The above config with
Ditto if I omit it or set it to
Note that the URL it's attempting to use above and getting a 404 is the OpenStack Volume service:
Is there some other value I should be providing for |
In my working Packer file, I use only this for my builder section: "builders": [{ All the relevant parts are pulled from the OS_* environment variables provided by sourcing an openrc file. Can you try a more stripped down version? Also @msabramo, I am confused about you saying that Packer is trying to hit the volume API on 8776. The nova endpoint list there shows everything on 8776 as well. |
@devcamcar: Thanks for responding! What kind of cloud are you using? Rackspace, or something else? With your simple config, I get:
I think is because I didn't give it enough info to know what auth URL to use, so it's probably hitting Rackspace or something. I suspect that at the very least, I need this in my config:
so that it can at least find my Keystone. Does your
Note that in my setup, Volume service is the first endpoint and it's running on 8776. Other things are running on other ports and notably, Compute is running on port 8774. |
@msabramo By sourcing the openrc file, you are automatically and implicitly specifying the provider: https://github.com/mitchellh/packer/blob/master/builder/openstack/access_config.go#L35 I just confirmed again that things are working (against a Grizzly based cloud). What build of packer are you using? $ packer --version |
I have:
|
so that it gets compute (nova) API and not some other incorrect API. (e.g.: for me it was getting the Volume service API) This fixes issue hashicorpGH-480 for me.
I found a fix for the issue I was having with tons of help from @jrperritt from the gophercloud team. 👏 See rackspace/gophercloud#176 and #1412 With that, I am able to get packer to create OpenStack keypairs and instances. |
There is a PR to fix this in gophercloud: rackspace/gophercloud#179 |
With all the PRs I've been merging and upstream fixes, I believe its safe to say that we work with other OpenStack instances. Yes? If I'm wrong please update! |
It's definitely working much better for me now with my Metacloud, except for #1415, but definitely progress and this might even turn out to be an issue with our config. Thanks! |
@msabramo any chance you can post the final working config template that work for you with Metacloud? Thanks a bunch. |
Absolutely. Here's the template I'm using: {
"builders": [
{
"type": "openstack",
"ssh_username": "monkey",
"image_name": "ubuntu1404_packer_test_1",
"source_image": "91d9c168-d1e5-49ca-a775-3bfdbb6c97f1",
"flavor": "2"
}
]
} I'm using this with packer on GitHub master; not the release version. Because the release version requires you to specify a region and what not. Running it looks like this:
I do still have the problem in #1415 where most of the time, I actually end up with no image because the image seems to get deleted when the temporary instance that it's built from is terminated. But this is a separate issue and could even be something specific to my environment. |
I also just created a PR that adds the above example config to the OpenStack builder doc page: #1459 |
awesome! I will give this a try thanks for the pointers. |
I'm running on a Metacloud instance as well (well, now Cisco OpenStack Private Cloud). I can't seem to get pass the insufficient privileges problem like you did. OS_TENANT_ID=12345....
OS_PASSWORD=secret
OS_AUTH_URL=http://<redacted>.metacloud.net:5000/v2.0
OS_USERNAME=user
OS_TENANT_NAME=TCO Application Then packer file: {
"builders" : [{
"type": "openstack",
"ssh_username": "core",
"image_name": "coreos-java",
"source_image": "bc3c7ad4-33d5-4702-a01a-b4b65b5c14a3",
"flavor": "5"
}]
} Running: packer build coreos-jenkins3.json
openstack output will be in this color.
Build 'openstack' errored: Missing endpoint, or insufficient privileges to access endpoint
==> Some builds didn't complete successfully and had errors:
--> openstack: Missing endpoint, or insufficient privileges to access endpoint
==> Builds finished but no artifacts were created. My version is $ packer version
Packer v0.7.5 Any hints of how I can troubleshoot? |
Same issue as vallard, same packer version, private OpenStack, still the same issue .... |
I made a PR today (commit: 55c2ac4) with a new openstack builder using the new gophercloud API. That might lead to a more flexible openstack builder soon. |
Currently, the openstack builder assumes that a user is on Rackspace. https://github.com/rackspace/gophercloud/blob/master/global_context.go#L15
The builder imports gophercloud, which has hardcoded AuthEndpoint to Rackspace's URLs.
Perhaps instead of having 'provider' be either 'rackspace-us/uk', the builder could require the AuthEndpoint directly, which any openstack user will already have.
The text was updated successfully, but these errors were encountered: