khuedoan / homelab

Fully automated homelab from empty disk to running services with a single command.
https://homelab.khuedoan.com
GNU General Public License v3.0
8.19k stars 762 forks source link

PXE Not booting, what is the default bios filename to boot? #17

Closed mannp closed 2 years ago

mannp commented 2 years ago

Thanks for sharing your config :)

I wondered what the default boot image menu is for the pxe server you are using, as I cannot get the machines to see the default menu / boot image for pxe.

Thanks

khuedoan commented 2 years ago

I'm not sure on the question, I use the second option in the docs, can you provide some more logs and/or screenshots please?

For example:

mannp commented 2 years ago

For my working netboot.xyz server I have to set IP of the pxe server, EFI 32bit filename, EFI 64bit filename and default bios filename, on opnsense, so that the machines on that vlan know where the pxe server is.

I guess the question is, how do the node machines know where the temp PXE server is on my desktop?

At the moment they find the PXE server, but they error that there is no image / menu to boot and repeat.

./scripts/pxe-logs gives me the error 'unknown flag: --project-directory', so I guess I am missing something obvious :)

khuedoan commented 2 years ago

The DHCP config will point the nodes to the temp PXE server (which is the same PC you're running Ansible on):

https://github.com/khuedoan/homelab/blob/8b31c9e9e20a01755d96efd643ee465d8d0c97fe/metal/roles/pxe_server/templates/dhcpd.conf.j2#L12-L14

You can check the rendered DHCP config in this path:

https://github.com/khuedoan/homelab/blob/8b31c9e9e20a01755d96efd643ee465d8d0c97fe/metal/roles/pxe_server/tasks/main.yml#L16

khuedoan commented 2 years ago

./scripts/pxe-logs gives me the error 'unknown flag: --project-directory', so I guess I am missing something obvious :)

Oh that's a bug due to this commit: https://github.com/khuedoan/homelab/commit/40523e64ab3e6c399f9d1e047207d0283a135d7a

The Ansible role use Docker Compose v1 (see https://github.com/ansible-collections/community.docker/issues/216), but the pxe-logs script use Docker Compose v2 and I forgot about that.

khuedoan commented 2 years ago

Done, please pull latest master and try again

mannp commented 2 years ago

I guess the critical missing info, is that I am trying to use four vm's on proxmox for the 4 physical machines and maybe confusing the issue here.

I will have a read on ansible pxe boot :)

khuedoan commented 2 years ago

Ah if you're using VMs just use a Rocky Linux 8 image and ignore the boot.yml playbook and go directly to the cluster.yml playbook, you don't need PXE boot at all:

https://github.com/khuedoan/homelab/blob/7e21741bc1362206e392a663b9e5b722f874368e/metal/Makefile#L15-L18

khuedoan commented 2 years ago

Some configuration to note on the base image:

https://github.com/khuedoan/homelab/blob/7e21741bc1362206e392a663b9e5b722f874368e/metal/roles/pxe_server/templates/kickstart.ks.j2#L37-L49

mannp commented 2 years ago

I was hoping your setup could create and configure the nodes for me via pxe with minimal config of the vm.

What would the local pxe server be presenting to the nodes eg tftp://192.168.1.94/

khuedoan commented 2 years ago

My rendered DHCP config looks like this:

subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.1;
    range 192.168.1.2 192.168.1.254;

    class "pxeclients" {
        match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
        next-server 192.168.1.9;

        if option architecture-type = 00:07 {
            filename "grubx64.efi";
        }
    }
}

The packages will be downloaded via the HTTP server (http://192.168.1.9)

mannp commented 2 years ago

It looks like this setup is creating a dhcp server itself to configure the physical machines, is that correct?

I am getting an 'Access denied' when my vm's try to access the pxe server, but they are looking at my opnsense dhcp server for the details.