siderolabs / talos

Talos Linux is a modern Linux distribution built for Kubernetes.
https://www.talos.dev
Mozilla Public License 2.0
6.45k stars 514 forks source link

install disk for nocloud image not working with diskSelector #8216

Open ryjogo opened 7 months ago

ryjogo commented 7 months ago

Bug Report

Description

When setting: machine.install.disk: "/dev/sdb" doesn't seem to select the disk. After talking with @andrewrynhard we tried the diskSelector, to which this still did not work.

The disk (32GB) is a fresh, attached disk.

Logs

install.diskSelector is set to >= 20GB - it should select the 32GB disk.

➜  ~ talosctl -n 10.0.30.214 --talosconfig talosconfig get mc -oyaml | grep install -A3
        install:
            diskSelector:
                size: '>= 20GB'
            wipe: false

Yet the installation disk is set to /sda which is 17GB

➜  ~ talosctl -n 10.0.30.214 --talosconfig talosconfig disks
NODE          DEV        MODEL           SERIAL   TYPE   UUID   WWID   MODALIAS      NAME   SIZE    BUS_PATH                                                      SUBSYSTEM          READ_ONLY   SYSTEM_DISK
10.0.30.214   /dev/sda   QEMU HARDDISK   -        HDD    -      -      scsi:t-0x00   -      17 GB   /pci0000:00/0000:00:05.0/virtio1/host2/target2:0:0/2:0:0:0/   /sys/class/block               *
10.0.30.214   /dev/sdb   QEMU HARDDISK   -        HDD    -      -      scsi:t-0x00   -      34 GB   /pci0000:00/0000:00:05.0/virtio1/host2/target2:0:0/2:0:0:1/   /sys/class/block

I have tried removing the 17GB disk, to ensure that the 32GB disk doesn't have the installation, and boot fails - thus its not installed on the 32GB disk.

Environment

smira commented 7 months ago

If you're using a disk image, Talos is already installed, so machine.install is ignored.

It's counter-intuitive, and might change in Talos 1.7.

ryjogo commented 7 months ago

Ah! OK so that explains it.. Just to clarify..

/dev/sda is the nocloud image that i have created with packer - i boot and install from /sda with the intention of /sdb being my installation disk, and /sda being my installation medium.

So, talos thinks it is already installed, thus ignores the install settings?

smira commented 7 months ago

yes, you don't need to install if using a disk image - just write the disk image where you want Talos to run.

andrewrynhard commented 7 months ago

Ah! OK so that explains it.. Just to clarify..

/dev/sda is the nocloud image that i have created with packer - i boot and install from /sda with the intention of /sdb being my installation disk, and /sda being my installation medium.

So, talos thinks it is already installed, thus ignores the install settings?

Whoops. I missed this! As mentioned in Slack, the install section is skipped if Talos is already installed. The nocloud image is "already installed to."