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

Node registration failing when using other users except for root #1650

Open
nathanielkeeler opened this issue Nov 26, 2024 · 2 comments
Open
Labels
kind/bug Something isn't working

Comments

@nathanielkeeler
Copy link

nathanielkeeler commented Nov 26, 2024

Hello everyone,

What steps did you take and what happened:
When adding mulitple users, or when replacing the root user with another user in the machine registrating config, the nodes using the ISO cannot register to rancher properly.
After the ISO is installed and the machine reboots, the following occurs:

stat /etc/rancher/elemental/agent/config.yaml: no such file or directory
Bildschirmfoto vom 2024-11-26 09-09-30

In Rancher the registered machine is in an unavailable state:
Bildschirmfoto vom 2024-11-26 09-18-26

Failing Machine Registration config when replacing root with another user:

config:
  cloud-config:
    users:
      - name: example
        lock_passwd: true
        groups: sudo
        shell: /bin/bash
        sudo: ALL=(ALL) NOPASSWD:ALL
        ssh_authorized_keys:
            - "ssh-rsa AAAAB...== abc"
            - "ssh-rsa AAAAB...== xyz"
            - "ssh-rsa AAAAB...== efg"
  elemental:
      install:
        debug: true
        device: /dev/sda
        reboot: true
        snapshotter:
          type: btrfs
      registration:
        auth: mac
      reset:
        debug: true
        enabled: true
        reboot: true
        reset-oem: true
        reset-persistent: true

Failing Machine Registration Config with multiple users:

config:
  cloud-config:
    users:
      - name: root
        passwd: root
      - name: example
        lock_passwd: true
        groups: sudo
        shell: /bin/bash
        sudo: ALL=(ALL) NOPASSWD:ALL
        ssh_authorized_keys:
            - "ssh-rsa AAAAB...== abc"
            - "ssh-rsa AAAAB...== xyz"
            - "ssh-rsa AAAAB...== efg"
  elemental:
      install:
        ...

Failing Machine Registration Config with multiple users (basic):

config:
  cloud-config:
    users:
      - name: root
        passwd: root
      - name: example
        passwd: example
  elemental:
      install:
        ...

Working Machine Registration Config with adding the ssh-keys to the root user:

config:
  cloud-config:
    users:
      - name: root
        lock_passwd: true
        shell: /bin/bash
        ssh_authorized_keys:
            - "ssh-rsa AAAAB...== abc"
            - "ssh-rsa AAAAB...== xyz"
            - "ssh-rsa AAAAB...== efg"
  elemental:
      install:
        ...

What did you expect to happen:
The nodes setup with additional users instead of only the root user.

Environment:

  • Elemental release version (use cat /etc/os-release):
    Elemental Version: 1.6.5
NAME="SL-Micro"
VERSION="6.0"
VERSION_ID="6.0"
PRETTY_NAME="SUSE Linux Micro 6.0"
ID="sl-micro"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sl-micro:6.0"
HOME_URL="https://www.suse.com/products/micro/"
DOCUMENTATION_URL="https://documentation.suse.com/sl-micro/6.0/"
IMAGE_REPO="registry.suse.com/suse/sl-micro/6.0/baremetal-os-container"
IMAGE_TAG="2.1.3-4.7"
IMAGE="registry.suse.com/suse/sl-micro/6.0/baremetal-os-container:2.1.3-4.7"
TIMESTAMP=20241107104849
GRUB_ENTRY_NAME="SUSE Linux Micro"
  • Rancher version: 2.9.2
  • Kubernetes version (use kubectl version): on cluster: v1.30.4+rke2r1
  • Cloud provider or hardware configuration: VMWare vSphere, Node VM CPU: 2 Cores, RAM: 4GB, Disk: 30GB
@max06
Copy link

max06 commented Jan 11, 2025

I did actually see the same issue 2 days ago. But it also happened when I simply used a different root password.

However... I can't reproduce it anymore. (Haven't tested adding more users though)

@anmazzotti
Copy link
Contributor

anmazzotti commented Jan 14, 2025

@nathanielkeeler hi there, I tried to reproduce your issue but unsuccessfully.

I used elemental-operator v1.6.5 for all tests.
With Rancher v2.8.2 + Elemental UI extension v1.3.0 and v1.3.1
Also against Rancher v2.10.1 + Elemental UI v3.0.0

SeedImage: registry.suse.com/suse/sl-micro/6.0/baremetal-iso-image:2.1.3-4.7 (latest on the baremetal channel)
Creating a new registration from the UI with the following config:

config:
  cloud-config:
    users:
    - name: root
      passwd: root
    - name: example
      passwd: example
  elemental:
    install:
      reboot: false
      device: /dev/vda

I did not encounter any installation issue with it, I'm able to login with the second user, and the machine looks to be initialized correctly, elemental-system-agent included.

If you can reproduce again it would be helpful to collect the installation logs on the machine (elemental-register-install.service), and also the elemental-operator logs.

@kkaempf kkaempf added the kind/bug Something isn't working label Jan 14, 2025
@kkaempf kkaempf moved this to 💡 Backlog in Elemental Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: 💡 Backlog
Development

No branches or pull requests

4 participants