Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap: recreate node when PXE boot is forced with plain QEMU #89

Merged
merged 3 commits into from
Jun 16, 2021

Conversation

pothos
Copy link
Member

@pothos pothos commented Jun 15, 2021

In the QEMU mode where the prepare.sh script is directly used (i.e.,
not the Racker QEMU IPMI simulator environment), the reprovisioning
with PXE could be only forced when the VM got deleted manually before.
Automatically delete any existing VM before creating it.

Fixes #42

How to use

cd /var/tmp/
mkdir mycluster # prepare.sh create must run in an empty folder with just the *_macs files
cd mycluster
echo 0c:42:a1:11:11:11 > controller_macs
echo 0c:42:a1:11:11:22 > worker_macs
sudo rm -r /opt/racker/terraform/
sudo mkdir -p /opt/racker/terraform
sudo cp -r /home/$USER/kinvolk/lokomotive/assets/terraform-modules/matchbox-flatcar/* /opt/racker/terraform
# compile the right Lokomotive branch used in Racker
PATH="$PATH:/home/$USER/kinvolk/lokomotive" /home/$USER/kinvolk/racker/bootstrap/prepare.sh create
[…]
PATH="$PATH:/home/$USER/kinvolk/lokomotive" /home/$USER/kinvolk/racker/bootstrap/prepare.sh destroy

Testing done

rm lokoctl-assets/cluster-assets/0c:42:a1:11:11:22 # force a PXE installation when reprovisioning
nano cl/lokomotive-worker-0.k8s.localdomain.yaml # change something in /etc/hosts to force a reprovisioning
PATH="$PATH:/home/$USER/kinvolk/lokomotive" lokoctl cluster apply

pothos added 2 commits June 15, 2021 12:02
In the QEMU mode where the prepare.sh script is directly used (i.e.,
not the Racker QEMU IPMI simulator environment), the reprovisioning
with PXE could be only forced when the VM got deleted manually before.
Automatically delete any existing VM before creating it.

Fixes #42
The NODES variable is undefined with plain QEMU usage.
@pothos pothos force-pushed the kai/plain-qemu-recreate-node branch 4 times, most recently from 64ef8f8 to 3c79ec2 Compare June 15, 2021 10:30
Lokomotive Baremetal development requires a larger local setup
consisting of a DHCP bridge for PXE with Matchbox and dnsmasq.
The prepare script has a mode to work with local VMs (not the QEMU
IPMI simulator) and it was not documented yet.
@pothos pothos force-pushed the kai/plain-qemu-recreate-node branch from 3c79ec2 to 6df3ac4 Compare June 15, 2021 10:31
@pothos pothos requested review from ipochi and joaquimrocha June 15, 2021 10:35
@pothos pothos marked this pull request as ready for review June 15, 2021 10:35
@pothos pothos merged commit ba4b771 into main Jun 16, 2021
@pothos pothos deleted the kai/plain-qemu-recreate-node branch June 16, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error forcing PXE if mac address file is deleted on QEMU
2 participants