This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cloudbaseinit-doc [2014/08/12 17:13] lcaplea |
cloudbaseinit-doc [2014/08/19 20:45] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
[] - these are my comments | [] - these are my comments | ||
+ | < | ||
- | Short description: | + | # |
- | Given the increasing demand in automated configurations for | + | |
- | | + | |
- | guests, the open source, Apache 2 licensed project called cloudbase-init | + | |
- | has been set out to do just that. Hence, following the | + | |
- | logical thread | + | |
- | configurations for various Linux distributions, | + | |
- | release helps configure Windows instances. | + | |
- | What can it do? <=> Capabilities | + | ##Short description: |
+ | Given the increasing demand in automated configurations for virtual instances at an early initialization for Windows guests, the open source, Apache 2 licensed project called cloudbase-init has been set out to do just that. Hence, following the logical thread of the cloud-init project, which enables configurations for various Linux distributions, | ||
+ | |||
+ | ##What can it do? <=> Capabilities | ||
The primary capabilities of the package consist of: | The primary capabilities of the package consist of: | ||
- | -creating a user | + | |
- | -enabling password injection | + | * creating a user |
- | -configuring static network | + | |
- | -setting up a hostname | + | * enabling password injection |
- | -attaching public keys to the users for their connection to the server; | + | |
- | the path at which they are found: C: | + | * configuring static network |
- | -execution of User Data scripts either from the setup[but how can you | + | |
+ | * setting up a hostname | ||
+ | |||
+ | * attaching public keys to the users for their connection to the server; the path at which they are found: | ||
+ | |||
+ | ``` | ||
+ | C: | ||
+ | ``` | ||
+ | * execution of User Data scripts either from the setup[but how can you | ||
do that from the setup?] or [?maybe] in the command line, or through a | do that from the setup?] or [?maybe] in the command line, or through a | ||
file path specified in the metadata service[ ? or provider]. | file path specified in the metadata service[ ? or provider]. | ||
- | Which Windows distros can support it? <=> Availability | + | ##Which Windows distros can support it? <=> Availability |
- | So far, the Windows distributions that can support its installation | + | So far, the Windows distributions that can support its installation are: |
- | | + | |
- | | + | * Windows Server 2003 |
- | The addresses at which you can get your hand on the installer are: | + | |
- | | + | * Windows Server |
- | x64 version or | + | |
- | | + | * Windows |
- | for the x86 version . | + | |
- | We have available a Windows Server 2012 R2 image on which cloudbase-init | + | * Windows Server 2008 R2 |
- | is pre-installed. This image can be obtained at this address | + | |
- | | + | |
- | and, after accepting the Microsoft Licence Agreement, one can download | + | |
- | the .iso file and the instance is good to boot . In our case, it is meant | + | * Windows 7 |
- | to work as a hypervisor machine, having HyperV or KVM installed. | + | |
+ | * Windows 8. | ||
- | Formats: | + | The addresses at which you can acquire |
- | | + | |
- | of these formats, as seen in the userdataplugins directory. | + | |
- | Note: there are a few formats | + | |
- | [?just yet? or this: given the fact that Heat can provide configurations or? | + | |
- | file/command execution based on these types, there is no need for | + | |
- | their implementation anymore]: cloudboothook, | + | |
- | + | ||
- | -Gzip Compressed File | + | |
- | The userdata content is provided in gzip compression format. | + | |
- | The given file will be uncompressed | + | |
- | configuration process. [in the cloud-init we have this as well | + | |
- | " | + | |
- | ~16384 [1] bytes." Is this true for all userdata? | + | |
- | [-Mime multi-part archive -> translated | + | ## |
+ | The user data provided with the metadata service should be written in one of these formats, | ||
+ | *Note:* there are a few formats which do not have an implementation [?just yet? or this: given the fact that Heat can provide configurations or? file/ | ||
| | ||
- | | + | ###Gzip Compressed File |
+ | The userdata content is provided in gzip compression format. The given file will be uncompressed and used afterwards in the configuration process. | ||
| | ||
- | -Part Handler File | + | ###Part Handler File |
- | The part-handler is provided as a mime type " | + | The part-handler is provided as a mime type " |
- | | + | [apparently, |
- | | + | |
- | | + | |
- | | + | |
- | handled parts for each type returned from the list_types() | + | |
- | [each type is a mime]. | + | |
- | [apparently, | + | |
- | | + | |
| | ||
- | -Shell Script File | + | ###Shell Script File |
- | Generally used for execution of shell scripts. A temporary file | + | Generally used for execution of shell scripts. A temporary file is created and loaded with the user-data, then it is executed and, finally, is erased from the temp directory. |
- | | + | |
- | | + | |
| | ||
- | -Heat File | + | ###Heat File |
- | Saves heat configurations in the " | + | Saves heat configurations in the " |
- | | + | |
| | ||
- | ?Directory layout | + | ##Directory layout |
- | + | The default installation path for the cloudbase-init files is < | |
- | ./cludbaseinit | + | |
- | Folder where the cloudbase-init subfolders are located. | + | The code which is executed when running the cloudbase-init.exe is placed in the following hierarchy: |
- | [Where should it be situated? Program Files?]. Also, init.py | + | |
- | | + | ####./cloudbaseinit |
+ | Folder where the cloudbase-init subfolders are located. Also, init.py is the file containing the main method, configure_host(). | ||
| | ||
- | ./ | + | ####./ |
- | In this folder are the available services for reading metadata | + | In this folder are the available services for reading metadata from various providers: HTTP, ConfigDrive, |
- | | + | [Guess specifying what they' |
- | [Guess specifying what they' | + | Among the information provided are the host name, network configuration, |
- | | + | |
- | Among the information provided are the host name, network configuration, | + | |
- | | + | |
- | | + | |
- | ./ | + | ####./ |
- | Here we can find the utils that deal with the specifics for remote | + | Here we can find the utils that deal with the specifics for remote data transmission, |
- | | + | |
- | | + | |
- | | + | |
- | ./ | + | ####./ |
- | System-specific functions can be found in this directory. It aids | + | System-specific functions can be found in this directory. It aids service enabligs/ disablings, user login, network communication and driver type for proper installations. |
- | | + | |
- | | + | |
- | ./ | + | ####./ |
- | Here are the tools for accessing OS details, such as physical or | + | Here are the tools for accessing OS details, such as physical or virtual disk properties, APIs for crypting and IP rendition [should use other word], network configuration and remote access to resources. The operating system interfaces viewed are POSIX and Windows. |
- | | + | |
- | | + | |
- | | + | |
- | ./ | + | ####./ |
- | [Here I think I'll explain the plugins individually.... except | + | This directory holds the plugins for custom configurations; |
- | userdataplugins and userdata] | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | ####User Creation Plugin |
- | exist and attaches a temporary password to the user | + | Creates |
- | | + | ####Volume Extension Plugin |
- | need extending and interogates | + | Gets the list of volumes which need extending and interrogates |
- | | + | |
- | through a comma separated list of volume indexes, e.g.: " | + | |
- | | + | ####File Execution Plugin |
- | according to its type | + | Executes |
- | | + | ####Licensing Plugin |
+ | Plugin that activates Windows automatically | ||
- | | + | ####Local Script Execution Plugin |
+ | These scripts are taken from the config file, placed in a separate folder and executed once the plugin is invoked. | ||
- | | + | ####Maximum Transmission Unit Plugin |
+ | Helps configure the network interfaces MTU base on the values provided from the DHCP server. | ||
- | | + | ####Network Configuration Plugin |
+ | Configures | ||
- | | + | ####Network Time Protocol Client Plugin |
+ | Helps configure the NTP client time synchronization using the NTP servers provided via DHCP | ||
- | | + | ####Host Name Setting Plugin |
+ | Takes the hostname from the metadata and truncates it if the string is larger than 15 characters for Netbios compatibility | ||
- | | + | ####Password Setting Plugin |
+ | Sets the password provided in the configuration. If False or no password is provided a random one will be chosen. | ||
- | | + | ####SSH Public Key Setting Plugin |
+ | Sets a user's public key if specified in the metadata | ||
- | | + | ####User Data Plugin |
+ | Here the userdata | ||
- | | + | ####User Data Script Execution |
+ | Executes | ||
- | | + | ####WinRM Certificate |
+ | Plugin which sets the WinRM certificate mapping for the specified user | ||
- | winrmlistener.py - enables | + | ####WinRM Listener Plugin |
+ | Enables | ||
- | ./ | + | ##Datasources: |
- | + | The use of the two datasource types: metadata and userdata is virtual machine configuration. The metadata is used to set the host name, password and configure the network adapters whereas the userdata consists of user defined scripts which are specified for execution at the cloudbase-init installation.These scripts may contain regular shell commands, package installation and other custom executions, unrelated to the raw operating system specifications met with[another verb] in the metadata. There are several ways in which you can access these datasources. In the metadata_factory.py file the services are verified consecutively and the first available service will be used to retrieve the metadata and the userdata as well. | |
- | + | ||
- | What is in the Cloud-Init Documentation: | + | |
- | Datasources (Metadata) | + | |
- | ?Merging (something with MIME) | + | |
- | + | ||
- | Datasources: | + | |
- | The use of the two datasource types: metadata and userdata is virtual | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
| | ||
- | | + | The services which cloudbase-init can support are, in the order in which they are accessed: |
- | | + | |
| | ||
- | HTTP Service: | + | ###Config Drive Service: |
- | This service provides a set of config files which can be accessed by the | + | [here I have used some sentences from the config-drive |
- | newly created instance by typing in the special IP: 169.254.169.254. At this address one can find information regarding the versions provided for the instance: | + | As its name suggests, the Config Drive enables the configuration of a newly created instance at boot time. Its purpose is to retrieve metadata without a network connection being required, but by simply mounting the disk onto the operating system and reading the available information. The operating system [Windows distribution] must support mounting of an ISO9660 or VFAT file system. [as a side note, all Windows distributions, |
- | [show content] | + | [maybe too obvious]Should cloudbase-init not be installed after the VM has been created, there is an alternative for its automatic configuration through Config Drive by setting the --config-drive=true parameter when executing nova boot; additional arguments may be files from where to retrieve [copy-paste] user-data, metadata or key/value metadata pairs. |
- | + | The config drive will contain several files with the userdata and metadata in JSON format. There may be more versions of these datasources therefore it is advised that the latest supported version by date be accessed first and afterwards, should it fail, try out an earlier version. | |
- | Also, one can retrieve the metadata by accessing the following address from inside the instance' | + | |
- | http:// | + | |
- | [show content] | + | |
- | + | ||
- | In case there is userdata provided, it can be accessed at this URL e.g.: http:// | + | |
- | [show content] | + | |
- | + | ||
- | + | ||
- | EC2 Service: | + | |
- | in the password] | + | |
- | The way in which the metadata is accessed through EC2 does not differ much | + | |
- | from HTTP. The datasources are retrieved by accessing the same IP, | + | |
- | 169.254.169.254 and using the same addresses for accessing the metadata, | + | |
- | userdata and latest versions. There might be slight differences in the | + | |
- | information the metadata provides. | + | |
- | + | ||
- | | + | |
- | + | ||
- | [here I have used some sentences from the config-drive | + | |
- | As its name suggests, the Config Drive enables the configuration of a newly created instance at boot time. Its purpose is to retrieve metadata without a network connection being required, but by simply mounting the disk onto the operating system and reading the available information. The operating system [Windows distribution] must support mounting of an ISO9660 or VFAT file system. [as a side note, all Windows distributions, | + | |
- | [maybe too obvious]Should cloudbase-init not be installed after the VM has been created, there is an alternative for its automatic configuration through Config Drive by setting the --config-drive=true parameter when executing nova boot; additional arguments may be files from where to retrieve [copy-paste] user-data, metadata or key/value metadata pairs. | + | |
- | The config drive will contain several files with the userdata and metadata in JSON format. There may be more versions of these datasources therefore it is advised that the latest supported version by date be accessed first and afterwards, should it fail, try out an earlier version. | + | |
[? should I provide a list with what a config drive contains? e.g.: | [? should I provide a list with what a config drive contains? e.g.: | ||
ec2/ | ec2/ | ||
Line 215: | Line 156: | ||
openstack/ | openstack/ | ||
] | ] | ||
+ | | ||
+ | ###HTTP Service: | ||
+ | This service provides a set of config files which can be accessed by the newly created instance by typing in the special IP: 169.254.169.254. At this address one can find information regarding the versions provided for the instance: [show content] | ||
+ | Also, one can retrieve the metadata by accessing the following address from inside the instance' | ||
+ | [http:// | ||
+ | In case there is userdata provided, it can be accessed at this URL e.g.: [http:// | ||
- | Cloudbase-init | + | |
+ | ###EC2 Service: | ||
+ | The way in which the metadata is accessed through EC2 does not differ much from HTTP. The datasources are retrieved by accessing the same IP, 169.254.169.254 and using the same addresses for accessing the metadata, | ||
+ | userdata and latest versions. There might be slight differences in the information the metadata provides. | ||
+ | |||
+ | ###MaaS Service: | ||
+ | The API for the MaaS service resembles that of EC2 and HTTP by having in the main folder the versions list which can be further accessed to display the metadata fields. The difference between the methods is the accessed IP address; while EC2 and HTTP use a static IP for providing the metadata, MaaS sets its location during the installation | ||
| | ||
- | Once the desired installer version has been downloaded the Cloudbase-Init Setup can commence. [add picture here] | + | ##Cloudbase-init installation process |
| | ||
- | | + | Once the desired installer version has been downloaded the Cloudbase-Init Setup can commence. [add picture here] |
+ | |||
+ | Inside the configuration options one can specify the Username, the default being Admin, a comma separated | ||
+ | At the end of the setup a new service will appear called "Cloud Initialization Service" | ||
+ | To let the virtual machine know that it must not execute the plugins at reboot, the service saves a value [gen_state=7 -> Sysprep Completed] in the Windows Registry Editor after Sysprep Completion at this registry key: | ||
+ | | ||
+ | for an x32 version or at | ||
+ | | ||
+ | for the x64 version | ||
+ | Hence, to execute the configuration scripts once more this key should be deleted and the service restarted or machine rebooted. | ||
+ | |||
+ | One can also install the .msi file in unattended mode by executing the following command: | ||
+ | ``` | ||
+ | msiexec /i CloudbaseInitSetup.msi /qn /l*v log.txt | ||
+ | ``` | ||
+ | adding a log file to show that the installation went well. | ||
+ | There is also the possibility to specify the network adapter to be configured: | ||
+ | |||
+ | ``` | ||
+ | msiexec /i CloudbaseInitSetup.msi /qn /l*v log.txt NETWORKADAPTERNAME=" | ||
+ | ``` | ||
+ | |||
+ | </ |