Skip to content

feat: Add declarative power management for hcloud_server - #1410

Open
wizenink wants to merge 1 commit into
hetznercloud:mainfrom
wizenink:dm.feat_add_declarative_power_management
Open

wizenink wants to merge 1 commit into
hetznercloud:mainfrom
wizenink:dm.feat_add_declarative_power_management

Conversation

@wizenink

Copy link
Copy Markdown

Adds a new hcloud_server_power_state SDK resource to manage Hetzner Cloud server power state declaratively through normal plan/apply workflows.

This enables OpenTofu-compatible power on/off management without relying on Terraform actions, while keeping the existing action-based resources unchanged. The new resource supports state = "running" and state ="off", reports the raw server status, and removes only power-state management on destroy without changing the server.

@wizenink
wizenink requested a review from a team as a code owner May 20, 2026 08:27
@wizenink
wizenink force-pushed the dm.feat_add_declarative_power_management branch from 85c0fac to fc4e6ea Compare May 20, 2026 08:30
@wizenink
wizenink force-pushed the dm.feat_add_declarative_power_management branch from fc4e6ea to 96d166e Compare May 20, 2026 08:30
@jooola

jooola commented May 20, 2026

Copy link
Copy Markdown
Member

Does #1342 solve the problem you are trying to solve with this PR?

@wizenink

Copy link
Copy Markdown
Author

@jooola not exactly. Actions are only supported on Hashicorp's Terraform, not on OpenTofu, so tofu does currently not have a way to change the power state declaratively. This PR aims to backport some of that into the non-action way of doing so

@jooola

jooola commented May 20, 2026

Copy link
Copy Markdown
Member

Hmm, I am not sure this is a good idea. If we are trying to go faster than opentofu, maybe the work effort should be directed towards supporting actions in opentofu directly: opentofu/opentofu#3309

I'll discuss this addition internally and come back to you.

@wizenink

Copy link
Copy Markdown
Author

I don't find it conflicting. IMO actions should be an adition into opentofu, but declarative old-fashioned way is still nice for some use cases. f.ex AWS and Azure can use both ways. Anyway, let me know and I'll maybe work on the opentofu path if I'm available. Thank you!

@jooola

jooola commented May 27, 2026

Copy link
Copy Markdown
Member

@wizenink Could you please explain and describe your use-case in #1414 so we better understand the reason behind this feature request?

@nh-exa

nh-exa commented Jun 11, 2026

Copy link
Copy Markdown

I am also very interested in this feature. It would allow us to start and stop servers via simple state changes. AWS and Azure already have this.

@nh-exa

nh-exa commented Jun 24, 2026

Copy link
Copy Markdown

I'd still like to see this feature. Any progress here @jooola @wizenink ?

@jooola

jooola commented Jun 24, 2026

Copy link
Copy Markdown
Member

@nh-exa Please describe your use case in details in #1414 or add a 👍

With regards to this PR, we will not be able to merge this as it is. A lot of work is still needed to support managing the state of the server:

So I am happy to leave this PR open until then, but we will not spend time reviewing this before the above points have not been solved.

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.

3 participants