Coder Social home page Coder Social logo

addon-metadata's Introduction

addon-metadata - Metadata server for OpenNebula

DESCRIPTION

This addon is a metadata server, compatible with EC2, for the OpenNebula Cloud Toolkit. This allows any Openstack, Amazon AMIs or any cloud-init based image with OpenNebula, without any change. The images will be contextualized, and will process user-data with or without cloud-init. Also allows any script relying on Amazon Metadata to run inside OpenNebula, without change.

Example:

  1. Download CoreOS OpenStack image from the coreos site (https://stable.release.core-os.net/amd64-usr/current/coreos_production_openstack_image.img.bz2)
  2. Register coreos_production_openstack_image.img to OpenNebula
  3. Run the image with any user-data script supported by CoreOS
  4. The image will boot and be contextualized, without any change

Development

To contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.

More info:

Authors

Compatibility

This add-on is compatible with OpenNebula 3.8, 4.0, 4.2, 4.4, 4.12, 4.14. Tested extensively with 4.12 (EC2)

INSTALLATION

REQUISITES

OpenNebula Server installation is required.

INSTALLATION

The installation script assumes OpenNebula is installed system-wide. To install, run the following script:

$ ./install.sh

An init script is provided for Debian based distributions.

REDIRECT TO 169.254.169.254:80

To comply with EC2, the metadata server should be available from http://169.254.169.254:80. To enable this either:

  • Setup a redirect rule on the default gateway
  • Setup a redirect on each host, using iptables

REDIRECT ON DEFAULT GATEWAY

This is out of scope for this document

REDIRECT USING IPTABLES

The rp_filter must be disabled for each cloud interface/bridge. To do so, add a line to /etc/sysctl.conf for each interface:

net.ipv4.conf.<interface_name>.rp_filter = 0

If using bridges, the following line must also be added/modified:

net.bridge.bridge-nf-call-iptables = 1

On each host, run the following at startup (ex.: using rc.local):

iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination <metadata_server_ip>:<metadata_server_port>

CONTEXT

The metadata server was thought to work with instances launched by eucatools, hybridfox or econe-* , and assumes that you are using the standard /etc/one/ec2query_templates/*.erb . If a custom template is to be used, add the folowing context variables:

CONTEXT         = [
  (...)
    EC2_USER_DATA = <YOUR USER DATA>
    EC2_PUBLIC_KEY = <YOUR PUBLIC KEY>
    EC2_KEYNAME = <THE NAME OF THE KEY>
  ]

If there is the need to use other variables instead, just change them on /usr/lib/one/ruby/cloud/metadata/MetadataServer.rb. Search and replace with your own data:

  TEMPLATE/CONTEXT/EC2_KEYNAME
  TEMPLATE/CONTEXT/EC2_PUBLIC_KEY
  TEMPLATE/CONTEXT/EC2_USER_DATA

TEST

To test the metadata server, download and run the EC2 Instance Metadata Query Tool tool from inside an instance. The EC2 Instance Metadata Query Tool tool is available

http://aws.amazon.com/code/1825

CONTACT

Ricardo Duarte ([email protected])

COPYRIGHT

Copyright 2017, Ricardo Duarte ([email protected])

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 http://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.

addon-metadata's People

Contributors

ricardoteixeiraduarte avatar

Watchers

 avatar  avatar

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.