Skip to content

feat: add --persist so SNO VM survives the host reboot#7

Open
xiormeesh wants to merge 5 commits into
andfasano:mainfrom
xiormeesh:main
Open

feat: add --persist so SNO VM survives the host reboot#7
xiormeesh wants to merge 5 commits into
andfasano:mainfrom
xiormeesh:main

Conversation

@xiormeesh

Copy link
Copy Markdown

When using miniagent/SNO instead of Openshift Local/crc sometimes the host needs to be rebooted without losing the SNO VM, this PR

  • adds --persist flag defaulting to false
  • enables autostart for both network and VM
  • unmounts installation ISO file from the VM since it's stored in /tmp and would not survive a reboot
  • copies /tmp/mini-agent/auth/kubeconfig to /var/lib/miniagent/kubeconfig (overwrites if exists but should not be an issue since miniagent supports only one SNO VM at a time anyway)

I've decided to gate the functionality behind --persist flag because based on our previous conversations most users need miniagent for quick tests and I wanted to keep the ephemeral usecase as is.

@andfasano andfasano left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @xiormeesh thanks for your contribution (sorry the first commit somehow slipped through the cracks)!
It looks like a nice addition, I've just a comment on the dest folder, but for the rest looks fine

Comment thread sno-setup.sh

### 12. Post-installation persistence steps (if requested)
if [ "$persist_mode" = "true" ]; then
echo "* Copying kubeconfig to /var/lib/miniagent/kubeconfig"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that I'd prefer using the user-specific data folder, ie:

miniagent_dir="${XDG_CONFIG_HOME:-$HOME/.config}/miniagent"

mkdir -p "$miniagent_dir"
install -m 600 "${assets_dir}/auth/kubeconfig" "$miniagent_dir/kubeconfig"

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.

2 participants