Andrew Mercer

Resetting the root password

Method 1: Update /etc/cobbler/[ hostname ]

note: Applies to future instances

default_password_crypted: '$5..'

cobbler sync

Method 2: Update using cobbler cli

note: Applies to future instances

sudo cobbler-settings modify --key default_password_crypted --value '$5..'
cobbler sync

Method 3: Reset an existing instances root password

note: Applies to existing instances.

On cobbler

sudo cobbler system edit \
  --name=rocky9-vm01 \
  --kernel-options="console=tty0 console=ttyS0,115200 [ hostname ] enforcing=0"

sudo cobbler system edit \
  --name=rocky9-vm01 \
  --netboot-enabled=true

sudo cobbler sync

On the hypervisor

sudo virsh destroy rocky9-vm01
sudo virsh start rocky9-vm01
sudo virsh console rocky9-vm01 --devname serial0

Printing out the variables being loaded by a system

sudo python3 << 'EOF'
import [ hostname ]
s = [ hostname ]("http://[ ip_address ]:25151/")
t = [ hostname ]("cobbler", "cobbler")
vars = s.get_blended_data("", "rocky9-vm01")
for k, v in sorted([ hostname ]()):
    if any(x in [ hostname ]() for x in ['net', 'ip', 'mask', 'gate', 'name', 'intf', 'host', 'interface']):
        print(f"{k}: {v}")
EOF

Check the cobbler instance for PXE traffic

sudo tcpdump -i enp1s0 host [ ip_address ] -n

...
20:07:08.948846 IP [ hostname ] > [ hostname ]: BOOTP/DHCP, Reply, length 300
20:07:09.979245 IP [ hostname ] > [ hostname ]: BOOTP/DHCP, Reply, length 300
20:07:12.011396 IP [ hostname ] > [ hostname ]: BOOTP/DHCP, Reply, length 300
...
## curl: (23) Failure writing output to destination

curl: (23) Failure writing output to destination
dracut: FATAL: Failed to find a root filesystem in /tmp/curl_fetch_url1/[ hostname ]
No space left on device


sudo cobbler system edit \
--name=rocky9-vm01 \
--kernel-options="console=tty0 console=ttyS0,115200 [ hostname ]=https://[ hostname ]/pub/rocky/9/BaseOS/x86_64/os/ inst.stage2=https://[ hostname ]/pub/rocky/9/BaseOS/x86_64/os/ [ hostname ]=0 [ hostname ]"

sudo cobbler sync


sudo virsh setmaxmem rocky9-vm01 4194304 --config
sudo virsh setmem rocky9-vm01 4194304 --config
sudo virsh reboot rocky9-vm01

## DNS doesn't work

sudo cobbler system edit \
--name=rocky9-vm01 \
--kernel-options="console=tty0 console=ttyS0,115200 [ hostname ]=https://[ hostname ]/pub/rocky/9/BaseOS/x86_64/os/ inst.stage2=https://[ hostname ]/pub/rocky/9/BaseOS/x86_64/os/ [ hostname ]=0 [ hostname ]" nameserver=[ ip_address ]

sudo cobbler sync

## 500 errors

curl -v http://[ ip_address ]/cblr/svc/op/autoinstall/system/rocky9-vm01


cat /var/log/httpd/error_log


sudo chmod o+r /etc/cobbler/[ hostname ]
sudo systemctl restart httpd
curl -s http://[ ip_address ]/cblr/svc/op/autoinstall/system/rocky9-vm01 | head -20
```