nix-community / nixos-anywhere

install nixos everywhere via ssh [maintainer=@numtide]
https://nix-community.github.io/nixos-anywhere/
MIT License
1.68k stars 115 forks source link

kexec fails on Gandi IaaS platform #164

Open markpash opened 1 year ago

markpash commented 1 year ago

Describe the bug

While the Gandi Cloud VPS offering supports NixOS their IaaS platform, which has some interesting features, doesn't.

In an attempt to use nixos-anywhere, I created a debian 11 instance with 2GB of RAM and prepared a flake to install. When running nixos-anywhere it failed with a kexec error. I can post a log if necessary, but the error itself was: Could not get memory layout.

I looked around for instances of this error and found a bug report that suggests that kexec needs to be compiled with the xen libraries in order for it to work on xen guests. I believe I was targeting a xen guest.

I looked at the default kexec bundle used, which uses a statically linked kexec from nixpkgs, and indeed it isn't compiled with xen libraries. Since the xen libraries are part of the whole xen package, and it is now marked as insecure, this is about as far as I'm willing to go with this on my own.

To Reproduce

Steps to reproduce the behavior:

  1. Create an instance of Gandi Cloud V5 server running debian 11, 2GB RAM
  2. Use nixos-anywhere

Expected behavior

I expected the server to reboot to NixOS.

System information

Running from a macOS system, targeting debian 11, Xen guest.

zimbatm commented 1 year ago

Can you try with a 4GB instance? We had issues in the past where 2GB wasn't enough to hold the NixOS image in memory.

markpash commented 1 year ago

Can you try with a 4GB instance? We had issues in the past where 2GB wasn't enough to hold the NixOS image in memory.

Just did, same issue.

zimbatm commented 1 year ago

Maybe @nlewo knows something about this

nlewo commented 1 year ago

@zimbatm No i dont know more about this.

However to move forward, it would be required to compile kexec with the Xen support as suggested by @markpash and checks if it fixes the issue. (If it fixes the issue, we should then add some patches to the nixpkgs Xen.) If someone wants to try, I could provide an SSH access to a GandiCloud VPS for such kind of tests.

sedlund commented 9 months ago

I'm trying on a 2GB Xen VM on another provider. After kexec run the VPS control console thinks the machine is shutdown. I have to click the boot button to bring it up.