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

docker imager create custom talos image failed on ubuntu 20.04 #8814

Closed
rfakit opened this issue May 28, 2024 · 3 comments
Closed

docker imager create custom talos image failed on ubuntu 20.04 #8814

rfakit opened this issue May 28, 2024 · 3 comments

Comments

@rfakit
Copy link

rfakit commented May 28, 2024

imager will fail on error mounting "/dev/loop5p3" on Ubuntu 20.04

Description

I create an Azure pipeline to create a Talos custom image and push it to Vsphere. we have an Ubuntu 2004 agent runner. in the stage when it tries to build an image with docker imager on

docker run --rm -i \
                -v $config_dir:/secureboot:ro \
                -v $config_dir:/out \
                -v /dev:/dev \
                --privileged \
                "ghcr.io/siderolabs/imager:$talos_version_tag" - < "$config_dir/talos-$talos_version.yml"

does it use a special mount option that requires a new version of the kernel or packages??

Logs

1db96c80-11bc-497f-b5d8-7620d500c16d

error (1).txt

Environment

I have Ubuntu 20.04 with updated packages of "parted util-linux dosfstools xfsprogs kmod " kernel version Linux ubuntu20 5.4.0-169-generic.
it works on Ubuntu 22.04

  • Talos version: v1.7.1 and v1.7.2
@rfakit
Copy link
Author

rfakit commented May 28, 2024

this is my azure pipeline job

    jobs:
      - job: CreateCustomImageJob
        displayName: 'Build and Deploy Talos Image'
        steps:
          - checkout: none
          - script: |
              set -exuo pipefail

              export TF_VAR_vsphere_talos_template="talos-$(TALOS_VERSION)-template"
              export TF_VAR_vsphere_datastore="$(VSPHERE_DATASTORE)"
              export GOVC_INSECURE='1'
              export GOVC_URL="https://$(VSPHERE_SERVER)/sdk"
              export GOVC_USERNAME="$(VSPHERE_USERNAME)"
              export GOVC_PASSWORD="$(VSPHERE_PASSWORD)"
              export TF_VAR_vsphere_datacenter="$(VSPHERE_DATACENTER)"
              export talos_version=$(TALOS_VERSION)
              export talos_vmtoolsd_extension_version="0.5.0"
              export talos_drbd_extension_version="9.2.8"
              export talos_iscsi_extension_version="v0.1.4"
              export talos_util_linux_tools_extension_version="2.39.3"
              export talos_version_tag="v$talos_version"

              # Create Talos configuration
              config_dir="$PWD/tmp/talos"
              rm -rf $config_dir
              mkdir -p $config_dir

              cat << EOF > "$config_dir/talos-$talos_version.yml"
              arch: amd64
              platform: vmware
              secureboot: false
              version: $talos_version_tag
              customization:
                extraKernelArgs:
                  - net.ifnames=0
              input:
                kernel:
                  path: /usr/install/amd64/vmlinuz
                initramfs:
                  path: /usr/install/amd64/initramfs.xz
                baseInstaller:
                  imageRef: ghcr.io/siderolabs/installer:$talos_version_tag
                systemExtensions:
                  - imageRef: ghcr.io/siderolabs/util-linux-tools:$talos_util_linux_tools_extension_version
                  - imageRef: ghcr.io/siderolabs/iscsi-tools:$talos_iscsi_extension_version
                  - imageRef: ghcr.io/siderolabs/talos-vmtoolsd:$talos_vmtoolsd_extension_version
                  - imageRef: ghcr.io/siderolabs/drbd:$talos_drbd_extension_version-v$talos_version
              output:
                kind: image
                imageOptions:
                  diskSize: 2147483648
                  diskFormat: ova
                outFormat: raw
              EOF

              cat "$config_dir/talos-$talos_version.yml"
              lsb_release -a
              # Build Talos image
              docker run --rm -i \
                -v $config_dir:/secureboot:ro \
                -v $config_dir:/out \
                -v /dev:/dev \
                --privileged \
                "ghcr.io/siderolabs/imager:$talos_version_tag" - < "$config_dir/talos-$talos_version.yml"


              # Move and import Talos image to vSphere
              ova_path="$config_dir/talos-$talos_version-vmware-amd64.ova"
              mv $config_dir/vmware-amd64.ova $ova_path

              govc import.spec $ova_path \
                | jq --arg network "$VSPHERE_NETWORK" '.NetworkMapping[0].Network = $network' \
                > $config_dir/talos-$talos_version-vmware-amd64.ova.json

              govc import.ova \
                -ds $TF_VAR_vsphere_datastore \
                -folder "//$TF_VAR_vsphere_datacenter/vm/$(dirname $TF_VAR_vsphere_talos_template)" \
                -name "$(basename $TF_VAR_vsphere_talos_template)" \
                -options $config_dir/talos-$talos_version-vmware-amd64.ova.json \
                $ova_path

              # Configure and finalize Talos VM
              vm_ipath="//$TF_VAR_vsphere_datacenter/vm/$TF_VAR_vsphere_talos_template"
              govc vm.upgrade -vm.ipath "$vm_ipath"
              govc vm.change -vm.ipath "$vm_ipath" \
                -g other6xLinux64Guest \
                -e disk.enableUUID=TRUE
              govc device.boot -vm.ipath "$vm_ipath" \
                -firmware efi \
                -secure=false
              govc vm.info -vm.ipath "$vm_ipath" -json > $config_dir/talos-$talos_version-amd64.json
              govc vm.markastemplate -vm.ipath "$vm_ipath"

@rfakit
Copy link
Author

rfakit commented May 28, 2024

dmesg | grep loop

[12987550.077101] XFS (loop7p3): Superblock has unknown read-only compatible features (0x8) enabled.
[12987550.077223] XFS (loop7p3): Attempted to mount read-only compatible filesystem read-write.
[12987550.077224] XFS (loop7p3): Filesystem can only be safely mounted read only.
[12987550.077232] XFS (loop7p3): SB validate failed with error -22.

@smira
Copy link
Member

smira commented May 28, 2024

Looks like your Linux kernel on Ubuntu 20.04 is incompatible with the newer xfs options used by Talos, unfortunately we can't provide a workaround here. You need to use newer kernel release, or run in a VM which has newer kernel.

You can also use Image Factory.

@smira smira closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants