Skip to content

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

Open
hradaideh wants to merge 1 commit into
Telmate:masterfrom
hradaideh:fix/lxc-host-managed-support
Open

Add support for host-managed parameter in LXC networks#530
hradaideh wants to merge 1 commit into
Telmate:masterfrom
hradaideh:fix/lxc-host-managed-support

Conversation

@hradaideh

Copy link
Copy Markdown

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+.

- Add HostManaged field to LxcNetwork struct
- Parse host-managed parameter from Proxmox API response
- Supports OCI containers on Proxmox 9.1+

This parameter is automatically set by Proxmox for OCI-based LXC
containers and must be recognized to avoid parsing errors.
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.

1 participant