Project

General

Profile

Actions

Bug #11332

closed

Version 1 of the API is deprecated and will be shutdown on November 1st 2015

Added by El Joppa over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

foreman-digitalocean still using v1 api via Fog?

https://developers.digitalocean.com/documentation/v1/


Related issues 2 (0 open2 closed)

Has duplicate Foreman - Bug #12250: Digital Ocean API v1 Sunsetting November 9, 2015Duplicate10/22/2015Actions
Blocked by Foreman - Refactor #12494: Update fog to 1.36.0ClosedDominic Cleal11/16/2015Actions
Actions #1

Updated by Dominic Cleal over 8 years ago

Actions #2

Updated by Dominic Cleal over 8 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.

Actions #3

Updated by Dominic Cleal over 8 years ago

  • Has duplicate Bug #12250: Digital Ocean API v1 Sunsetting November 9, 2015 added
Actions #4

Updated by Alex Shepherd over 8 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.

Actions #5

Updated by Dominic Cleal over 8 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.

Actions #6

Updated by Dominic Cleal over 8 years ago

Actions #7

Updated by Dominic Cleal over 8 years ago

Actions #8

Updated by Dominic Cleal over 8 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.

Actions #9

Updated by Tommy McNeely over 8 years ago

Fog released 1.36 Monday morning, so we should be able to do this now, right?

Actions #10

Updated by Dominic Cleal over 8 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.

Actions #11

Updated by Tommy McNeely over 8 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 :)

Actions #12

Updated by Daniel Lobato Garcia about 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.

Actions #13

Updated by Daniel Lobato Garcia about 8 years ago

  • Priority changed from Normal to Urgent

Raising priority as this effectively blocks anyone from using the plugin until fixed.

Actions #14

Updated by Dominic Cleal about 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).

Actions #15

Updated by Daniel Lobato Garcia almost 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF