-
Notifications
You must be signed in to change notification settings - Fork 403
vm doesn't reboot if I set k3os.mode = install #82
Comments
Experiencing exactly the same bug with |
I've found the same bug under Proxmox, it stays powered off after install. Here is a corrupt state when I reboot the VM without detaching the ISO: $ sudo ls -la /var/lib/rancher/k3os/ssh
total 8
drwxr-xr-x 2 root root 1024 May 15 05:21 .
drwxr-xr-x 3 root root 1024 May 15 05:21 ..
-rw-r--r-- 1 root root 0 May 15 05:21 moduli
-rw-r--r-- 1 root root 0 May 15 05:21 ssh_config
-rw------- 1 root root 1381 May 15 05:21 ssh_host_dsa_key
-rw-r--r-- 1 root root 0 May 15 05:21 ssh_host_dsa_key.pub
-rw------- 1 root root 505 May 15 05:21 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 0 May 15 05:21 ssh_host_ecdsa_key.pub
-rw------- 1 root root 411 May 15 05:21 ssh_host_ed25519_key
-rw-r--r-- 1 root root 0 May 15 05:21 ssh_host_ed25519_key.pub
-rw------- 1 root root 1823 May 15 05:21 ssh_host_rsa_key
-rw-r--r-- 1 root root 0 May 15 05:21 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 0 May 15 05:21 sshd_config
$ sudo cat /var/log/messages
...
May 15 05:24:44 myk3osnode daemon.info /etc/init.d/k3s-service[2193]: Child command line: /sbin/k3s server
May 15 05:24:44 myk3osnode daemon.warn /etc/init.d/k3s-service[2072]: /sbin/k3s, pid 2193, exited with return code 1
May 15 05:24:45 myk3osnode auth.err sshd[2198]: error: Error loading host key "/etc/ssh/ssh_host_rsa_key": invalid format
May 15 05:24:45 myk3osnode auth.err sshd[2198]: error: Error loading host key "/etc/ssh/ssh_host_ecdsa_key": invalid format
May 15 05:24:45 myk3osnode auth.err sshd[2198]: error: Error loading host key "/etc/ssh/ssh_host_ed25519_key": invalid format
May 15 05:24:49 myk3osnode daemon.info /etc/init.d/k3s-service[2204]: Child command line: /sbin/k3s server
May 15 05:24:49 myk3osnode daemon.warn /etc/init.d/k3s-service[2072]: /sbin/k3s, pid 2204, exited with return code 1
May 15 05:24:54 myk3osnode daemon.info /etc/init.d/k3s-service[2210]: Child command line: /sbin/k3s server
May 15 05:24:54 myk3osnode daemon.warn /etc/init.d/k3s-service[2072]: /sbin/k3s, pid 2210, exited with return code 1
May 15 05:24:59 myk3osnode daemon.info /etc/init.d/k3s-service[2221]: Child command line: /sbin/k3s server
May 15 05:24:59 myk3osnode daemon.warn /etc/init.d/k3s-service[2072]: /sbin/k3s, pid 2221, exited with return code 1
... and these errors all over again ...
$ kubectl get pods
FATA[0000] exec format error
$ kubectl get nodes
FATA[0000] exec format error Here is when I first detach the ISO when the VM is in poweroff state right after the install, then boot for the first time: $ sudo ls -la /var/lib/rancher/k3os/ssh/
total 571
drwxr-xr-x 2 root root 1024 May 15 05:34 .
drwxr-xr-x 3 root root 1024 May 15 05:34 ..
-rw-r--r-- 1 root root 565252 May 15 05:34 moduli
-rw-r--r-- 1 root root 1495 May 15 05:34 ssh_config
-rw------- 1 root root 1381 May 15 05:34 ssh_host_dsa_key
-rw-r--r-- 1 root root 605 May 15 05:34 ssh_host_dsa_key.pub
-rw------- 1 root root 505 May 15 05:34 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 177 May 15 05:34 ssh_host_ecdsa_key.pub
-rw------- 1 root root 411 May 15 05:34 ssh_host_ed25519_key
-rw-r--r-- 1 root root 97 May 15 05:34 ssh_host_ed25519_key.pub
-rw------- 1 root root 1823 May 15 05:34 ssh_host_rsa_key
-rw-r--r-- 1 root root 397 May 15 05:34 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 3177 May 15 05:34 sshd_config So in this case, I'd prefer leaving the boot state in poweroff instead of an instant reboot. |
I ran into this as well. The problem is that I've attached a PR to fix this. This is actually a pretty big problem for certain use cases. For instance, I automate the creation of VMs using Terraform and it expects that any newly-created VM will get an IP address eventually. Obviously this can't happen if the VM is powered down after installation; it has to be rebooted. |
Fix #82: honor k3os.install.power_off when k3os.mode=install.
Version - v0.2.0
Steps:
Result: Machine goes to shutdown state instead of rebooting.
The text was updated successfully, but these errors were encountered: