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

New Provider: SoftLayer #4327

Conversation

danielcbright
Copy link

@danielcbright danielcbright commented Dec 15, 2015

This PR will add a new cloud provider to the Terraform mix - IBM's SoftLayer

I'm starting this PR with support for virtual_guest and ssh_key resources, these resources are complete enough for most basic needs when spinning up a virtual_guest on SoftLayer. After this PR is accepted we will be creating PR's for even more significant updates not only to virtual_guest and ssh_key but support for dns_domain, dns_domain_resource and network_application_delivery_controller (Netscaler VPX) resources.

Using the provider

Here is an example that will setup the following:

  • An SSH key resource.
  • A virtual server resource that uses an existing SSH key.
  • A virtual server resource using an existing SSH key and a Terraform managed SSH key (created as "test_key_1" in the example below).

(create this as sl.tf and run terraform commands from this directory):

provider "softlayer" {
    username = ""
    api_key = ""
}

# This will create a new SSH key that will show up under the \
# Devices>Manage>SSH Keys in the SoftLayer console.
resource "softlayer_ssh_key" "test_key_1" {
    name = "test_key_1"
    public_key = "${file(\"~/.ssh/id_rsa_test_key_1.pub\")}"
    # Windows Example:
    # public_key = "${file(\"C:\ssh\keys\path\id_rsa_test_key_1.pub\")}"
}

# Virtual Server created with existing SSH Key already in SoftLayer \
# inventory and not created using this Terraform template.
resource "softlayer_virtual_guest" "my_server_1" {
    name = "my_server_1"
    domain = "example.com"
    ssh_keys = ["123456"]
    image = "DEBIAN_7_64"
    region = "ams01"
    public_network_speed = 10
    cpu = 1
    ram = 1024
}

# Virtual Server created with a mix of previously existing and \
# Terraform created/managed resources.
resource "softlayer_virtual_guest" "my_server_2" {
    name = "my_server_2"
    domain = "example.com"
    ssh_keys = ["123456", "${softlayer_ssh_key.test_key_1.id}"]
    image = "CENTOS_6_64"
    region = "ams01"
    public_network_speed = 10
    cpu = 1
    ram = 1024
}

You'll need to provide your SoftLayer username and API key,
so that Terraform can connect. If you don't want to put
credentials in your configuration file, you can leave them
out:

provider "softlayer" {}

...and instead set these environment variables:

  • SOFTLAYER_USERNAME: Your SoftLayer username
  • SOFTLAYER_API_KEY: Your API key

@jen20
Copy link
Contributor

jen20 commented Dec 15, 2015

Hi @danielcbright! Thanks for submitting this PR - it would be great to have Softlayer support! At the moment it looks like Travis isn't particularly happy though - could you take a look? Thanks

@danielcbright
Copy link
Author

Thanks @jen20! Travis should be happy after maximilien/softlayer-go#81 is accepted and merged, we have a few other things we will be working on as well before this is ready to be pulled in (see checklist). I'm just happy to get this PR started so discussions can be had.

@radeksimko radeksimko added the wip label Dec 28, 2015
@igoonich igoonich force-pushed the feature/softlayer-virtual-guest branch 2 times, most recently from d9b24fb to 4f1fe67 Compare December 30, 2015 08:17
@edude03
Copy link

edude03 commented Jan 28, 2016

Just wanted to say I've been using this PR since it was created and the Softlayer support has been working great! Let me know if there is anything I can do to help this PR get merged faster so I can stop using 3 versions of terraform (custom w/ this PR, custom w/ the NAT gateway PR, and 0.6.9)

@danielcbright
Copy link
Author

