Cross-platform instance initialization
Go to file
Claudiu Popa b10917f9b0 Add a new cloud-config plugin for setting the timezone
cloud-config supports a new plugin, called 'set-timezone', which
can be used to change the timezone on the underlying instance.
The patch adds a new method in the osutils abstraction, called `set_timezone`,
which should be implemented  by each separated OS. The abstraction calls
into cloudbaseinit.utils.windows.timezone, another layer of abstraction
over two API methods, SetTimeZoneInformation for Windows 2003 and older
and SetDynamicTimeZoneInformation, for newer versions of Windows,
which also handles Daylight Saving Time.
The plugin supports standard IANA timezone names, which are then translated
to the Windows-specific timezone names, using tzlocal library.

Change-Id: I18674e1ae078fc69f3fb938065ba01a4de5464a1
2015-03-25 13:01:12 +02:00
cloudbaseinit Add a new cloud-config plugin for setting the timezone 2015-03-25 13:01:12 +02: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 Fixes README RST markup 2015-01-09 16:35:30 +02: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 Replace the oauth library with oauthlib 2015-03-06 16:50:14 +02:00
setup.cfg Bumps version to 0.9.8 2014-12-24 15:06:31 +01:00
setup.py Global mass refactor 2015-01-18 17:51:56 +02: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_Beta_x64.msi https://www.cloudbase.it/downloads/CloudbaseInitSetup_Beta_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.windows.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.windows.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.windows.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.windows.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.windows.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.windows.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.windows.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.windows.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

Note: currently only local file creation is supported.

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