Skip to content

Commit

Permalink
fix: 🐛 Update preseed and cloud-init to use CD for boot files
Browse files Browse the repository at this point in the history
  • Loading branch information
sriramandev committed Jul 30, 2024
1 parent c4218bf commit e49a35f
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 16 deletions.
8 changes: 5 additions & 3 deletions images/capi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
wget \
qemu-system-x86 \
qemu-kvm \
&& useradd -ms /bin/bash imagebuilder \
&& apt-get purge --auto-remove -y \
&& rm -rf /var/lib/apt/lists/*
# Adding xorriso to create iso for mounting cd_drives which then can be used for bootstrapping node image
xorriso \
&& useradd -ms /bin/bash imagebuilder \
&& apt-get purge --auto-remove -y \
&& rm -rf /var/lib/apt/lists/*

ARG ARCH
ARG PASSED_IB_VERSION
Expand Down
4 changes: 4 additions & 0 deletions images/capi/packer/ova/packer-node.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@
"{{user `boot_command_suffix`}}"
],
"boot_wait": "{{user `boot_wait`}}",
"cd_files": "{{user `cd_content_location`}}",
"cd_label": "{{user `cd_label`}}",
"cdrom_type": "{{user `cdrom_type`}}",
"cluster": "{{user `cluster`}}",
"communicator": "ssh",
Expand Down Expand Up @@ -469,6 +471,8 @@
"block_nouveau_loading": "true",
"build_timestamp": "{{timestamp}}",
"build_version": "{{user `build_name`}}-kube-{{user `kubernetes_semver`}}",
"cd_files": "{{user `cd_content_location`}}",
"cd_label": "{{user `cd_label`}}",
"cdrom_adapter_type": "ide",
"cdrom_type": "ide",
"cluster": "",
Expand Down
6 changes: 4 additions & 2 deletions images/capi/packer/ova/photon-5.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"boot_command_prefix": "<esc><wait> vmlinuz initrd=initrd.img root/dev/ram0 loglevel=3 photon.media=cdrom ks=",
"boot_command_suffix": "/5/ks.json insecure_installation=1<enter><wait>",
"boot_media_path": "http://{{ .HTTPIP }}:{{ .HTTPPort }}",
"boot_command_suffix": " insecure_installation=1<enter><wait>",
"boot_media_path": "/dev/sr1:/5/ks.json",
"build_name": "photon-5",
"cd_content_location": "./packer/ova/linux/{{user `distro_name`}}/http/*",
"cd_label": "cidata",
"cdrom_type": "sata",
"distro_arch": "amd64",
"distro_name": "photon",
Expand Down
6 changes: 4 additions & 2 deletions images/capi/packer/ova/ubuntu-2204-efi.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/22.04.efi/'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud;'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_disable_ipv6": "0",
"boot_media_path": "/media/HTTP",
"build_name": "ubuntu-2204-efi",
"cd_content_location": "./packer/ova/linux/{{user `distro_name`}}/http/{{user `distro_version`}}/*",
"cd_label": "cidata",
"distro_arch": "amd64",
"distro_name": "ubuntu",
"distro_version": "22.04",
"firmware": "efi",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"floppy_dirs": "",
"guest_os_type": "ubuntu-64",
"iso_checksum": "45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2",
"iso_checksum_type": "sha256",
Expand Down
7 changes: 4 additions & 3 deletions images/capi/packer/ova/ubuntu-2204.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/22.04/'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud;'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter><wait300>",
"boot_disable_ipv6": "0",
"boot_media_path": "/media/HTTP",
"build_name": "ubuntu-2204",
"cd_content_location": "./packer/ova/linux/{{user `distro_name`}}/http/{{user `distro_version`}}/*",
"cd_label": "cidata",
"distro_arch": "amd64",
"distro_name": "ubuntu",
"distro_version": "22.04",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"floppy_dirs": "",
"guest_os_type": "ubuntu-64",
"iso_checksum": "45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2",
"iso_checksum_type": "sha256",
Expand Down
7 changes: 4 additions & 3 deletions images/capi/packer/ova/ubuntu-2404-efi.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/24.04.efi/'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud;'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_disable_ipv6": "0",
"boot_media_path": "/media/HTTP",
"build_name": "ubuntu-2404-efi",
"cd_content_location": "./packer/ova/linux/{{user `distro_name`}}/http/{{user `distro_version`}}/*",
"cd_label": "cidata",
"distro_arch": "amd64",
"distro_name": "ubuntu",
"distro_version": "24.04",
"firmware": "efi",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"floppy_dirs": "",
"guest_os_type": "ubuntu-64",
"iso_checksum": "8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3",
"iso_checksum_type": "sha256",
Expand Down
7 changes: 4 additions & 3 deletions images/capi/packer/ova/ubuntu-2404.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/24.04/'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_command_prefix": "c<wait>linux /casper/vmlinuz ipv6.disable={{ user `boot_disable_ipv6` }} --- autoinstall ds='nocloud;'<enter><wait>initrd /casper/initrd<enter><wait>boot<enter>",
"boot_disable_ipv6": "0",
"boot_media_path": "/media/HTTP",
"build_name": "ubuntu-2404",
"cd_content_location": "./packer/ova/linux/{{user `distro_name`}}/http/{{user `distro_version`}}/*",
"cd_label": "cidata",
"distro_arch": "amd64",
"distro_name": "ubuntu",
"distro_version": "24.04",
"floppy_dirs": "./packer/ova/linux/{{user `distro_name`}}/http/",
"floppy_dirs": "",
"guest_os_type": "ubuntu-64",
"iso_checksum": "8762f7e74e4d64d72fceb5f70682e6b069932deedb4949c6975d0f0fe0a91be3",
"iso_checksum_type": "sha256",
Expand Down
3 changes: 3 additions & 0 deletions images/capi/scripts/ci-ova.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export GOVC_DATACENTER="SDDC-Datacenter"
export GOVC_CLUSTER="Cluster-1"
export GOVC_INSECURE=true

# Install xorriso which will be then used by packer to generate ISO for generating CD files
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y xorriso

# Run the vpn client in container
docker run --rm -d --name vpn -v "${HOME}/.openvpn/:${HOME}/.openvpn/" \
-w "${HOME}/.openvpn/" --cap-add=NET_ADMIN --net=host --device=/dev/net/tun \
Expand Down

0 comments on commit e49a35f

Please sign in to comment.