chef-partners/knife-oraclecloud

Name: knife-oraclecloud

Owner: Chef Partners

Description: Knife plugin for Oracle Cloud Infrastructure Classic

Created: 2015-10-02 20:41:19.0

Updated: 2018-05-01 17:56:24.0

Pushed: 2018-05-01 17:56:35.0

Homepage:

Size: 59

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

knife-oraclecloud

This is a Knife plugin that will allow you to interact with Oracle Cloud Infrastructure Classic. Please use knife-oci for the newer Oracle Cloud Infrastructure (aka 'OCI').

Installation

Add this line to your application's Gemfile:

'knife-oraclecloud'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install knife-oraclecloud

… or, even better, from within ChefDK:

$ chef gem install knife-oraclecloud
Configuration

In order to communicate with Oracle Cloud, you must specify your user credentials. You can specify them in your knife.rb:

e[:oraclecloud_username] = 'myuser'
e[:oraclecloud_password] = 'mypassword'
e[:oraclecloud_api_url]  = 'https://cloud.oracle.com'
e[:oraclecloud_domain]   = 'my_identity_domain'

… or you can supply them on the command-line:

e oraclecloud command --oraclecloud-username myuser ...
Using with a Oracle Cloud private cloud endpoint

If you are running a deployment of Oracle Cloud behind your firewall, you need to indicate that the API endpoint is a private cloud endpoint. This is required due to the differences in how the identity domain is used in their public cloud vs. their private cloud.

To indicate you are using a private cloud, set the following in your knife.rb:

e[:oraclecloud_private_cloud] = true

… or simply pass --oraclecloud-private-cloud on the CLI.

Usage
knife oraclecloud server create (options)

Creates a server (a.k.a. an “instance”) on Oracle Cloud and bootstraps it with Chef.

Common parameters to specify are:

While not required when using the Oracle Cloud UI, the API requires any instances that are created to be created via an “orchestration” which allows you to create a preconfigured set of machines and resources and start/stop them together. knife oraclecloud server create will create a single-instance orchestration in order to complete your request.

ife oraclecloud server create --image /oracle/public/oel_6.6_20GB_x11_RD --shape oc3 --hostname test123 --public-ip pool --ssh-user opc --sshkeys user@domain.io/mysshkey --identity-file /Users/user/.ssh/id_rsa
estration user@domain.io/test123 started - waiting for it to complete...

ent status: starting.............................................................................................
estration started successfully.
estration ID: user@domain.io/test123
ription: test123 by user@domain.io via Knife
us: ready
ance Count: 1

er Label: test123
us: running
name: dad634.compute-usoracle12345.oraclecloud.internal.
ddress: 10.106.13.22
ic IP Addresses: 1.2.3.4
e: /oracle/public/oel_6.6_20GB_x11_RD
e: oc3
estration: user@domain.io/test123
strapping the server by using bootstrap_protocol: ssh and image_os_type: linux

ing for sshd to host (1.2.3.4)...

knife oraclecloud server list

Lists all the servers currently configured in Oracle Cloud.

ife oraclecloud server list
name                                            Status        Shape  Image                               Instance ID                                                  Orchestration ID
6f.compute-usoracle12345.oraclecloud.internal.  initializing  oc3    /oracle/public/oel_6.4_5GB_RD       user@domain.io/ui1/0db7f5f2-7bdf-41a1-ba93-5710592c5bcf      none
34.compute-usoracle12345.oraclecloud.internal.  running       oc3    /oracle/public/oel_6.6_20GB_x11_RD  user@domain.io/test123/fd3af3da-d0be-4a06-a1f4-e452ab2fe7b4  user@domain.io/test123
knife oraclecloud server show INSTANCE_ID

Displays additional information about an individual server, such as its IP addresses.

ife oraclecloud server show user@domain.io/test123/fd3af3da-d0be-4a06-a1f4-e452ab2fe7b4
er Label: test123
us: running
name: dad634.compute-usoracle12345.oraclecloud.internal.
ddress: 10.106.13.22
ic IP Addresses: 1.2.3.4
e: /oracle/public/oel_6.6_20GB_x11_RD
e: oc3
estration: user@domain.io/test123
knife oraclecloud server delete INSTANCE_ID

Deletes a server/instance from Oracle Cloud. With this command, you can only delete instances that were not created by an orchestration. If you need to delete an instance created by an orchestration (such as one created via knife oraclecloud server create), use knife oraclecloud orchestration delete instead.

If you supply --purge, the server will also be removed from the Chef Server.

ife oraclecloud server delete user@domain.io/ui1/0db7f5f2-7bdf-41a1-ba93-5710592c5bcf
er Label: ui1
us: running
name: aef06f.compute-usoracle12345.oraclecloud.internal.
ddress: 10.106.13.46
ic IP Addresses: 1.2.3.4
e: /oracle/public/oel_6.4_5GB_RD
e: oc3
estration: none

ou really want to delete this server? (Y/N) Y
ting the instance...
te request complete.
knife oraclecloud orchestration list

Lists the currently-configured orchestrations.

ife oraclecloud orchestration list
estration ID        Description                          Status  Instance Count
@domain.io/test123  test123 by user@domain.io via Knife  ready   1
knife oraclecloud orchestration show

Shows details about the specified orchestration, as well as any instances created by that orchestration.

ife oraclecloud orchestration show user@domain.io/test123
estration Summary
estration ID: user@domain.io/test123
ription: test123 by user@domain.io via Knife
us: ready
ance Count: 1

ance user@domain.io/test123/fd3af3da-d0be-4a06-a1f4-e452ab2fe7b4
er Label: test123
us: running
name: dad634.compute-usoracle12345.oraclecloud.internal.
ddress: 10.106.13.22
ic IP Addresses: 1.2.3.4
e: /oracle/public/oel_6.6_20GB_x11_RD
e: oc3
estration: user@domain.io/test123
knife oraclecloud orchestration delete

Stops and deletes the specified orchestration and any instances created by that orchestration.

ife oraclecloud orchestration delete user@domain.io/test123
estration ID: user@domain.io/test123
ription: test123 by user@domain.io via Knife
us: ready
ance Count: 1

ou really want to delete this orchestration? (Y/N) Y
ping the orchestration and any instances...

ent status: ready.
ent status: stopping.......................
ting the orchestration and any instances...
te request complete.
knife oraclecloud image list

Lists all the images available in the public catalog.

ife oraclecloud image list
e Name                          Description
cle/public/oel_6.4_20GB_x11_RD  OEL 6.4 20 GB image
cle/public/oel_6.4_5GB_RD       OEL 6.4 5 GB image
cle/public/oel_6.6_20GB_x11_RD  OEL 6.6 20 GB image
knife oraclecloud shape list

Lists all the shapes (i.e. flavors, sizes) of instances available to you.

ife oraclecloud shape list
e Name  CPUs  RAM     I/O
        2.0   15360   200
        4.0   30720   400
        2.0   7680    200
        8.0   61440   600
        4.0   15360   400
        16.0  122880  800
        8.0   30720   600
        32.0  245760  1000
        16.0  61440   800
        32.0  122880  1000
License and Authors

Author:: Chef Partner Engineering (partnereng@chef.io)

Copyright:: Copyright (c) 2015 Chef Software, Inc.

License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributing

We'd love to hear from you if you find this isn't working for you. Please submit a GitHub issue with any problems you encounter.

Additionally, contributions are welcome! If you'd like to send up any fixes or changes:

  1. Fork it ( https://github.com/chef-partners/knife-oraclecloud/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.