Skip to content
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

DigitalOcean: Reference base image by previous snapshot name #3252

Closed
kaelumania opened this issue Feb 23, 2016 · 8 comments
Closed

DigitalOcean: Reference base image by previous snapshot name #3252

kaelumania opened this issue Feb 23, 2016 · 8 comments
Labels
bug builder/digitalocean post-1.0 regression wontfix Out of scope/alignment with the project, or issue is expected, intended behavior

Comments

@kaelumania
Copy link

I have an existing snapshot created via
"snapshot_name": "my_base_0.0.1"

and then reference it in a new resource via
"image": "my_base_0.0.1"

but I am getting the error:
https://api.digitalocean.com/v2/droplets: 422 You specified an invalid image for Droplet creation.

It seems that the logic in order to read images by name (fetching private images and comparing slug, name or id) has been removed recently. At the moment the DigitalOcean API is used directly and it does not support finding images by name. I think it is not a good packer API to allow snapshots with a name and then be unable to reference this name in a following build.

@cbednarski
Copy link
Contributor

Thanks for the report. Can you try using the format region:image (id or name or whichever) for image?

@kaelumania
Copy link
Author

@cbednarski Thanks for the response. Unfortunately no, using "image": "fra1:my_base_image" results again in 422 You specified an invalid image for Droplet creation. when trying to reference my private image. But it's not surprising, because packer uses the do api client directly and searches only for the slug: https://github.com/mitchellh/packer/blob/master/builder/digitalocean/step_create_droplet.go#L28

Version 0.8.0 (June 23, 2015) introduced:

Here was a previous issue #1792 that solved it by grabbing all (private) images from DO and then comparing them by name. But that behaviour was removed introducing the DO v2 API (see commit 6c6f3c2#diff-773223d4ba1a61e81daea8a8dfcdb692L294)

Image names don't have to be unique, maybe therefore they removed the support. But I would rather prefer to return the newest image with a given name.

@cbednarski
Copy link
Contributor

Got it. The change that broke this is 6d31470

The reason for the change is that if you have more than 200 images the image won't necessarily come back from the API, we don't page, and doing so would be really slow. Obviously this was necessary to do the name lookup. Unfortunately the integration tests didn't catch this case.

It does not look like the API call we need for this is supported so we'll likely have to rework this. https://developers.digitalocean.com/documentation/v2/#images

@djmaze
Copy link

djmaze commented Apr 13, 2016

Any updates on this?

@mjtieman
Copy link

mjtieman commented Aug 6, 2016

Any movement on this issue?

@kaelumania
Copy link
Author

@cbednarski do you have any plans to fix this soon?

@rickard-von-essen
Copy link
Collaborator

@kaelumania PR's are welcome.

@mwhooker
Copy link
Contributor

This isn't something we're targeting for 1.0, so I'm going to close this. We rely on the community to support this builder, so the best way to get this added would be to implement it. Please see the mailing list
for more details on 1.0.

@mwhooker mwhooker added post-1.0 wontfix Out of scope/alignment with the project, or issue is expected, intended behavior labels Jan 30, 2017
@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug builder/digitalocean post-1.0 regression wontfix Out of scope/alignment with the project, or issue is expected, intended behavior
Projects
None yet
Development

No branches or pull requests

6 participants