Giter Site home page Giter Site logo

knife-softlayer's Introduction

Knife::Softlayer

Gem Version Build Status Dependency Status

A Chef Knife plugin for launching, bootstrapping, and managing compute instances in the IBM SoftLayer cloud.

Installation

Add this line to your application's Gemfile:

gem 'knife-softlayer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install knife-softlayer

Configuration

Add your SoftLayer username and API key to your knife.rb file.

log_level                :info
log_location             STDOUT
node_name                'node'
client_key               '/path/to/key.pem'
validation_client_name   'some-validator'
validation_key           '/path/to/validator.pem'
chef_server_url          'https://example.com/organizations/org'
syntax_check_cache_path  '/path/to/syntax_check_cache'
knife[:softlayer_username] = "<SOFTLAYER USERNAME>"
knife[:softlayer_api_key]  = "<SOFTLAYER API KEY>"

Usage

See knife softlayer --help for more information.

EXAMPLES:

# look at some options
user@local> knife softlayer flavor list [--all]
# the minimum number of pieces of flare
user@local> knife softlayer server create --hostname test --domain example.com --flavor tiny
# being sort of specific about things
user@local> knife softlayer server create -H test -D example.com \
--block-storage 0:25,2:100,5:1000 \ # device:GB, device:GB, ...
--network-interface-speed 1000 \
--cores 8 \
--ram 49152 \
--os-code REDHAT_6_64 \
--datacenter ams01 \
--node-name random-node-name \
--assign-global-ip <existingGlobalIpv4Address> \
--run-list 'recipe[apt],recipe[git],recipe[rbenv],recipe[memcached],recipe[redis]'

Legal stuff

Use of this software requires runtime dependencies. Those dependencies and their respective software licenses are listed below.

--

Author:: Matt Eldridge ([email protected])

© Copyright IBM Corporation 2014.

