Closed jacac closed 4 years ago
Confirmed, observed the same behaviour.
Look at PVE API specification at path: /nodes/{node}/lxc/{vmid}/config
and PUT verb: net[n]: (IPv4/CIDR|dhcp|manual)
. In your case only IPv4/CIDR is valid.
@tristanrobert You are correct on the IP spec for Proxmox. This is not the issue.
The issue is that Foreman does not expect you to store the IP this way. If you look at the Nic
table in the Foreman DB, the IP field only allows 15 characters to be stored. Which would not work for IPs like xxx.xxx.xxx.xxx/xx
. The Nic
table has other columns like attrs
or compute_attributes
which could allow to store the prefix. If we could add another field for the LXC container to enter the prefix and store this separately, But combine those attributes when talking to Proxmox to create or update the container.
Apologize for the late reply...
Thank you @jacac for your detailed issue. I understand now. You are right. It needs a fix. I suggest not to set Ipv4 foreman field with CIDR format. I suggest to add fields in NIC proxmox part of the form: DHCP (default) or static and when it is static you can spécify the CIDR suffix and the IP gateway.
@tristanrobert Could you give me a short introduction how the process is from the the form post to DB insert to Proxmox post. I'm not a Ruby programmer but maybe could figure it out based on your code.
Fixed in 0.9.4
Create host as a LXC container fails with
invalid format - value does not look like a valid ipv4 network configuration
. When adding the network prefix like192.168.1.100/24
it works.To Reproduce Steps to reproduce the behavior:
LXC container
Expected behavior If subnet is selected it should grap the information from the subnet to set GW and network prefix. If no subnet is selected an option needs to be available to add GW and network prefix. This network prefix should not be added to the host IP field in the foreman DB. Otherwise it breaks the endpoint for Cloud-Init userdata endpoint (https://github.com/theforeman/foreman_userdata ) which request userdata by host IP without the prefix.
Screenshots