Skip to content

feat: allow creating load balancers with primary ips - #700

Merged
jooola merged 5 commits into
mainfrom
lb-public-net
Oct 5, 2026
Merged

jooola merged 5 commits into
mainfrom
lb-public-net

Conversation

@jooola

@jooola jooola commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Primary IPs, which were previously available exclusively for Servers, are now also available for Load Balancers. When creating a Load Balancer, you can assign an existing Primary IP instead of having an IP address allocated automatically. Currently, you cannot change the Primary IP once the Load Balancer has been created.

To support this change, we added the new public_net property to the request body of the endpoint POST /load_balancers, with the following child properties:

  • public_net.ipv4: ID of an IPv4 Primary IP to assign to the Load Balancer.
  • public_net.ipv6: ID of an IPv6 Primary IP to assign to the Load Balancer.

If you omit a property, a new Primary IP of that version is allocated for the Load Balancer, as before.

A Primary IP can currently only be assigned when the Load Balancer is created. It stays assigned for the entire lifetime of the Load Balancer.

Related to https://docs.hetzner.cloud/changelog#2026-10-05-load-balancers-can-use-existing-primary-ips and https://docs.hetzner.cloud/changelog#2026-10-05-delete-load-balancer-returns-action.

feat: allow creating load balancers with primary ips (#700)
feat: delete load balancer now returns an action (#700)

@jooola
jooola requested a review from wneessen October 5, 2026 12:41
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.40%. Comparing base (b150ac4) to head (5b93098).

Files with missing lines Patch % Lines
hcloud/load_balancers/domain.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
+ Coverage   97.34%   97.40%   +0.06%     
==========================================
  Files          76       76              
  Lines        4101     4128      +27     
==========================================
+ Hits         3992     4021      +29     
+ Misses        109      107       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jooola
jooola merged commit 84e3a19 into main Oct 5, 2026
11 checks passed
@jooola
jooola deleted the lb-public-net branch October 5, 2026 13:17
jooola pushed a commit that referenced this pull request Oct 5, 2026
<!-- section-start changelog -->
### Load Balancers can now be created with existing Primary IPs

Primary IPs, which were previously available exclusively for Servers,
are now also available for Load Balancers. When creating a Load
Balancer, you can assign an [existing Primary
IP](https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/list_primary_ips)
instead of having an IP address allocated automatically. Currently, you
cannot change the Primary IP once the Load Balancer has been created.

To support this change, we added the new `public_net` property to the
request body of the endpoint [POST
/load_balancers](https://docs.hetzner.cloud/reference/cloud#tag/load-balancers/create_load_balancer),
with the following child properties:

- `public_net.ipv4`: ID of an IPv4 Primary IP to assign to the Load
Balancer.
- `public_net.ipv6`: ID of an IPv6 Primary IP to assign to the Load
Balancer.

If you omit a property, a new Primary IP of that version is allocated
for the Load Balancer, as before.

A Primary IP can currently only be assigned when the Load Balancer is
created. It stays assigned for the entire lifetime of the Load Balancer.

Related to
https://docs.hetzner.cloud/changelog#2026-10-05-load-balancers-can-use-existing-primary-ips.

### Deleting a Load Balancer now returns an Action

> [!IMPORTANT]
> Please update all code that uses the `LoadBalancersClient.delete`
method to wait on the newly returned action.

As part of our work on supporting [existing Primary IPs for Load
Balancers](https://docs.hetzner.cloud/changelog#2026-10-05-load-balancers-can-use-existing-primary-ips),
deleting a Load Balancer is now tracked with an Action.

The endpoint [DELETE
/load_balancers/{id}](https://docs.hetzner.cloud/reference/cloud#tag/load-balancers/delete_load_balancer)
now returns a 201 status code with an Action in the response body,
instead of a 204 status code with an empty response body.

You can use the returned Action to track the progress of the deletion.

Related to
https://docs.hetzner.cloud/changelog#2026-10-05-delete-load-balancer-returns-action.

### Features

- allow creating load balancers with primary ips (#700)
([84e3a19](84e3a19))
- delete load balancer now returns an action (#700)
([84e3a19](84e3a19))

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

~~~~rp-prefix
### Load Balancers can now be created with existing Primary IPs

Primary IPs, which were previously available exclusively for Servers,
are now also available for Load Balancers. When creating a Load
Balancer, you can assign an [existing Primary
IP](https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/list_primary_ips)
instead of having an IP address allocated automatically. Currently, you
cannot change the Primary IP once the Load Balancer has been created.

To support this change, we added the new `public_net` property to the
request body of the endpoint [POST
/load_balancers](https://docs.hetzner.cloud/reference/cloud#tag/load-balancers/create_load_balancer),
with the following child properties:

- `public_net.ipv4`: ID of an IPv4 Primary IP to assign to the Load
Balancer.
- `public_net.ipv6`: ID of an IPv6 Primary IP to assign to the Load
Balancer.

If you omit a property, a new Primary IP of that version is allocated
for the Load Balancer, as before.

A Primary IP can currently only be assigned when the Load Balancer is
created. It stays assigned for the entire lifetime of the Load Balancer.

Related to
https://docs.hetzner.cloud/changelog#2026-10-05-load-balancers-can-use-existing-primary-ips.

### Deleting a Load Balancer now returns an Action

> [!IMPORTANT]
> Please update all code that uses the `LoadBalancersClient.delete`
method to wait on the newly returned action.

As part of our work on supporting [existing Primary IPs for Load
Balancers](https://docs.hetzner.cloud/changelog#2026-10-05-load-balancers-can-use-existing-primary-ips),
deleting a Load Balancer is now tracked with an Action.

The endpoint [DELETE
/load_balancers/{id}](https://docs.hetzner.cloud/reference/cloud#tag/load-balancers/delete_load_balancer)
now returns a 201 status code with an Action in the response body,
instead of a 204 status code with an empty response body.

You can use the returned Action to track the progress of the deletion.

Related to
https://docs.hetzner.cloud/changelog#2026-10-05-delete-load-balancer-returns-action.
~~~~

### Suffix / End

This will be added to the end of the release notes.

~~~~rp-suffix
~~~~

</details>

Co-authored-by: Hetzner Cloud Bot <>
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