LICENSE: Apache 2.0 (http://www.apache.org/licenses/)

knife-softlayer's People

Contributors

allmightyspiff avatar cesarcelism avatar cphrmky avatar d-higuchi avatar edwardbetts avatar hairyhenderson avatar matburstorm avatar renier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

knife-softlayer's Issues

"instance.wait_for" method returns timeout.

Already the instance is ready, but "instance.wait_for" method returns timeout.
Actually, when the command is waiting for, I can bootstrap on another console.
Logs are below.

$ knife softlayer server create -B 0:25 -N chef-server -C 1 --datacenter tok02 -D urasoko.com -H chef-server -O CENTOS_6_64 -R 1024 -r recipe["chef-server"] -VV
INFO: Using configuration from /Users/urasoko/CL/chef-repo/.chef/knife.rb
Launching SoftLayer VM, this may take a few minutes.
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
...........................................................
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/fog-core-1.25.0/lib/fog/core/wait_for.rb:11:in `wait_for': The specified wait_for timeout (600 seconds) was exceeded (Fog::Errors::TimeoutError)
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/fog-core-1.25.0/lib/fog/core/model.rb:66:in `wait_for'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-softlayer-0.3.12/lib/chef/knife/softlayer_server_create.rb:303:in `block in run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-softlayer-0.3.12/lib/chef/knife/softlayer_server_create.rb:408:in `call'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-softlayer-0.3.12/lib/chef/knife/softlayer_server_create.rb:408:in `block in progress'

Can anybody catch this?

use-private-network flag

We have an environment in SoftLayer with several VLANS. Port 22 is closed everywhere to the public, so we can ssh into the servers only when connected to the VPN. There's an option in the plugin (--use-private-network) that allows to bootstrap using the private interface. Unfortunately, it seems like the chef-client starts as soon as the connection becomes available regardless of the fact that the provisioning process is complete. In fact, the chef-client starts its execution but then a reboot signal comes from the provisioning, killing the chef-client execution. Any idea how to solve this?
Thanks

installation instructions improvment

When i installed knife-soflayer i ran into those issues ( so i paln to create a PR for this soon)

  1. The default location in which knife expects to find this file is ~/.chef/knife.rb

  2. and if you run into installation error like these :-
    "Building nokogiri using packaged libraries. checking for gzdopen() in -lz... no zlib is missing; necessary for building libxml2 *** extconf.rb failed ***"

then try :-
sudo apt-get install zlib1g-dev
gem install nokogiri
gem install knife-softlayer

API Question - Excon Error while provisioning server

Hello,

I'm getting the below error while provisioning servers using SOftlayer API.
ERROR: Excon::Error::Socket: Connection reset by peer (Errno::ECONNRESET)

We use the Knife Softlayer command to provision Servers as below:
knife softlayer server create
--image-id ${image_id}
--ssh-keys ${ssh_keys}
--hostname $node_name
--network-interface-speed 100
--domain $domain_name
--cores ${cores}
--ram ${ram}
--datacenter ${datacenter}
--node-name $node_name
--vlan $public_vlan
--private-vlan $private_vlan
--use-private-network
-x root
-i $USER_HOME/.ssh/id_rsa

The session throws an error after 6 minutes.

The Softlayer's API seems to have an issue where sometimes the server resets the connection to the client.

Could help me in resolving this issue?

Default to SAN Virtual Server

Set the default storage option so SAN rather than local disk. This will be more in line with our other avenues for Virtual Server provisioning.

knife softlayer server create times out after VM is created

Hi. I'm a brand-new user so maybe I'm doing something wrong...

I'm issuing this command:

$ knife softlayer server create --datacenter wdc01 --os-code CENTOS_6_64 --hostname MYHOST \
   --domain MYDOMAIN --flavor m1.tiny --run-list 'role[MYROLE]' --private-network-only

And it's responding with:

Launching SoftLayer VM, this may take a few minutes.
............................................................................
<snip>
............................................................................
........................................................
ERROR: Fog::Errors::TimeoutError: The specified wait_for timeout (600 seconds) was exceeded

I tried jacking up the timeout (by editing Fog's wait_for.rb by hand - couldn't find a way to configure this??) to 20 minutes, but same story.

The thing is - the VM is being created without error and I can SSH in before the timeout occurs.

Anything obvious I'm missing?

SoftLayer API disruption Event

Hi,

Knife SoftLayer Plugin by default uses host has api.softlayer.com
:host => "api.softlayer.com"

Due to API disruption event, we should change endpoint from api.softlayer.com to api-dev.softlayer.com
How do i change API end point for knife SoftLayer Plugin?

API Disruption Event Description
Subject: API Disruption: On March 1st IBM Cloud will stop supporting TLS 1.0 and 1.1 on api.softlayer.com and api.service.softlayer.com

What Is Happening?
On March 1, 2018 at 0900 UTC (0300 CDT) IBM Cloud Infrastructure will stop supporting TLS 1.0 and 1.1 encryption on api.softlayer.com and api.service.softlayer.com; these API endpoints will only support callers using TLS 1.2 encryption levels or higher.

When Will It Happen?
On March 1, 2018 at 0900 UTC (0300 CDT) TLS 1.0 and TLS 1.1 will no longer be supported and TLS 1.2+ is required.

Who Will This Affect?
Any users with code or services that reference the softlayer.com API endpoints for IBM Cloud Infrastructure services with encryption levels older than TLS 1.2.

Confirming and Testing Upgrades to TLS 1.2 or Higher
The enhanced security configuration is currently enforced on alternate endpoints. You can test your services against them now to ensure there will be no disruption once the primary endpoints receive the updated configuration:

• api-dev.softlayer.com (instead of api.softlayer.com)
• api-dev.service.softlayer.com (instead of api.service.softlayer.com)

These alternative endpoints only use encryption levels TLS 1.2 or higher. Successfully testing your code and services against these alternative endpoints means your code and services will work properly on the transition date. These alternative endpoints will only be available until the transition date.

What Will Happen If I Make No Change?
If you make no change and your code or services do not support encryption levels TLS 1.2 or higher, you will start to experience connection errors on the transition date. These errors may appear as “transport errors” and contain messages like SSLV3_ALERT_HANDSHAKE_FAILURE. Your code and services will no longer function until you upgrade it to support TLS 1.2 or higher.

If My Code Starts Failing Do I Have Any Temporary Recourse?
If you start to experience connection errors on the transition date, the best course of action is to upgrade your code or services to support TLS 1.2 or higher. If you cannot do that immediately, there will be alternative endpoints provided temporarily to allow you to upgrade your code or services:

• api-deprecated.softlayer.com (instead of api.softlayer.com)
• api-deprecated.service.softlayer.com (instead of api.service.softlayer.com)

These endpoints will become available on the transition date, and will continue to support TLS 1.0 and 1.1. You can change failing code or services to use these endpoints temporarily while you upgrade your systems to support TLS 1.2 or higher. These endpoints will only be available until March 30, 2018 to allow you to make this transition. You must upgrade all your systems and start using the standard API endpoints by March 1, 2018.

Why Are We Making This Change?
This is part of IBM’s commitment to offering a cloud that is secure to the core and in alignment with industry best practices for security and data privacy.

Regards,
Dixon Almeida

Cannot specify network speed

Using the -n option has no effect. If I provision with a public/private IP, both nics are 10MB/s If I provision with just a private IP, the nic is 100Mb/s. Both times I specified -n 1000.

Additionally, looking at the code, you never read the -n option. It's not part of the opts hash you build either.

Undefined local variable when using 'knife softlayer server create'

/home/selenium/.chefdk/gem/ruby/2.1.0/gems/fog-core-1.25.0/lib/fog/core/attributes.rb:159:in `requires_one': undefined local variable or method `missing' for #<Fog::Compute::Softlayer::Server:0x00000005e99d50> (NameError)
    from /home/selenium/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.29/lib/fog/softlayer/models/compute/server.rb:432:in `validate_attributes'
    from /home/selenium/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.29/lib/fog/softlayer/models/compute/server.rb:123:in `pre_save'
    from /home/selenium/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.29/lib/fog/softlayer/models/compute/server.rb:311:in `save'
    from /home/selenium/.chefdk/gem/ruby/2.1.0/gems/fog-core-1.25.0/lib/fog/core/collection.rb:50:in `create'
    from /home/selenium/.chefdk/gem/ruby/2.1.0/gems/knife-softlayer-0.3.12/lib/chef/knife/softlayer_server_create.rb:299:in `run'
    from /opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:422:in `block in run_with_pretty_exceptions'
    from /opt/chefdk/embedded/apps/chef/lib/chef/local_mode.rb:39:in `with_server_connectivity'
    from /opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:421:in `run_with_pretty_exceptions'
    from /opt/chefdk/embedded/apps/chef/lib/chef/knife.rb:214:in `run'
    from /opt/chefdk/embedded/apps/chef/lib/chef/application/knife.rb:142:in `run'
    from /opt/chefdk/embedded/apps/chef/bin/knife:25:in `<top (required)>'
    from /usr/bin/knife:51:in `load'
    from /usr/bin/knife:51:in `<main>'

gem list | egrep "softlayer|fog" shows:

chef-provisioning-fog (0.13.2)
fog (1.29.0)
fog-atmos (0.1.0)
fog-aws (0.1.2)
fog-brightbox (0.7.1)
fog-core (1.30.0, 1.25.0)
fog-ecloud (0.1.1)
fog-json (1.0.1)
fog-local (0.2.1)
fog-powerdns (0.1.1)
fog-profitbricks (0.0.2)
fog-radosgw (0.0.4)
fog-riakcs (0.1.0)
fog-sakuracloud (1.0.1)
fog-serverlove (0.1.2)
fog-softlayer (0.4.5, 0.3.29)
fog-storm_on_demand (0.1.1)
fog-terremark (0.1.0)
fog-vmfusion (0.1.0)
fog-voxel (0.1.0)
fog-xml (0.1.2)
knife-softlayer (0.3.12)

net-ssh-2.9.1 confict?

With the current version of the softlayer knife plugin I'm getting this bizarre error I've not seen in the past. I checked the version of net-ssh in my gems and I have 2.8.0 so not sure where the 2.9.1 conflict is coming from. Anyone have any ideas what to check?

$ knife softlayer server create --flavor medium --run-list 'recipe[wlp]' --hostname wlp-server --domain testdev.com
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate knife-softlayer-0.1.1, because net-ssh-2.9.1 conflicts with net-ssh (~> 2.8.0) (Gem::LoadError)

$ gem list net

*** LOCAL GEMS ***

net-scp (1.2.1)
net-ssh (2.8.0)
netrc (0.7.7)
signet (0.5.1)

ERROR: Excon::Error::BadRequest: Expected([200, 201]) <=> Actual(400 Bad Request)

Hi ! ,

I'm getting error while provisioning servers using Softlayer API.

ERROR: Excon::Error::BadRequest: Expected([200, 201]) <=> Actual(400 Bad Request)
excon.error.response
:body => "\n\n<title>400 Bad Request</title>\n\n

Bad Request

\n

Your browser sent a request that this server could not understand.
\n

\n

Additionally, a 400 Bad Request\nerror was encountered while trying to use an ErrorDocument to handle the request.

\n
\nApache Server at appdb.dal01.softlayer.local Port 443\n\n"
:cookies => [
]
:headers => {
"Connection" => "close"
"Content-Type" => "text/html; charset=iso-8859-1"
"Date" => "Mon, 10 Feb 2020 18:43:39 GMT"
"Server" => "Apache"
"Strict-Transport-Security" => "max-age=31536000"
"X-Frame-Options" => "SAMEORIGIN"
}
:host => "api.softlayer.com"
:local_address => "xxx.xxx.xxxx.xxx"
:local_port => xxxx
:path => "xxxx.json"
:port => xxx
:reason_phrase => "Bad Request"
:remote_ip => "xxx.xxx.xxx.xxx"
:status => 400
:status_line => "HTTP/1.1 400 Bad Request\r\n"

Anyone can help me please ? Thanks !

Unable to find Uplink Port Speeds at Mbps error while creating VM on the Softlayer

We are trying to create a new VM using knife softlayer server create command. In the command if we include "network-interface-speed" parameter then getting below error. If we don't include network-interface-speed parameter while submitting request then we are able to create instance successfully on the SoftLayer. We tried to set network-interface-speed parameter values to 10, 100, 1000, 10000 but observed same error for all the values.

ERROR: Excon::Error::InternalServerError: Expected([200, 201]) <=> Actual(500 InternalServerError)
excon.error.response
:body => "{"error":"Unable to find Uplink Port Speeds at Mbps.","code":"SoftLayer_Exception_NotFound"}"

Setup Versions details are as below:
OS: RHEL 7
Knife softlayer plugin version: 0.4.4
Chef version: 12.14.89

Please let me know if you need any other details.

Problem with the installation of knife softlayer

I have used gem install to install the knife softlayer. I have configured the knife.rb in .chef directory. However, when I execute "knife softlayer --help". I receive "FATAL: Cannot find sub command for: 'softlayer'". I have no idea what is going wrong.

Knife completely broken after installing

Team,

I have installed this in my High Sierra MacOs.
After running:

chef gem install knife-softlayer 

I found out that my knife stop working at all:

Traceback (most recent call last):
	16: from /usr/local/bin/knife:272:in `<main>'
	15: from /usr/local/bin/knife:272:in `load'
	14: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/bin/knife:25:in `<top (required)>'
	13: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/application/knife.rb:160:in `run'
	12: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife.rb:215:in `run'
	11: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife.rb:152:in `subcommand_class_from'
	10: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:109:in `command_class_from'
	 9: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:95:in `load_command'
	 8: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:85:in `load_commands'
	 7: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:85:in `each'
	 6: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:85:in `block in load_commands'
	 5: from /opt/chefdk/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/knife/core/subcommand_loader.rb:85:in `load'
	 4: from /Users/fico/.chefdk/gem/ruby/2.5.0/gems/knife-softlayer-0.4.7/lib/chef/knife/softlayer_key_pair_list.rb:8:in `<top (required)>'
	 3: from /opt/chefdk/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:39:in `require'
	 2: from /opt/chefdk/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
	 1: from /opt/chefdk/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:135:in `require'
/Users/user/.chefdk/gem/ruby/2.5.0/gems/knife-softlayer-0.4.7/lib/chef/knife/softlayer_base.rb:108:in `<top (required)>': OS is not a module (TypeError)
------------------------------------------------------------

Any idea on why?

~ » knife --version                                                                                                                                                                                                         
Chef: 14.2.0

Maybe something running around this? OS is not a module (TypeError)

How to specify bare metal?

Is it possible to request bare metal, and attached storage, with knife-softlayer? If so, can a full example be added to the examples/ directory? Thanks.

Inconsistent name for network interface speed.

The naming convention for network interface speed is inconsistent.

Command line argument: --network-interface-speed
JSON Content: "nic"

Example to create a Virtual Host with 1Gbps network ( examples extended from examples/server.md):

Command line: knife softlayer server create --image-id 23f7f05f-3657-4330-8772-329ed2e816bc --assign-global-ip 108.168.254.41 --ssh-keys 12345 23456 --hostname web --domain ibm.com --flavor m1.tiny --run-list 'recipe[redis],recipe[rbenv],recipe[apt]' -i /Users/user/.ssh/my_private_key_rsa --network-interface-speed 10000

JSON File:

{
  "hostname": "web",
  "domain": "ibm.com",
  "flavor": "m1.xlarge",
  "run-list": "recipe[redis],recipe[rbenv],recipe[apt]",
  "ssh-keys": "73148",
  "nic": "1000",
  "identity-file": "/Users/user/.ssh/my_softlayer_key_rsa",
  "image-id": "23f7f05f-3657-4330-8772-329ed2e816bc"
}

From lib/chef/knife/softlayer_server_create.rb

      option :nic,
        :long => '--network-interface-speed VALUE',
        :short => '-n VALUE',
        :description => 'The maximum speed of the public NIC available to the instance.',
        :default => 10

This either needs additional documentation for the parameter difference or pick a consistent name for both.

VLAN options causing exceptions

When specifying VLANs during knife softlayer server create the Fog::Service.validate_options method is returning an exception. Specifically the following,

ERROR: ArgumentError: Missing required arguments: softlayer_username, softlayer_api_key

It looks like this method is getting called twice (possibly for Network.new and Service.new although I'm not too familiar with Fog internals) and the requirements remain the same but the options hash is empty the second time around.

Using pry-stack_explorer I'm able to get the following:

Showing all accessible frames in stack (18 in total):
--
=> #0  validate_options <Fog::Service.validate_options(options)>
#1 [method]  handle_settings <Fog::Service.handle_settings(settings)>
#2 [method]  new <Fog::Service.new(config=?)>
#3 [method]  new <Fog::Network.new(attributes)>
#4 [method]  [] <Fog::Network.[](provider)>
#5 [method]  vlan= <Fog::Compute::Softlayer::Server#vlan=(value)>
#6 [block]   block in merge_attributes <Fog::Attributes::InstanceMethods#merge_attributes(new_attributes=?)>
#7 [method]  merge_attributes <Fog::Attributes::InstanceMethods#merge_attributes(new_attributes=?)>
#8 [method]  initialize <Fog::Model#initialize(new_attributes=?)>
#9 [method]  initialize <Fog::Compute::Softlayer::Server#initialize(attributes=?)>
#10 [method]  new <Fog::Collection#new(attributes=?)>
#11 [method]  create <Fog::Collection#create(attributes=?)>
#12 [method]  run <Chef::Knife::SoftlayerServerCreate#run()>
#13 [method]  run_with_pretty_exceptions      <Chef::Knife#run_with_pretty_exceptions(raise_exception=?)>
#14 [method]  run <Chef::Knife.run(args, options=?)>
#15 [method]  run <Chef::Application::Knife#run()>
#16 [top]     <top (required)>
#17 [main]    <main>

The code ultimately raising the exception can be found at https://github.com/fog/fog-core/blob/master/lib/fog/core/service.rb#L236-L253 but perhaps https://github.com/fog/fog-softlayer/blob/master/lib/fog/softlayer/models/compute/server.rb#L201-L207 is the real culprit? As I said I haven't much dug into Fog ever, so this was where I ended up.

If you need any more info, just let me know. This one is thorny!

server create timeout

This is my command:
knife softlayer server create
-H test -D sookka.co.il
--flavor m1.tiny
--os-code UBUNTU_14_64
--datacenter ams01
--node-name server1
--ssh-user ubuntu
--ssh-keys 713361
-i ~/.ssh/sl_rsa.pem
--new-global-ip v4
--config config.rb

This is my config.rb file

log_level :info
log_location STDOUT
client_key "#{current_dir}/keys/liora.pem"
chef_server_url "https://api.opscode.com/organizations/lmb"
cookbook_path ["#{current_dir}/chef-repo/cookbooks/"]
role_path ["#{current_dir}/chef-repo/roles/"]
node_name "liora"

knife[:softlayer_username] = ENV['SOFTLAYER_USERNAME']
knife[:softlayer_api_key] = ENV['SOFTLAYER_API_KEY']

The command timeouts after 600 seconds and the ssh command using the sl_rsa key is not working. It requires ubuntu's password.

What have I done wrong?

Wrong Status: Server is not running

This server is "Powered Off", not Running:

tiagocruz@stark:~$ knife softlayer server list
Name                 Location Public IP       Private IP      Status    
slteste1             wdc04    xxx.55.xxx.182  10.148.229.111  Running  

An hourly VSI is created instead of a Monthly server instance

An hourly VSI is created instead of a Monthly server instance with the following configuration:

knife softlayer server create --from-file configuration.json -E ??? -N ???

********* configuration.json **************
{
"hostname": "myhostname",
"domain": "???",
"fqdn": "???",
"datacenter": "dal06",
"ram": "32768",
"cores": "4",
"block-storage": "0:100,3:300",
"os-code": "CENTOS_6_64",
"run-list": "???",
"private-network-only": "true",
"network-interface-speed": "1000",
"bill-monthly": "true"
}

********* configuration.json **************

ssh error

hi team,
i have this issue when i create my machine, can someone help me please.
ERROR: ArgumentError: :key_data, :keys, :password or a loaded ssh-agent is required to initialize SSH

Failing `knife softlayer server create --hostname test --domain example.com --flavor tiny`

1st example in readme of this repo, to create a vm, is failing:


[user@system chef-repo]$ knife softlayer server create --hostname test --domain bluecloud.ibm.com --flavor tiny -VV
INFO: Using configuration from /home/user/code/chef-repo/.chef/knife.rb
Launching SoftLayer VM, this may take a few minutes.
/home/user/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.30/lib/fog/softlayer/models/compute/server.rb:418:in `extract_flavor': undefined method `cpu' for nil:NilClass (NoMethodError)
    from /home/user/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.30/lib/fog/softlayer/models/compute/server.rb:122:in `pre_save'
    from /home/user/.chefdk/gem/ruby/2.1.0/gems/fog-softlayer-0.3.30/lib/fog/softlayer/models/compute/server.rb:311:in `save'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/fog-core-1.32.1/lib/fog/core/collection.rb:51:in `create'
    from /home/user/.chefdk/gem/ruby/2.1.0/gems/knife-softlayer-0.4.0/lib/chef/knife/softlayer_server_create.rb:304:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:405:in `block in run_with_pretty_exceptions'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/local_mode.rb:44:in `with_server_connectivity'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:404:in `run_with_pretty_exceptions'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/knife.rb:203:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/knife.rb:142:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/knife:25:in `'
    from /usr/bin/knife:54:in `load'
    from /usr/bin/knife:54:in `'

Block Storage

Block Storage option won't get honored and the provisioned instance always ends up having 100GB root and 2G Swap.

knife softlayer server create --hostname XXXX --from-file XXXX.json --node-name XXXX --block-storage 0:25,2:100,5:100 --network-interface-speed 1000

knife softlayer server list

All of the other knife cloud plugins I'm aware of have a server list function to show what's currently running. It would be really nice is softlayer joined the cool kidz.

support for JSON attributes file (-j)

I can do a chef-client -j asdf.json and something similar with knife bootstrap. So I was expecting/hoping to be able to do this for knife softlayer, but it appears it's not supported.

I can work around this by just running a scp asdf.json $host; ssh $host client-client -j asdf.json but perhaps someone can add a -j param in knife softlayer.

Unmet requirements in ChefDK 2.3.4 under Ubuntu 16.04

The current version of the chef development kit (2.3.4) installs a much newer version of the chef gem (13.4.19) which lacks the following files required by your knife plugin:

/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/monkey_patches/net-ssh-multi.rb

/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/mixin/command.rb

I have been able to get the plugin running by removing the "requires" lines for the above files, but I do not know what functionality will break by having done so.

knife softlayer command throws ERROR: Excon::Error::Socket: Connection reset by peer (Errno::ECONNRESET)

Description

knife softlayer command throws ERROR: Excon::Error::Socket: Connection reset by peer (Errno::ECONNRESET)

Chef Version

Chef Server Version : chef-server 12.11.1

knife softlayer server create
--image-id ${image_id}
--ssh-keys ${ssh_keys}
--hostname $node_name
--network-interface-speed 100
--domain $domain_name
--cores ${cores}
--ram ${ram}
--datacenter ${datacenter}
--node-name $node_name
--vlan $public_vlan
--private-vlan $private_vlan
--use-private-network
-x root
-i $USER_HOME/.ssh/id_rsa

Client Output

Launching SoftLayer VM, this may take a few minutes.
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
............................................................................
..................

// After 6 minutes i get this error
ERROR: Excon::Error::Socket: Connection reset by peer (Errno::ECONNRESET)

gem install with knife 12.4

  • knife version
tiagocruz@stark:~$ knife -v
Chef: 12.4.1
  • NOK
tiagocruz@stark:~$ sudo gem install knife-softlayer
[sudo] password for tiagocruz: 
Fetching: builder-3.2.2.gem (100%)
Fetching: excon-0.45.4.gem (100%)
Fetching: formatador-0.2.5.gem (100%)
Fetching: fog-core-1.35.0.gem (100%)
Fetching: fog-json-1.0.2.gem (100%)
Fetching: fog-softlayer-0.3.30.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions.  This could take a while...
Fetching: gssapi-1.2.0.gem (100%)
Fetching: httpclient-2.7.0.1.gem (100%)
Fetching: rubyntlm-0.4.0.gem (100%)
Fetching: uuidtools-2.1.5.gem (100%)
Fetching: little-plugger-1.1.4.gem (100%)
Fetching: logging-2.0.0.gem (100%)
Fetching: nori-2.6.0.gem (100%)
Fetching: gyoku-1.3.1.gem (100%)
Fetching: winrm-1.4.0.gem (100%)
Fetching: winrm-s-0.3.2.gem (100%)
Fetching: knife-windows-1.1.2.gem (100%)
Fetching: net-ssh-3.0.2.gem (100%)
ERROR:  Error installing knife-softlayer:
    net-ssh requires Ruby version >= 2.0.
  • OK:
tiagocruz@stark:~$ chef gem install knife-softlayer
Fetching: fog-softlayer-0.3.30.gem (100%)
WARNING:  You don't have /home/tiagocruz/.chefdk/gem/ruby/2.1.0/bin in your PATH,
      gem executables will not run.
Successfully installed fog-softlayer-0.3.30
Fetching: knife-softlayer-0.4.0.gem (100%)
Successfully installed knife-softlayer-0.4.0
2 gems installed

Please update the README :)

"knife softlayer flavor list --all" only errors

/home/jesse/.rvm/gems/ruby-2.2.2/gems/fog-softlayer-0.3.30/lib/fog/softlayer/models/compute/tags.rb:24: warning: circular argument reference - filters

jesse@fuji-02 Sat Dec 19 19:22:04
~/ knife softlayer flavor list --all
ERROR: RuntimeError: can't modify frozen String
jesse@fuji-02 Sat Dec 19 19:23:21
~/

Any clue on how to get around this problem? :) Thanks.

Single tenant flag

Why was the --single-tenant flag removed? Can that be re-enabled? And if not, is there an alternative?
Thanks

Fog not picking up SoftLayer credentials

After upgrading from 0.1.3 to 0.3.2, I cannot use the plugin due to this error:
ERROR: ArgumentError: Missing required arguments: softlayer_username, softlayer_api_key

I have confirmed that my SL credentials are in the knife.rb used by knife, but this error still comes up. I assume this is related to the switch to Fog?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.