Bug #11332
closedVersion 1 of the API is deprecated and will be shutdown on November 1st 2015
Description
foreman-digitalocean still using v1 api via Fog?
Updated by Dominic Cleal almost 9 years ago
- Blocked by Refactor #11729: Update fog to 2.0.0 added
Updated by Dominic Cleal almost 9 years ago
I think the new Fog v1.35.0 (and v2, when released) support DO's v2 API, though there's another issue noted on #11729 about v1.35.0.
Updated by Dominic Cleal almost 9 years ago
- Has duplicate Bug #12250: Digital Ocean API v1 Sunsetting November 9, 2015 added
Updated by Alex Shepherd almost 9 years ago
This is now deprecated at DigitalOcean's end, so we are now completely unable to use Foreman to directly provision DigitalOcean machines. Is there a timeline, or list of tasks that need completing in order to get this back up and running? It's relatively critical for our business, and I can't find any kind of timescale.
Updated by Dominic Cleal almost 9 years ago
It's pretty bleak. The version of Fog that added some DO 2.0 support (1.35.0) also broke Ruby 1.9.3 compatibility, so we can't use it without either:
a) dropping 1.9.3 support (ticket #8884), which means providing solutions for the three Debian & Ubuntu OSes affected (EL's in progress via #7228)
b) Fog issuing a further 1.x update with the 1.9.3 support fixed (around the fog-google dependency). https://github.com/fog/fog/issues/3711 might be the best place to request that.
We can also update to Fog 2.0.0 when it's released, but that will also require us dropping 1.9.3 support. This needs to be done sooner than later, though a Fog update may be quicker.
Updated by Dominic Cleal almost 9 years ago
- Blocked by deleted (Refactor #11729: Update fog to 2.0.0)
Updated by Dominic Cleal almost 9 years ago
- Blocked by Refactor #12494: Update fog to 1.36.0 added
Updated by Dominic Cleal almost 9 years ago
Dominic Cleal wrote:
b) Fog issuing a further 1.x update with the 1.9.3 support fixed (around the fog-google dependency). https://github.com/fog/fog/issues/3711 might be the best place to request that.
This happened, #12494 tracks updating Foreman. We'd normally only put this into a new major release, but I guess we'll have to test it and see about including it in 1.10.1 to fix this issue.
Updated by Tommy McNeely almost 9 years ago
Fog released 1.36 Monday morning, so we should be able to do this now, right?
Updated by Dominic Cleal almost 9 years ago
Tommy McNeely wrote:
Fog released 1.36 Monday morning, so we should be able to do this now, right?
Yes, 1.36.0 is in develop now, Debian nightlies but not RPM nightlies yet. Adding :version => :v2
to the client method (next to :provider) in the digitalocean.rb model should cause it to use the V2 API. After that it just needs testing.
Updated by Tommy McNeely almost 9 years ago
I have been working on it... https://github.com/theforeman/foreman-digitalocean/compare/master...TJM:11332-apiv2?expand=1 ... but it requires pretty significant changes.
Things I have found, so far ...- The version => 'v2' and no "username" .. the "password" is now `digitalocean_token` (easy stuff)
- some other methods are renamed such as destroy_ssh_key -> delete_ssh_key (which I like better anyhow)
- flavor is now size (this has caused some issues, I can't decide whether to change all the views or have a fog_extension)
- region and "size" now uses "slug" instead of "id" (there is no regions.get, that needs to be regions.find { ... }
- There is no longer an "id" mapping between objects, such as a server having a (region_id, flavor_id) that maps back to a regions.get(id), region and size are just a hash directly in the server object, which makes it somewhat easier and somewhat harder.
- The only thing that I don't like so far is that I have a "nicer" name field for the image name, but because image is a hash directly in the server object, it may not have my enhancements
- vm.state (client.servers.first.state) doesn't exist, had to add a fog_extension for that too
There are actually several cases where I feel like my "fog_extensions" should actually just be PRs to fog :)
Updated by Daniel Lobato Garcia over 8 years ago
For the record, I nearly have this working now. It required a few changes to support the v2 API - I got it to just to create the droplet so far.
Deleting it doesn't work, I have to check what's the issue, and SSHing the provision script isn't possible either, as the Orchestration::Compute stuff
is trying to run 'Host.find_by_ip' which returns undefined method (find_by_ip).
Host.find_by_ip should be available AFAIK - so maybe that last point is a bug common to all compute resources with SSH provisioning.
Updated by Daniel Lobato Garcia over 8 years ago
- Priority changed from Normal to Urgent
Raising priority as this effectively blocks anyone from using the plugin until fixed.
Updated by Dominic Cleal over 8 years ago
Daniel Lobato Garcia wrote:
Deleting it doesn't work, I have to check what's the issue, and SSHing the provision script isn't possible either, as the Orchestration::Compute stuff
is trying to run 'Host.find_by_ip' which returns undefined method (find_by_ip).Host.find_by_ip should be available AFAIK - so maybe that last point is a bug common to all compute resources with SSH provisioning.
It was removed, but Foreman core still attempts to use it - see #13084 (unfixed).
Updated by Daniel Lobato Garcia over 8 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset foreman-digitalocean|ab3d6fb412eb93f7fea2a39a518eb24b50226499.