Use the OpenStack Glance API instead of Nova?

68 views
Skip to first unread message

John Shimek

unread,
Oct 31, 2016, 8:43:44 PM10/31/16
to Packer
Hi,

We are using Packer to make OpenStack images in an automated system (Spinnaker) and would like to make the images public. After digging through Packer, GopherCloud and OpenStack, it appears not to be easily doable through Packer. From what I found in builder/openstack/step_create_image.go, Packer is calling the Nova (the compute service) servers action API[1] with 'createImage'  as the action. Nova does a little translation of the request and calls the Glance (the image service) 'createImage' API.

The problem is that the Nova create image API explicitly sets the visibility to private, regardless of what is passed into the request. A quick look at the GopherCloud APIs for both Nova and Glance to create an image are similar, the the added bonus of an explicit visibility flag in the GopherCloud Glance API. So switching that around in step_create_image.go shouldn't be difficult. Once that change was made, a visiblity option could be added to Packer OpenStack builder configuration. Another added bonus of this is with the 'metadata' option that this builder takes, any other options in the Glance Create Image API would be supported automatically without Nova mucking up the request.

With all that said, how open is Packer to getting a PR making these changes? I didn't want to just create a PR like this without a discussion first.

Thank you,
John Shimek

[1] http://developer.openstack.org/api-ref-compute-v2.1.html#createImage
[2] http://developer.openstack.org/api-ref/image/v2/index.html?expanded=create-an-image-detail#images

Rickard von Essen

unread,
Nov 2, 2016, 11:12:04 AM11/2/16
to packe...@googlegroups.com
Glance support in gophercloud (rackspace) was a blocker until recently, see https://github.com/rackspace/gophercloud/pull/565. But we like to use it to provide more features as you say. We would also like a post-processor that take a build (from at least qemu) and upload it to Glance. 

It would also be preferred to move to the new https://github.com/gophercloud/gophercloud when it's reasonable stable (which it already might be).

Some background to the post-processor: 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/72dd3fc9-5887-426c-b917-042ab67cdfcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Shimek

unread,
Nov 3, 2016, 10:25:19 AM11/3/16
to packe...@googlegroups.com
Glad to hear you are open to this proposal. I am not working on an urgent timeline so I won't get to this immediately, but I will see what I can do next week. I will also look into moving to the new gophercloud/gophercloud.

Thank you,
John Shimek
You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this group and all its topics, send an email to packer-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages