public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC installer 0/6] add automated installation
Date: Tue,  5 Sep 2023 15:28:26 +0200	[thread overview]
Message-ID: <20230905132832.3179097-1-a.lauterer@proxmox.com> (raw)

This is the first iteration of making it possible to automatically run
the installer.

The main idea is to provide an answer file (TOML as of now) that
provides the properties usually queried by the TUI or GUI installer.
Additionally we want to be able to do some more fuzzy matching for the
NIC and disks used by the installer.

Therefore we have some basic globbing/wildcard support at the start and
end of the search string. For now the UDEV device properties are used to
for this matching. The format for the filters are "UDEV KEY -> search
string".

The answer file and auto installer have the additional option to run
commands pre- and post-installation. More details can be found in the
patch itself.

The big question is how we actually get the answer file without creating
a custom installer image per answer file.
The most basic variant is to scan local storage for a partition/volume
with an expected label, mount it and look for the expected file.
For this I added a small shell script that does exactly this and then
starts the auto installer.

Another idea is to get an URL and query it
* could come from a default subdomain that is queried within the DHCP
  provided search domain
* We could get it from a DHCP option. How we extract that is something I
  don't know at this time.
* From the kernel cmdline, if the installer is booted via PXE with
  customized kernel parameters
* ...

When running the http request, we could add identifying properties as
parameters. Properties like MAC addresses and serial numbers, for
example. This would make it possible to have a script querying an
internal database and create the answer file on demand.

This version definitely has some rough edges and probably a lot of
things that could be done nicer, more idiomatic. There are quite a few
nested for loops that could probably be done better/nicer as well.

A lot of code has been reused from the TUI installer. The plan is to
factor out common code into a new library crate.

For now, the auto installer just prints everything to stdout. We could
implement a simple GUI that shows a progress bar.


pve-install: Aaron Lauterer (5):
  low level: sys: fetch udev properties
  add proxmox-auto-installer
  add answer file fetch script
  makefile: fix handling of multiple usr_bin files
  makefile: add auto installer

 Cargo.toml                                    |   1 +
 Makefile                                      |   8 +-
 Proxmox/Makefile                              |   1 +
 Proxmox/Sys/Udev.pm                           |  54 +++
 proxmox-auto-installer/Cargo.toml             |  13 +
 proxmox-auto-installer/answer.toml            |  36 ++
 .../resources/test/iso-info.json              |   1 +
 .../resources/test/locales.json               |   1 +
 .../test/parse_answer/disk_match.json         |  28 ++
 .../test/parse_answer/disk_match.toml         |  14 +
 .../test/parse_answer/disk_match_all.json     |  25 +
 .../test/parse_answer/disk_match_all.toml     |  16 +
 .../test/parse_answer/disk_match_any.json     |  32 ++
 .../test/parse_answer/disk_match_any.toml     |  16 +
 .../resources/test/parse_answer/minimal.json  |  17 +
 .../resources/test/parse_answer/minimal.toml  |  14 +
 .../test/parse_answer/nic_matching.json       |  17 +
 .../test/parse_answer/nic_matching.toml       |  19 +
 .../resources/test/parse_answer/readme        |   4 +
 .../test/parse_answer/specific_nic.json       |  17 +
 .../test/parse_answer/specific_nic.toml       |  19 +
 .../resources/test/parse_answer/zfs.json      |  26 +
 .../resources/test/parse_answer/zfs.toml      |  19 +
 .../resources/test/run-env-info.json          |   1 +
 .../resources/test/run-env-udev.json          |   1 +
 proxmox-auto-installer/src/answer.rs          | 144 ++++++
 proxmox-auto-installer/src/main.rs            | 412 ++++++++++++++++
 proxmox-auto-installer/src/tui/mod.rs         |   3 +
 proxmox-auto-installer/src/tui/options.rs     | 302 ++++++++++++
 proxmox-auto-installer/src/tui/setup.rs       | 447 ++++++++++++++++++
 proxmox-auto-installer/src/tui/utils.rs       | 268 +++++++++++
 proxmox-auto-installer/src/udevinfo.rs        |   9 +
 proxmox-auto-installer/src/utils.rs           | 325 +++++++++++++
 proxmox-low-level-installer                   |  14 +
 start_autoinstall.sh                          |  50 ++
 35 files changed, 2372 insertions(+), 2 deletions(-)
 create mode 100644 Proxmox/Sys/Udev.pm
 create mode 100644 proxmox-auto-installer/Cargo.toml
 create mode 100644 proxmox-auto-installer/answer.toml
 create mode 100644 proxmox-auto-installer/resources/test/iso-info.json
 create mode 100644 proxmox-auto-installer/resources/test/locales.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match_all.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match_all.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match_any.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/disk_match_any.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/minimal.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/minimal.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/nic_matching.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/nic_matching.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/readme
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/specific_nic.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/specific_nic.toml
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/zfs.json
 create mode 100644 proxmox-auto-installer/resources/test/parse_answer/zfs.toml
 create mode 100644 proxmox-auto-installer/resources/test/run-env-info.json
 create mode 100644 proxmox-auto-installer/resources/test/run-env-udev.json
 create mode 100644 proxmox-auto-installer/src/answer.rs
 create mode 100644 proxmox-auto-installer/src/main.rs
 create mode 100644 proxmox-auto-installer/src/tui/mod.rs
 create mode 100644 proxmox-auto-installer/src/tui/options.rs
 create mode 100644 proxmox-auto-installer/src/tui/setup.rs
 create mode 100644 proxmox-auto-installer/src/tui/utils.rs
 create mode 100644 proxmox-auto-installer/src/udevinfo.rs
 create mode 100644 proxmox-auto-installer/src/utils.rs
 create mode 100755 start_autoinstall.sh


pve-docs: Aaron Lauterer (1):
  installation: add unattended documentation

 pve-installation.adoc | 245 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 245 insertions(+)

-- 
2.39.2





             reply	other threads:[~2023-09-05 13:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-05 13:28 Aaron Lauterer [this message]
2023-09-05 13:28 ` [pve-devel] [RFC installer 1/6] low level: sys: fetch udev properties Aaron Lauterer
2023-09-05 13:28 ` [pve-devel] [RFC installer 2/6] add proxmox-auto-installer Aaron Lauterer
2023-09-21 11:16   ` Christoph Heiss
2023-09-21 11:30     ` Thomas Lamprecht
2023-09-21 11:39       ` Christoph Heiss
2023-09-05 13:28 ` [pve-devel] [RFC installer 3/6] add answer file fetch script Aaron Lauterer
2023-09-20  9:52   ` Christoph Heiss
2023-09-05 13:28 ` [pve-devel] [PATCH installer 4/6] makefile: fix handling of multiple usr_bin files Aaron Lauterer
2023-09-05 13:28 ` [pve-devel] [RFC installer 5/6] makefile: add auto installer Aaron Lauterer
2023-09-05 13:28 ` [pve-devel] [RFC docs 6/6] installation: add unattended documentation Aaron Lauterer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230905132832.3179097-1-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal