Skip to content

Commit

Permalink
Add scsi controller and write docs
Browse files Browse the repository at this point in the history
mcbenjemaa committed Oct 23, 2024
1 parent 3f082a2 commit 78fc974
Showing 4 changed files with 36 additions and 48 deletions.

This file was deleted.

32 changes: 32 additions & 0 deletions images/capi/packer/proxmox/README.md
Original file line number Diff line number Diff line change
@@ -3,3 +3,35 @@ To build an image using a specific version of Kubernetes use the "PACKER_FLAGS"
```
PACKER_FLAGS="--var 'kubernetes_rpm_version=1.28.3' --var 'kubernetes_semver=v1.28.3' --var 'kubernetes_series=v1.28' --var 'kubernetes_deb_version=1.28.3-1.1'" make build-proxmox-ubuntu-2204
```

#### Flatcar for Proxmox

Currently, Proxmox doesn't support ignition and it's currently in-development.
* https://github.com/coreos/fedora-coreos-tracker/issues/1652
* https://github.com/flatcar/scripts/pull/1783

But we do a trick to make it working on Proxmox, until the support is already released.

We use OEM_ID `nutanix` which is an openstack provider that loads ignition from device with label `config-2`:
https://github.com/coreos/ignition/blob/main/internal/providers/nutanix/nutanix.go#L51

Therefore, we build an image with `OEM_ID=nutanix` so that we can provide an ISO that contain the ignition file in `/openstack/latest/user_data`
https://github.com/coreos/ignition/blob/main/internal/providers/nutanix/nutanix.go#L40C29-L40C56

**To build a Proxmox template for flatcar**

```shell
export PROXMOX_URL="https://example.net:8006/api2/json"
export PROXMOX_USERNAME='root@pam!proxmox'
export PROXMOX_TOKEN="xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx"
export PROXMOX_NODE="pve1"
export PROXMOX_ISO_POOL="local"
export PROXMOX_BRIDGE="vmbr1"
export PROXMOX_STORAGE_POOL="ceph_pool"

## flatcar version
export FLATCAR_VERSION=4081.1.0
export FLATCAR_CHANNEL=beta

export OEM_ID=nutanix # make sure to choose OEM_ID=nutanix
```
2 changes: 1 addition & 1 deletion images/capi/packer/proxmox/flatcar.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ansible_extra_vars": "ansible_python_interpreter=/opt/bin/python oem_id={{user `oem_id`}}",
"boot_command_prefix": "sudo systemctl mask sshd.socket --now<enter><wait>curl -sLo /tmp/ignition.json ",
"boot_command_suffix": "/proxmox-bootstrap-pass-auth.json<enter>sed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.json<enter>sudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot<enter>",
"boot_command_suffix": "/bootstrap-pass-auth.json<enter>sed -i \"s|BUILDERPASSWORDHASH|$(mkpasswd -5 {{user `ssh_password`}})|\" /tmp/ignition.json<enter>sudo flatcar-install -d /dev/sda -C {{user `channel_name`}} -V {{user `release_version`}} -i /tmp/ignition.json && sudo reboot<enter>",
"boot_media_path": "http://{{ .HTTPIP }}:{{ .HTTPPort }}",
"boot_wait": "180s",
"build_name": "flatcar-{{env `FLATCAR_CHANNEL`}}-{{env `FLATCAR_VERSION`}}",
4 changes: 3 additions & 1 deletion images/capi/packer/proxmox/packer.json
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
"type": "scsi"
}
],
"scsi_controller": "{{user `scsi_controller`}}",
"http_directory": "{{user `http_directory`}}",
"insecure_skip_tls_verify": true,
"iso_checksum": "{{user `iso_checksum_type`}}:{{user `iso_checksum`}}",
@@ -205,6 +206,7 @@
"token": "{{env `PROXMOX_TOKEN`}}",
"username": "{{env `PROXMOX_USERNAME`}}",
"vlan_tag": "{{env `PROXMOX_VLAN`}}",
"vmid": ""
"vmid": "",
"scsi_controller": "virtio-scsi-pci"
}
}

0 comments on commit 78fc974

Please sign in to comment.