vmware / vmware/photon

`public_key` and `network` in kickstart do not work when install photon os with ostree

Open
#1,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
3.2k
Forks
692
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I tried to use photon-4.0-c001795b8.iso to install a photon OS with default RPM-OSTree server. And I configured network manually like below.

static_network

As a result, it didn't work! The IP address of interface eth0 was not as expect.

Futhermore, I used kickstart to auto-install photon OS with default RPM-OSTree repo, and I filled the fields public_key and network in the kickstart configuration file like below.

{
"hostname": "photon-machine",
"password":
{
"crypted": false,
"text": "password"
},
"disk": "/dev/vda",
"partitions": [
{"mountpoint": "/", "size": 0, "filesystem": "ext4"},
{"mountpoint": "/boot", "size": 128, "filesystem": "ext4"},
{"mountpoint": "/root", "size": 128, "filesystem": "ext4"}
],
"postinstall": [
"#!/bin/sh",
"echo "Hello World" > /etc/postinstall"
],
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4nlcKKj9xqs...",
"network":
{
"type": "static",
"ip_addr": "192.168.122.3",
"netmask": "255.255.255.0",
"gateway": "192.168.122.1",
"nameserver": "192.168.122.1"
},
"linux_flavor": "linux",
"photon_docker_image": "photon:3.0",
"photon_release_version": "4.0",
"ostree":
{
"default_repo": true
}
}

As a result, the static IP address was still not configured! And the file ~/.ssh/authorized_keys was empty.

BTW, the network and public_key worked as expect in kickstart when I didn't use ostree.

Reproduction steps
1.Use kickstart config above to build an ISO image as https://vmware.github.io/photon/docs/user-guide/working-with-kickstart/#unattended-installation-through-kickstart guide. 
2.Use the ISO to install photon OS.
3.In photon OS, check IP address of interface eth0, and the file /root/.ssh/authorized_keys
...
Expected behavior
  1. The IP address of interface eth0 is 192.168.122.3/24, and the network configuration file /etc/systemd/network/99-dhcp-en.network is set correctly.
  2. The publick key is added to the file /root/.ssh/authorized_keys .
Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the kickstart configuration and the unattended-installation guide, then reproduce the RPM-OSTree installation. Check how the install handles the network settings and public_key, using /etc/systemd/network/99-dhcp-en.network and /root/.ssh/authorized_keys as verification points. Done means the static eth0 address and expected network file are present and the public key is installed.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.