Cross-platform instance initialization
Go to file
Cosmin Poieana a2d07e1478 Fix improper EOL handling between the public keys
Every metadata service should return public keys as lists of
space-stripped strings without counting on the existence of
the current present (or not) new lines. The sshpublickeys plugin
will explicitly add EOLs between the keys, therefore having a
valid authorized_keys file when multiple ssh keys are retrieved.

Change-Id: Idad2b9d469a544066ab4090c30dd3f274e36844e
2015-06-03 02:16:43 +03:00
cloudbaseinit Fix improper EOL handling between the public keys 2015-06-03 02:16:43 +03:00
doc/source Fixes requirements on Linux 2014-10-05 22:20:58 +03:00
.gitattributes Normalize line endings 2014-02-09 21:41:45 +02:00
.gitignore Ignore PyCharm settings/data 2015-03-06 16:00:23 +02:00
.gitreview Adds .gireview file 2014-10-05 22:45:08 +03:00
.testr.conf Fixes requirements on Linux 2014-10-05 22:20:58 +03:00
LICENSE Adds LICENSE file 2013-10-04 00:07:58 +03:00
README.rst Updates binaries location in README.rst 2015-05-14 20:34:11 +03:00
openstack-common.conf Updates oslo-incubator files to the current master 2014-02-10 05:41:31 +02:00
requirements-windows.txt Add a new cloud-config plugin for setting the timezone 2015-03-25 13:01:12 +02:00
requirements.txt Get rid of flake8 compatibility issues due to pbr 2015-05-26 17:22:15 +03:00
setup.cfg Fixes wrong Classifier License in setup.cfg 2015-05-11 12:52:15 +00:00
setup.py Get rid of flake8 compatibility issues due to pbr 2015-05-26 17:22:15 +03:00
test-requirements.txt Fixes requirements on Linux 2014-10-05 22:20:58 +03:00
tox.ini Adds tox.ini 2014-09-10 12:57:37 +03:00

README.rst

Portable OpenStack Cloud Initialization Service

The main goal of this project is to provide guest cloud initialization for Windows and other operating systems.

The architecture of the project is highly flexible and allows extensions for additional clouds and plugins.

There's no limitation in the type of supported Hypervisor. This service can be used on instances running on Hyper-V, KVM, Xen, ESXi, etc

Documentation, support and contacts: http://www.cloudbase.it

Binaries

The following x64 and x86 builds are automatically generated by a Jenkins job at every commit:

https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi https://www.cloudbase.it/downloads/CloudbaseInitSetup_x86.msi

Metadata services

A metadata service has the role of pulling the metadata configuration information.

Supported clouds and metadata services:

  • OpenStack (HTTP)
  • OpenStack (ConfigDrive)
  • Amazon EC2
  • CloudStack
  • OpenNebula
  • Ubuntu MAAS

Plugins

Plugins execute actions based on the metadata obtained by the service.

cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin

Sets the instance's hostname.

cloudbaseinit.plugins.windows.createuser.CreateUserPlugin

Creates a local cloud user (if it does not already exist) and adds it to a set of provided local groups.

The following configuration parameters control the behaviour of this plugin.

Option Description Default
username Name of the cloud user Admin
groups Comma separated list of groups Administrators

cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin

Sets the cloud user's password. If a password has been provided in the metadata during boot (user_data) it will be used, otherwise a random password will be generated, encrypted with the user's SSH public key and posted to the metadata provider (currently supported only by the OpenStack HTTP metadata provider).

Option Description Default
inject_user_password Can be set to false to avoid the injection of the password provided in the metadata True

cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin

Configures static networking.

Option Description Default
network_adapter Network adapter to configure None

If network_adapter is not specified, the first available ethernet adapter will be chosen if it cannot be matched with the configuration provided in the metadata.

cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin

Creates an "authorized_keys" file in the user's home directory containing the SSH keys provided in the metadata. It is needed by the cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin plugin.

cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin

Extends automatically a disk partition to it's maximum size. This is useful when booting images with different flavors.

cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin

Configures a WinRM HTTPS listener to allow remote management via WinRS or PowerShell.

cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin

Enables password-less authentication for remote management via WinRS or PowerShell. See: http://www.cloudbase.it/windows-without-passwords-in-openstack/

cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin

Executes any script (e.g. Powershell, CMD, etc) located in the following path.

Option Description Default
local_scripts_path Local scripts path None

cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin

Activates the Windows instance if the following option is True.

Option Description Default
activate_windows Activate Windows False

cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin

Applies NTP client info based on the DHCP server options, if available.

Option Description Default
ntp_use_dhcp_config Set NTP from DHCP False

cloudbaseinit.plugins.common.mtu.MTUPlugin

Sets the network interfaces MTU based on the value provided by the DHCP server options, if available.

This is particularly useful for cases in which a lower MTU value is required for networking (e.g. OpenStack GRE Neutron Open vSwitch configurations).

Option Description Default
mtu_use_dhcp_config Set MTU from DHCP True

cloudbaseinit.plugins.common.userdata.UserDataPlugin

Executes custom scripts provided with the user_data metadata as plain text or compressed with Gzip.

Supported formats:

Windows batch

The file is executed in a cmd.exe shell (can be changed with the COMSPEC environment variable). The user_data first line must be:

rem cmd

PowerShell

The user_data first line must be:

#ps1_sysnative

or for a x86 PowerShell execution:

#ps1_x86

Bash

A bash shell needs to be installed in the system and available in the PATH in order to use this feature. The user_data first line must start with:

#!

e.g.:

#!/bin/bash

cloud-config

Cloud-config YAML configuration as supported by cloud-init, excluding Linux specific content. The user_data first line must be:

#cloud-config

The following cloud-config directives are supported:

  • write_files

    Defines a set of files which will be created on the local filesystem. It can be a list of items or only one item, with the following attributes:

    • path

      Absolute path on disk where the content should be written

    • content

      The content which will be written in the given file

    • permissions

      Integer representing file permissions

    • encoding

      The encoding of the data in content. Supported encodings are: b64, base64 for base64-encoded content, gz, gzip for gzip encoded content, gz+b64, gz+base64, gzip+b64, gzip+base64 for base64 encoded gzip content.

    Examples:

    # One item
    write_files:
       encoding: b64
       content: NDI=
       path: C:\test
       permissions: '0o466'
    
    # Multiple items
    write_files:
       -   encoding: b64
           content: NDI=
           path: C:\b64
           permissions: '0644'
       -   encoding: base64
           content: NDI=
           path: C:\b64_1
           permissions: '0644'
       -   encoding: gzip
           content: !!binary |
               H4sIAGUfoFQC/zMxAgCIsCQyAgAAAA==
           path: C:\gzip
           permissions: '0644'
  • set_timezone

    Change the underlying timezone.

    Example:

    set_timezone: Asia/Tbilisi

Multi-part userdata content

MIME multi-part userdata is supported. The content will ne handled based on the content type.

text/x-shellscript

Any script to be executed: PowerShell, CMD, Bash or Python.

text/part-handler

A script that can manage other content type parts. This is used in particular by Heat / CFN templates, although Linux specific.

text/x-cfninitdata

Heat / CFN content. Written to the path provided by:

Option Description Default
heat_config_dir Heat configuration path C:\cfn

Example Heat Windows templates: https://github.com/openstack/heat-templates/tree/master/hot/Windows