Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OEM: Provide Proxmox images #1783

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions build_library/vm_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ VALID_IMG_TYPES=(
openstack_mini
packet
parallels
proxmoxve
pxe
qemu_uefi
rackspace
Expand Down Expand Up @@ -57,6 +58,7 @@ VALID_OEM_PACKAGES=(
kubevirt
openstack
packet
proxmoxve
qemu
rackspace
rackspace-onmetal
Expand Down Expand Up @@ -332,6 +334,13 @@ IMG_akamai_OEM_PACKAGE=common-oem-files
IMG_akamai_OEM_USE=akamai
IMG_akamai_OEM_SYSEXT=oem-akamai

# proxmoxve
IMG_proxmoxve_DISK_FORMAT=qcow2
IMG_proxmoxve_DISK_LAYOUT=vm
IMG_proxmoxve_OEM_PACKAGE=common-oem-files
IMG_proxmoxve_OEM_USE=proxmoxve
IMG_proxmoxve_OEM_SYSEXT=oem-proxmoxve

###########################################################

# Print the default vm type for the specified board
Expand Down
1 change: 1 addition & 0 deletions changelog/changes/2024-10-24-proxmoxve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added Proxmox Virtual Environment images ([scripts#1783](https://github.com/flatcar/scripts/pull/1783))
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ConditionKernelCommandLine=|flatcar.oem.id=kubevirt

ConditionKernelCommandLine=|flatcar.oem.id=akamai

ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve

Description=Flatcar Metadata Agent

[Service]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ COMMON_OEMIDS=(
hetzner
openstack
packet
proxmoxve
qemu
scaleway
kubevirt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set linux_append="flatcar.autologin"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
</pkgmetadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="OEM suite for Proxmox VE"
HOMEPAGE="https://www.proxmox.com/en/proxmox-virtual-environment/"
SRC_URI=""

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm64"
IUSE=""

OEM_NAME="Proxmox VE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 67ac31d0fc9ed22d83f2fc5a6449c6e35a83a1df Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
Date: Fri, 22 Mar 2024 20:58:23 +0900
Subject: [PATCH] Draft for Proxmox support

This makes use of https://github.com/coreos/afterburn/pull/1023
to set up the ssh keys from the metadata.

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
---
systemd/system/sshkeys.service | 3 +++
1 file changed, 3 insertions(+)

diff --git a/systemd/system/sshkeys.service b/systemd/system/sshkeys.service
index 7727185..9edf5cc 100644
--- a/systemd/system/sshkeys.service
+++ b/systemd/system/sshkeys.service
@@ -30,6 +30,9 @@ ConditionKernelCommandLine=|flatcar.oem.id=hetzner
ConditionKernelCommandLine=|ignition.platform.id=akamai
ConditionKernelCommandLine=|flatcar.oem.id=akamai

+ConditionKernelCommandLine=|ignition.platform.id=proxmoxve
+ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve
+
[Service]
Type=oneshot
RemainAfterExit=yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 10357a387459fc16a381f70601c44313668076ed Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
Date: Fri, 22 Mar 2024 20:23:49 +0900
Subject: [PATCH] Draft for Proxmox support

This makes use of https://github.com/coreos/afterburn/pull/1023
to set up any static networking from the initrd (for Ignition) and the
hostname (early enough so that Ignition could overwrite it).
---
dracut/30ignition/flatcar-metadata-hostname.service | 2 ++
dracut/30ignition/ignition-generator | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/dracut/30ignition/flatcar-metadata-hostname.service b/dracut/30ignition/flatcar-metadata-hostname.service
index fc75732..323c62e 100644
--- a/dracut/30ignition/flatcar-metadata-hostname.service
+++ b/dracut/30ignition/flatcar-metadata-hostname.service
@@ -33,8 +33,10 @@ ConditionKernelCommandLine=|flatcar.oem.id=vultr
# Addition:
ConditionKernelCommandLine=|coreos.oem.id=packet
ConditionKernelCommandLine=|flatcar.oem.id=packet
+
ConditionKernelCommandLine=|flatcar.oem.id=hetzner
ConditionKernelCommandLine=|flatcar.oem.id=kubevirt
+ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve

OnFailure=emergency.target
OnFailureJobMode=isolate
diff --git a/dracut/30ignition/ignition-generator b/dracut/30ignition/ignition-generator
index 59bdf80..c015ff5 100755
--- a/dracut/30ignition/ignition-generator
+++ b/dracut/30ignition/ignition-generator
@@ -146,6 +146,6 @@ if [ "${nopxe}" = 1 ]; then
add_requires "disk-uuid.service" initrd.target
fi

-if [[ $(cmdline_arg flatcar.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg coreos.oem.id) == "digitalocean" ]]; then
+if [[ $(cmdline_arg flatcar.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg coreos.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg flatcar.oem.id) == "proxmoxve" ]]; then
add_requires flatcar-digitalocean-network.service initrd.target
fi