Hey, we have a buch of bare metal server where we ...
# harvester
f
Hey, we have a buch of bare metal server where we want to run k8s. I've experimented with https://github.com/metal3-io/baremetal-operator from metal3 and they combination of ironic with yaml driven configuration (which is quite gitops friendly!) is very attractive. Is there a way to install harvester in such an automatic fashion? We really don't want to run with USB sticks ๐Ÿ™‚
a
You could try the PXE method: PXE Boot Installation | Harvester
f
@acoustic-addition-45641 I've read about it, but it's far from decent state managment of phisical servers that metal3 offers. So I wandered if anyone maybe actually tried to use metal3 with harvester? ๐Ÿ˜†
๐Ÿ‘ 1
t
Due to Harvesterโ€™s unique way of booting it has to be the HOST os. PXE is the way :

https://youtu.be/UA_GVZaoSfQโ–พ

You can automate the install fairly easy.
f
@thousands-advantage-10804 I understand the pxe method, just with ironic/metal3 you first automated the configuration of bare metal (bios etc) and at the end you acutally boot and image. Hence I'm wondering (and will be willing to experiment) could I possibly put here: https://github.com/metal3-io/baremetal-operator/blob/main/examples/demo-hosts.yaml#L164 the url to the harvester image and then just provide to the harvester inataller the configuration it requirers
that way you end up with a fleet of easy to manage bare metal servers that you provision/reset at will in the automatic manner (you never need to log into any console) and after provisioning phase the harvester is booted and the (I hope normal) process of havester installation continues
t
That operator uses libvirt to actually boot โ€œimagesโ€ from a qcow2. Harvester is designed to be on the host itself. There us not a qcow2 for harvester available because the install process is vital. It wonโ€™t work.
And just thinking about it. If there was a way to use the qcow2 you could end up with k8s (rke2 vm) inside k8s (harvester) inside k8s (ironic). that is very inefficient.
f
@thousands-advantage-10804 in this example there is qcow2, but the docs also mention raw (I guess it's the same as ISO?) https://book.metal3.io/bmo/introduction.html#deploying-baremetalhosts. libvirt? I might be mistake, but as I tested the metal3 flow to provision baremetal hosts with ubuntu image I just configured the bios/redfish (some hardware RADIS etc) and then just told it to boot ubuntu, ending up with exacly the same situation as I would if I configured the bios by hand and then boot ubuntu form iso/usb
that's why (maybe wrongly) my intuition kinda suggest me to try to same with harvester iso ๐Ÿ™‚
t
I would love to see if works. It looked like it may be able to manage the host through the BMC.
f
I would love to hear that somone else tried it ๐Ÿ˜„ if not I will try soon ๐Ÿ˜„
a
@fancy-fountain-55453 please share those findings. I've been playing with the Dell Terraform Redfish provider recently in an effort to baremetal boot our Dell servers to a fully provisioned host OS (Ubuntu primarily) without the need to involve PXE. The general idea is to have the provider mount the installation ISO and also mount a separate IMG that contains a cloud config (Harvester config) CIDATA volume. However, Harvester does not have an autoinstall option when booting the ISO, so automating a Harvester install in this manner isn't an option. What would be nice is if Harvester had an autoinstall countdown timer immediately after ISO boot ("Looking for autoinstall file. Press any key to proceed.") that would at least scan other mounts for the presence of cloud-config (Harvester config) CIDATA volume... or something like that. I'm pretty sure that Redfish APIs are not Dell specific, so the Terraform provider may be applicable to the BMC of other hardware platforms. The Dell Redfish Terraform provider also allows for adjusting Dell's server configuration profile, which allows for (as an example) booting a RedHat golden image and providing answer files. All that to say, I wish Harvester had a means of autoinstalling with just an ISO + cloud-config (Harvester config). @thousands-advantage-10804 Love your YouTube content! Keep it coming!!!
โค๏ธ 1
t
You need to make a video showing Redfish.
p
can't you just set
kargs
like
harvester.install.automatic=true harvester.install.config_url
etc and it will install from ISO? we've basically done this before in a pinch
๐Ÿค” 1
f
@acoustic-addition-45641 when provisioning (any image) with matal3 you can inject a config file to for example configure cloud-init. (https://book.metal3.io/bmo/instance_customization#userdata) as i read the docs
User and network data are passed to the instance via a so called _config drive_, which is a small additional disk partition created on the root device during provisioning.
so it also boils down auto mounting some config as a separate partition.
๐Ÿ‘ 1
@thousands-advantage-10804 I usually collaborate on research papers but if my experiment is successful we can make a video as well ๐Ÿ˜„
โค๏ธ 1
p
how are you passing the config drive to harvester installer?
t
since this is living rent free in my head.. Is there a way to pass the userdata into https://book.metal3.io/bmo/live-iso
looking at the pxe version
Copy code
kernel ${live_endpoint}/harvester/harvester-v1.5.1-vmlinuz-amd64 ip=dhcp net.ifnames=1 console=tty1 rd.cos.disable root=live:${live_endpoint}/harvester/harvester-v1.5.1-rootfs-amd64.squashfs rd.noverifyssl harvester.install.iso_url=${live_endpoint}/harvester/harvester-v1.5.1-amd64.iso harvester.install.automatic=true harvester.install.config_url=${live_endpoint}/harvester/harvester_slim.yaml
the kernel needs to know the location of the config file. Crap
*Note*: image.checksum, rootDeviceHints, networkData and userData will not be used since the image is not written to disk.
f
since this is living rent free in my head..
- I know the feeling ๐Ÿ˜„ today I mobilized people to fix the bare metal network in our small DC so I can experiment ๐Ÿ˜„ @thousands-advantage-10804 regarding extra kernel params I found this https://github.com/metal3-io/baremetal-operator/blob/4409f7185cef78b4162da8a4c5acb[โ€ฆ]546/config/base/crds/bases/metal3.io_preprovisioningimages.yaml I need to dig into this, but even if some option is lacking it's just pull request to metal3 away from beeing added ๐Ÿ™‚
t
crazy thought. use metal3 to boot the install kernel with the args to pull the iso from http/tftp like pxe.
p
IRONIC_KERNEL_PARAMS - Kernel parameters to pass to IPA (default console=ttyS0)
sounds like it ought to work
alternately I'd just do install-whatever OS and then do automated takeover install of harvester
f
@prehistoric-morning-49258
IRONIC_KERNEL_PARAMS
but those parameters go to the IPA (ironic python agent) ramdisk that is first booted to inspect/configure baremetal, before actually OS happens. So far I failed to find a way to inject anything apart from mounted disk with
USER_DATA
and
NETWORK_DATA
which are later used by cloud-init and such.
p
something like ipxe should work. might need to bake an ISO per-server depending on reqs, and/or scripted takeover install. basically boot to whatever OS can chain/takeover into harvester installer, imo ipxe is usually best option
We basically use something like this: https://github.com/tlhakhan/ipxe-iso to build custom ipxe ISO. that drops you into a shell:
RUN <<EOF cat > run.ipxe
#!ipxe
shell
EOF
or you can update to like:
#!ipxe
chain https://[my_server]/harvester-config.ipxe
should then be able to just boot ISO and have Harvester auto-install
t
oh damm, abort? start drinking?
๐Ÿฆœ 1
f
@prehistoric-morning-49258 with just ipxe it's indeed easy, I just had a dream of combining with ironic/meta3 etc for more gitops managment ๐Ÿ™‚ But ironic serves its own boot.ipxe (for provisioning of ipa agent to gather inventory of bare metal) that is picked by netboot and brakes the netboot process ;-(
@thousands-advantage-10804 without drinking this journey would have ended long ago ๐Ÿ˜œ
๐ŸŽ‰ 1
p
idk its like metal3 is whats preventing it being automated
booted OS will not be able to access any data on the ISO except for the kernel and initramfs it booted from
- in theory this is fine, you can boot & autoinstall from kernel/initrd + http squashfs/ISO + kernel args
f
@prehistoric-morning-49258 well with metal3 you would have a nice gitops repo with all bare metal and it's configuration there just waiting to be boostraped (or reinstalled in case or early very iterative development process ๐Ÿ™‚ ) with ipxe it's more interactive automation ๐Ÿ™‚ as you have to do a bit of manual picking (which host to start harvester with, which to join etc). Also, I'm not sure how harvester handles server with a lot of disks. Normally, a pre-provisioning tool - like ipa - does mdadm magic, or metal3 talkis via redfish to configure the hardware raid before the os is booted. Here I wonder what are actual capabilities of harvester are for configuring the hardware... looking at this sole variable https://docs.harvesterhci.io/v1.1/install/harvester-configuration#installdata_disk not soo big ๐Ÿ˜‰
@prehistoric-morning-49258 so the ISO booting, atm my technical imagination does not allow me see how to do it not in a completely hacky way ๐Ÿ˜„
what would be ideal, is to pre-bake in such netboot iso what it should boot and from. Atm it looks for boot.ipxe, finds the ironic version and breaks, if it could somehow get boot-netboot.ipxe then we are saved
p
yeah you can pre-bake in a variety of ways, really it seems more like a metal3 support question than harvester support