This utility will be responsible for provisioning the system before boot. This includes partitioning disks, formatting partitions, and creating files. These features are discussed in more detail below.
The configuration for the utility will be provided by the user via a file on the system, a URI to a remote file via a kernel parameter, or via a provider- specific user data mechanism. To ease debugging, the configuration will be human readable. The configuration will require versioning in order to remain backward compatible. In the interest of explicitness, including the version in the configuration will be required.
This utility will evaluate the configuration on the first boot only. In addition to simplifying the mental model, this will make it clear to users that this can not be used for configuration management.
- create users
- name
- password hash
- ssh keys
- home directory
- groups
- system
- primary group
- no user group
- no create home
- GECOS
- no log init
- partition disks
- create LVM volumes
- create RAID volumes
- format partitions
- optionally force reformat
- write files to filesystems
- content
- owner
- permissions
- write unit files
- name
- mask
- enable
- content
- dropins
- name
- content
- write networkd files
- name
- content
Instance metadata (e.g. public and private addresses) will not be handled by this utility. Instead a service, required by a metadata target, will discover and expose the metadata during boot. Any service which requires that metadata (e.g. etcd and fleet) will use systemd to express the requirement on the metadata target. This will allow both the OS and the user to add services that provide and depend on the metadata target.
Here is an example of a metadata-requiring service:
[Unit]
Description=etcd
Requires=coreos-metadata.target
After=coreos-metadata.target
[Service]
User=etcd
PermissionsStartOnly=true
EnvironmentFile=/run/coreos/metadata
Environment=ETCD_DATA_DIR=/var/lib/etcd
Environment=ETCD_NAME=%m
ExecStart=/usr/bin/etcd \
--addr=${COREOS_IPV4_PUBLIC}:2379 \
--peer-addr=${COREOS_IPV4_PRIVATE}:2380
Restart=always
RestartSec=10s
LimitNOFILE=40000
Services providing metadata must install themselves with "RequiredBy" or "WantedBy" under "coreos-metadata.target". The service must append the provided environment variables to /run/coreos/metadata. On supported platforms (and if the metadata exists), the OS will provide the services to fetch the following environment variables:
- COREOS_IPV4_PUBLIC
- COREOS_IPV4_PRIVATE
- COREOS_IPV6_PUBLIC
- COREOS_IPV6_PRIVATE
- Mount the provisioning DVD
- Parse the CustomData from ovf-env.xml on the DVD
Functionality provided by wa-linux-agent. Requires python.
DHCP
Read from /dev/ttyS0
Read from /dev/ttyS0
Fetch from http:///latest/{public,local}-ipv4 Fetch from http:///latest/public-keys
Fetch from http:///latest/user-data
DHCP
Fetch from http://169.254.169.254/metadata/v1.json
Fetch from http://169.254.169.254/metadata/v1/user-data or use metadata
- Parse hostname, nameservers, and interfaces from metadata
- Use this information to write networkd units
Fetch from http://169.254.169.254/2009-04-04/meta-data
Fetch from http://169.254.169.254/2009-04-04/user-data
DHCP
Fetch from http:///latest/{public,local}-ipv4 Fetch from http:///latest/public-keys
Fetch from http:///latest/user-data
- DHCP
- ethtool -K eth0 tso off gso off
Fetch from http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip Fetch from http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/ip Fetch from http://169.254.169.254/computeMetadata/v1beta1/{project,instance}/attributes/sshKeys
Fetch from http://169.254.169.254/computeMetadata/v1/{project,instance}/attributes/user-data
Add "169.254.169.254 metadata" to /etc/hosts
N/A
N/A
DHCP
Read SSH keys via vmtoolsd
Read userdata via vmtoolsd
DHCP (DNS is hardcoded to google)
?
Read from /media/configdrive/openstack//meta_data.json
Read from /media/configdrive/openstack//user_data
- Read from /media/configdrive/openstack//vendor_data.json
- Parse hostname, nameservers, and interfaces from network_info
- Use this information to write networkd units
N/A
Read from /var/lib/coreos-vagrant/vagrantfile-user-data
DHCP
Read from /media/configdrive/openstack/latest/user_data
N/A
DHCP
Provided via the CPIO or as a URL to the boot parameters
N/A
DHCP
Provided via the CPIO or as a URL to the boot parameters
N/A
networkd units must be provided in the userdata
Read from /var/lib/coreos-install/user_data
N/A
DHCP or networkd units provided in the userdata