[PR #530] Add support for host-managed parameter in LXC networks #530

Open
opened 2026-02-28 00:42:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/530
Author: @halradaideh
Created: 12/6/2025
Status: 🔄 Open

Base: masterHead: fix/lxc-host-managed-support


📝 Commits (1)

  • 999fe15 feat: add support for host-managed parameter in LXC networks

📊 Changes

1 file changed (+15 additions, -9 deletions)

View changed files

📝 proxmox/config__lxc__networks.go (+15 -9)

📄 Description

Description

This PR adds support for the host-managed parameter in LXC network configurations, which was introduced in Proxmox VE 9.1 for OCI-based containers.

Problem

When creating LXC containers from OCI images (Docker Hub images) on Proxmox VE 9.1+, the API automatically sets a host-managed=1 parameter on network interfaces. The SDK was not parsing this parameter, which caused the provider to fail with validation errors.

Changes

  • Added HostManaged field to LxcNetwork struct
  • Added parsing logic in GetNetworks() to read the host-managed parameter from API responses
  • Updated struct initialization to include the new field

Technical Details

The host-managed parameter is automatically set by Proxmox for OCI-based containers to indicate that the network interface is managed by the host system. This is distinct from traditional LXC containers where this parameter is not present.

API response example for OCI container:

net0: name=eth0,bridge=vmbr1,host-managed=1,hwaddr=XX:XX:XX:XX:XX:XX,ip=dhcp,type=veth

Testing

Tested on Proxmox VE 9.1.1 with:

  • OCI containers (nginx, redis images)
  • Traditional LXC templates (Debian, Ubuntu)
  • Both container types create and parse correctly

Backward Compatibility

Fully backward compatible. Traditional LXC templates that do not have the host-managed parameter continue to work as before, with the field defaulting to false.

This change is required for the corresponding terraform-provider-proxmox PR to support OCI containers on Proxmox 9.1+.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Telmate/proxmox-api-go/pull/530 **Author:** [@halradaideh](https://github.com/halradaideh) **Created:** 12/6/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/lxc-host-managed-support` --- ### 📝 Commits (1) - [`999fe15`](https://github.com/Telmate/proxmox-api-go/commit/999fe1528923986a668075958e0c22a2ca5f8fce) feat: add support for host-managed parameter in LXC networks ### 📊 Changes **1 file changed** (+15 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/config__lxc__networks.go` (+15 -9) </details> ### 📄 Description ## Description This PR adds support for the `host-managed` parameter in LXC network configurations, which was introduced in Proxmox VE 9.1 for OCI-based containers. ## Problem When creating LXC containers from OCI images (Docker Hub images) on Proxmox VE 9.1+, the API automatically sets a `host-managed=1` parameter on network interfaces. The SDK was not parsing this parameter, which caused the provider to fail with validation errors. ## Changes - Added `HostManaged` field to `LxcNetwork` struct - Added parsing logic in `GetNetworks()` to read the `host-managed` parameter from API responses - Updated struct initialization to include the new field ## Technical Details The `host-managed` parameter is automatically set by Proxmox for OCI-based containers to indicate that the network interface is managed by the host system. This is distinct from traditional LXC containers where this parameter is not present. API response example for OCI container: ``` net0: name=eth0,bridge=vmbr1,host-managed=1,hwaddr=XX:XX:XX:XX:XX:XX,ip=dhcp,type=veth ``` ## Testing Tested on Proxmox VE 9.1.1 with: - OCI containers (nginx, redis images) - Traditional LXC templates (Debian, Ubuntu) - Both container types create and parse correctly ## Backward Compatibility Fully backward compatible. Traditional LXC templates that do not have the `host-managed` parameter continue to work as before, with the field defaulting to `false`. ## Related This change is required for the corresponding terraform-provider-proxmox PR to support OCI containers on Proxmox 9.1+. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-api-go#530
No description provided.