Resetting the root password¶
Method 1: Update /etc/cobbler/settings.yaml¶
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 rd.break 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 xmlrpc.client
s = xmlrpc.client.ServerProxy("http://127.0.0.1:25151/")
t = s.login("cobbler", "cobbler")
vars = s.get_blended_data("", "rocky9-vm01")
for k, v in sorted(vars.items()):
if any(x in k.lower() 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 192.168.0.51 -n
...
20:07:08.948846 IP 192.168.0.12.bootps > 192.168.0.51.bootpc: BOOTP/DHCP, Reply, length 300
20:07:09.979245 IP 192.168.0.12.bootps > 192.168.0.51.bootpc: BOOTP/DHCP, Reply, length 300
20:07:12.011396 IP 192.168.0.12.bootps > 192.168.0.51.bootpc: 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/install.img
No space left on device
sudo cobbler system edit \
--name=rocky9-vm01 \
--kernel-options="console=tty0 console=ttyS0,115200 inst.repo=https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/ inst.stage2=https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/ rd.live.ram=0 inst.nompath"
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 inst.repo=https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/ inst.stage2=https://dl.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/ rd.live.ram=0 inst.nompath" nameserver=192.168.0.1
sudo cobbler sync
## 500 errors
curl -v http://192.168.0.12/cblr/svc/op/autoinstall/system/rocky9-vm01
cat /var/log/httpd/error_log
sudo chmod o+r /etc/cobbler/settings.yaml
sudo systemctl restart httpd
curl -s http://192.168.0.12/cblr/svc/op/autoinstall/system/rocky9-vm01 | head -20
```