Hi @edude03, currently this is stalled as bugs are being worked out on softlayer-go (PR: here maximilien/softlayer-go#85). As soon as that's pulled into master, the tests for this PR should start passing and I can start addressing bugs etc.. and move towards getting it pulled in. Glad to see it's working for you!

@jkbbwr
Copy link

jkbbwr commented Feb 1, 2016

Just as a question, having seen that maximilien/softlayer-go#85 has been merged where is the progress on this pull request? My company is deciding if its worth waiting for this to complete or if we should try and roll a simple solution ourselves.

@edude03
Copy link

edude03 commented Feb 1, 2016

Another option is compiling your own version, it's fairly straightforward
once you have a working go dev environment.
On Mon, Feb 1, 2016 at 8:14 AM Jacob notifications@github.com wrote:

Just as a question, having seen that maximilien/softlayer-go#85
maximilien/softlayer-go#85 has been merged
where is the progress on this pull request? My company is deciding if its
worth waiting for this to complete or if we should try and roll a simple
solution ourselves.


Reply to this email directly or view it on GitHub
#4327 (comment).

@jkbbwr
Copy link

jkbbwr commented Feb 1, 2016

That is an option but an official release date might also be nice.

@danielcbright
Copy link
Author

@jkbbwr

Just as a question, having seen that maximilien/softlayer-go#85 has been merged where is the progress on this pull request? My company is deciding if it's worth waiting for this to complete or if we should try and roll a simple solution ourselves.

PR 85 hasn't been merged, but the previous PR 84 has been, it is live in the develop branch of softlayer-go (https://github.com/maximilien/softlayer-go/tree/develop). Perhaps commenting in the PR for softlayer-go of your success in using the provider will help get it merged into master faster.

🍻

@eirslett
Copy link

eirslett commented Feb 3, 2016

@jkbbwr You could try using this plugin, which is basically an early version of this softlayer provider.

@phinze phinze removed the wip label Feb 9, 2016
danielcbright pushed a commit to IBM-Cloud/terraform that referenced this pull request Feb 11, 2016
@danielcbright
Copy link
Author

Hi @jen20 looks like we're passing Travis' checks now, would definitely like some feedback, especially wanted to make sure I imported the softlayer-go into the /vendors tree properly or if I missed something. Thanks!

@ckelner
Copy link

ckelner commented Feb 23, 2016

Would love a status update from the HC side 👍 thanks!

@jen20
Copy link
Contributor

jen20 commented Mar 23, 2016

Hi @danielcbright and @ckelner! Looking over this it definitely seems to be in better shape now! Does anyone involved have any objections to me rebasing and squashing the commits here? We need to get a softlayer account set up for running acceptance tests as part of our nightly build - I'll start the process of that now.

@ckelner
Copy link

ckelner commented Mar 23, 2016

Hey @jen20 -- I have no objections! Thank you for looking! 🎆

@danielcbright
Copy link
Author

Thanks @jen20 sounds great to me!

@danielcbright
Copy link
Author

@jen20 I'm going to go ahead and rebase/squash the commits, how are things coming on your side?

@danielcbright danielcbright force-pushed the feature/softlayer-virtual-guest branch 2 times, most recently from 5c3828f to e578d57 Compare April 4, 2016 19:49
Here is an example that will setup the following:
+ An SSH key resource.
+ A virtual server resource that uses an existing SSH key.
+ A virtual server resource using an existing SSH key and a Terraform managed SSH key (created as "test_key_1" in the example below).

(create this as sl.tf and run terraform commands from this directory):
```hcl
provider "softlayer" {
    username = ""
    api_key = ""
}

resource "softlayer_ssh_key" "test_key_1" {
    name = "test_key_1"
    public_key = "${file(\"~/.ssh/id_rsa_test_key_1.pub\")}"
    # Windows Example:
    # public_key = "${file(\"C:\ssh\keys\path\id_rsa_test_key_1.pub\")}"
}

resource "softlayer_virtual_guest" "my_server_1" {
    name = "my_server_1"
    domain = "example.com"
    ssh_keys = ["123456"]
    image = "DEBIAN_7_64"
    region = "ams01"
    public_network_speed = 10
    cpu = 1
    ram = 1024
}

resource "softlayer_virtual_guest" "my_server_2" {
    name = "my_server_2"
    domain = "example.com"
    ssh_keys = ["123456", "${softlayer_ssh_key.test_key_1.id}"]
    image = "CENTOS_6_64"
    region = "ams01"
    public_network_speed = 10
    cpu = 1
    ram = 1024
}
```

You'll need to provide your SoftLayer username and API key,
so that Terraform can connect. If you don't want to put
credentials in your configuration file, you can leave them
out:

```
provider "softlayer" {}
```

...and instead set these environment variables:

- **SOFTLAYER_USERNAME**: Your SoftLayer username
- **SOFTLAYER_API_KEY**: Your API key
@danielcbright danielcbright force-pushed the feature/softlayer-virtual-guest branch from e578d57 to 31653bb Compare April 4, 2016 20:03
@danielcbright danielcbright changed the title [WIP] New Provider: SoftLayer New Provider: SoftLayer Apr 4, 2016
@danielcbright
Copy link
Author

Hi @jen20 just wanted to check-in and see if there is anything I can do to get this moving on my side.

🍻

@eirslett
Copy link

@danielcbright Do you currently run a Terraform in-house fork? (In FINN.no we still use the independent terraform plugin that this PR is based on, which can be released whenever we need to)

Releasing it as a separate project might be a possible solution if the PR isn't merged 😉

@jen20
Copy link
Contributor

jen20 commented Apr 26, 2016

Hi @danielcbright! I've just given the code for this a quick initial review, and it looks good to merge to me. I haven't managed to yet run the tests as we have no internal SoftLayer account. I'll aim to get that sorted out this week and have this merged for v0.6.16 of Terraform! Thanks for your work on this!

@danielcbright
Copy link
Author

Thanks @jen20 that's great to hear!, please let me know if you need any help getting a Softlayer account sorted for testing purposes.

@jen20
Copy link
Contributor

jen20 commented May 3, 2016

This is merged - it was rebased so the commit IDs changed however. Thanks for the work @danielcbright!

@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants