Skip to content
amnonh edited this page May 8, 2014 · 37 revisions

OSv System Init

A host perform a few tasks when booting. The tasks falls into the following categories:

  1. Network configuration - static/dhcp, dns etc.
  2. Environment variable
  3. File and directory handling - directory creation and file deletion.
  4. Running the application - Running the actual application with their command line arguments

System init stages

After the system is loaded, the following stages are done before running the application:

  1. Reading the local init file
  2. Optionally, downloading a remote cloud init file
  3. Start the API for external usage
  4. Run the applications

OSV Init

The OSV init responsible for the init tasks on the system boot. It reads the init file and starts additional applications.

It also responsible for opening the API for external usage.

The OSv Init uses the API for most of its operations, it does not rely on TCP to connect to it, but would use a mediator class for direct calls.

When the OSv Init execute a configuration file, it can be mark as 'once' meaning that if the same file was executed before, the command will be ignored.

Init file

The init file is a Yaml formatted file with instruction to the the OSv Init. Among the command in the file could be read a remote init file, which is a command to OSv Init itself.

Cloud init

Cloud init is a file that can be downloaded from a designated IP address. Cloud init in general can support multiple formats. OSv-Init will support Yaml format.

Configuration example

The configuration file is mostly API calls and some additional command to the OSv Init itself. The file is in a Yaml format, and the commands are performed sequential

# This is an example for a configuration file
# create a log directory
- API
    command: PUT
    url: /file/usr/log
    parameters:
        op: MKDIRS
        permission: 0777

- API
    command: PUT
    url: /env/path
    parameters:
        value: usr/local/bin
#fetch remote file from predetermine address
- include
    host: 192.168.1.1
    url: /remote_file.yaml
    once: True

#open httpserver for input
- run-API

#sleep
- sleep
   milliseconds: 100

#run an application
- API
  command: PUT
  url: /app/java.so
  parameters:
      params: -jar myjar.jar
Clone this wiki locally