nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

openstack qcow2 image deployed system is not accessible after boot (NixOS 21.05)

Open AleXoundOS opened this issue 2 years ago • 10 comments

image

I suspect the reason for this is that the default configuration is BIOS-bootable, not UEFI. But not sure.

AleXoundOS avatar Mar 24 '22 19:03 AleXoundOS

hmm, not sure if bios is at fault here, 'Booting the kernel' sounds like it found a kernel and failed later in the boot process?

Lassulus avatar Mar 24 '22 19:03 Lassulus

on what machine do you try to boot the image?

Lassulus avatar Mar 24 '22 20:03 Lassulus

@Lassulus hey I generated for openstack qocw2 image and this happened, I tried with nixos-genearte

cyber-goka avatar Mar 24 '22 23:03 cyber-goka

on what machine do you try to boot the image?

@Lassulus, which specs exactly do you need?

AleXoundOS avatar Mar 24 '22 23:03 AleXoundOS

uhm, what kind of virtualization it is using? do you have a qemu command ready to test it for me? is it on x86_64? etc

Lassulus avatar Mar 25 '22 07:03 Lassulus

@Lassulus it's x86_64, no we don't have access directly to qemu, it is openstack

cyber-goka avatar Mar 25 '22 08:03 cyber-goka

have you tried the openstack format instead of the cloudstack one?

Lassulus avatar Mar 25 '22 10:03 Lassulus

@Lassulus, first of all, sorry for the misleading issue title (it erroneously featured cloudstack). The actual target cloud is openstack. I'm an experienced Nix/OS user/dev, but a newbie in cloud tech and I confused these when my colleague ran into the issue and reported it.


We currently tested NixOS 21.05, so some or all of the information may be irrelevant for the newer versions at the moment. Also the described issues originate not from nixos-generators but from nixpkgs, so may be a subject to be moved.


Ok, the image actually boots: bootloader, kernel and services, except openstack-init service. So it is not halted as we originally thought. It just prints nothing to the cloud virtual console because of boot.kernelParams = [ "console=ttyS0" ]; in openstack-config.nix (imported from nixpkgs). Overriding (lib.mkForce) this option in our configuration.nix solves this part. Do other openstack deployments nowadays benefit from "console=ttyS0"?

The openstack image is really only BIOS-bootable, but this is what our openstack cloud actually expects. "Wrong EFI loader signature" is not an issue really, just a warning. It doesn't stop the system.

However, after all the systemd services booting stuff was printed, the system is not accessible:

  1. No login prompt in the virtual console. Perhaps, serial-getty / getty / autovt systemd services are disabled or need adjustments.
  2. Cannot connect/login via ssh: ssh authorized keys are not passed from the openstack cloud configuration to the system. Maybe caused by the next issue. We had to mount the disk in another virtual machine to add authorized_keys file manually.
  3. openstack-init systemd service fails at some wget calls with 404 HTTP code. Perhaps, this is fixed in upstream: https://github.com/NixOS/nixpkgs/commit/413afdae6e29ff8f90f6576cf7317455013e8ebd.

AleXoundOS avatar Mar 26 '22 11:03 AleXoundOS

ah, alright, well nixos-generators is just a thin wrapper around nixpkgs. so the problems are probably upstream. as you can see in https://github.com/nix-community/nixos-generators/blob/master/formats/openstack.nix we just import this file: https://github.com/NixOS/nixpkgs/blob/master/nixos/maintainers/scripts/openstack/openstack-image.nix and do nothing else

Lassulus avatar Mar 26 '22 12:03 Lassulus

I think this is working as expected, I see the same output as you on the graphical console of my nixos images running on openstack, however if I check the serial console I have the full linux console there. I think you're supposed to use the serial console and not the graphical one. Ideally, just enable ssh and don't use the console at all!

starcraft66 avatar Jul 14 '22 23:07 starcraft66