Conversation
Add complete Hetzner Cloud infrastructure preset for Exasol Personal deployment: Infrastructure: - Add Terraform configs for Hetzner Cloud (network, servers, volumes, firewall) - Support single-node and multi-node clusters - Default server type: ccx33 (8 vCPU, 32GB RAM) - Default location: fsn1 (Falkenstein) - OS: Ubuntu 22.04 LTS with cloud-init fixes Cloud-init fixes: - Create 'ubuntu' user (Hetzner uses root by default) - Copy SSH authorized_keys for barrier client Power state management: - Implement stop/start via Hetzner API using null_resource - Support 'exasol stop' and 'exasol start' commands Cleanup provider: - Add Hetzner cleanup tool support (servers, volumes, networks, firewalls, SSH keys) - Integrate with existing cleanup CLI Documentation: - Add Hetzner setup guide (HOWTO_SETUP_HETZNER_ACCOUNT.md) - Update README with Hetzner in supported platforms - Add Hetzner to test matrix (disabled by default)
|
This looks good, let's wait for monday when #102 is merged to rebase it here and check for needed changes. |
|
Thanks for your contribution! I can't really test it, but it looks good overall. I would prefer if all the infrastructure stuff was contained to the presets though. I think it should be possible by using the resource "hcloud_server" "nodes" {
lifecycle {
action_trigger {
events = [ after_update ]
conditions = var.power_state == "stopped"
actions = [ action.hcloud_server_poweroff.power_nodes_off ]
}
action_trigger {
events = [ after_update ]
conditions = var.power_state == "running"
actions = [ action.hcloud_server_poweron.power_nodes_on ]
}
}
# ...
}What do you think? |
@migroble These are Terraform/OpenTofu Actions; Actions are imperative, not declarative. They fire on every tofu apply (deploy, refresh etc). We want a trigger that only fires when intended EDIT: |
Yeah,
Oh, that's unfortunate, in that case you can safely ignore me. :D |
|
First, thanks for your contribution! We certainly want to get this merged as soon as we can. I think this PR should accelerate some of the plans we had anyway:
... or something similar. That would allow you and everybody else to develop, use and maintain presets that Exasol itself can't commit to maintain. We'll discuss internally in the team if we can and want to accelerate these plans or make an exception for this PR. But thanks for the contribution regardless. This is why we made it open source! |
|
@wizenink was so kind to create this PR for the hetzner cloud terraform provider. Let's hope they'll merge this in soon. Would be glad to avoid our workaround. |
|
Thank you for the feedback @nh-exa! I am looking forward on the decided way forward; no rush from my side. |
Description
Add full Hetzner Cloud support to Exasol Personal, including infrastructure provisioning, cleanup provider, and power state management via the Hetzner Cloud API.
Related Issue
None
Fixes #
Type of Change
feat: New featurefix: Bug fixdocs: Documentation updatetest: Test additions or changesrefactor: Code refactoringchore: Maintenance tasksChanges Made
New Infrastructure Preset: Hetzner Cloud
assets/infrastructure/hetzner/Cloud-init Fixes
Hetzner Ubuntu images use
rootas the default user, but Exasol expectsubuntu:cloudconf/10-create-ubuntu-user.yamlto create theubuntuuser with correct SSH authorized keysknown_hostswith a retry loop so the barrier client can SSH to itself on the private networkPower State Management
exasol stopandexasol startcall the Hetzner Cloud API directly from Go using thehcloud-go/v2SDKdeployment.jsonat stop/start time — no Terraform state involvementHCLOUD_TOKENmust be set in the environment for stop/start to workpowerControl.provider: hetznerto enable this behaviourCleanup Provider
tools/cleanup/internal/hetzner/deployment_id) for scoped discoveryexasol-cleanupCLITesting
task all)exasol install,exasol stop,exasol start,exasol-cleanupTest Details
Manually verified on a live Hetzner deployment:
exasol stopshuts down the VM via API and updates workflow stateexasol startpowers on the VM via API, waits for it to be reachable, then updates workflow stateexasol-cleanupdiscovers and removes all Hetzner resourcesChecklist
task fmtandtask lintAdditional Notes
The
HCLOUD_TOKENenvironment variable must be set for all operations (install, stop, start, cleanup). It is used by both OpenTofu (via the hcloud provider) and the Go launcher (for direct API calls during stop/start).