public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [RFC installer 0/6] add automated installation
@ 2023-09-05 13:28 Aaron Lauterer
  2023-09-05 13:28 ` [pve-devel] [RFC installer 1/6] low level: sys: fetch udev properties Aaron Lauterer
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Aaron Lauterer @ 2023-09-05 13:28 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-21 11:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-05 13:28 [pve-devel] [RFC installer 0/6] add automated installation Aaron Lauterer
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

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