-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clone: Add dhcp and auto options for ipconfig #177
Conversation
DHCP doesn't get enabled automatically when no option is given. Add and document the options to enable DHCP or SLAAC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, I just left a question regarding how things work with those special values, but aside from that we should be good to go.
I'm pre-approving this PR, and will go back to it when my question's been addressed.
Thanks for the PR!
@@ -66,7 +66,7 @@ func (c *Config) Prepare(raws ...interface{}) ([]string, []string, error) { | |||
} | |||
} | |||
for _, i := range c.Ipconfigs { | |||
if i.Ip != "" { | |||
if i.Ip != "" && i.Ip != "dhcp" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, if we set it to dhcp
, how is it forwarded to PVE? Same for IPv6 and SLAAC, how is it forwarded to PVE?
Also, if nothing is set, what's the behaviour for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the string matches dhcp
(or auto
for IPv6) it gets forwarded to PVE unchanged.
The PVE likewise just passes values matching auto
or dhcp
directly to the Cloud-Init network configuration.
The code of the PVE side is here: https://github.com/proxmox/qemu-server/blob/master/PVE/QemuServer/Cloudinit.pm#L186
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the above link, if ip
or ip6
are not set, the resulting network configuration won't contain address entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me then, thanks for the explanation!
Merging this PR, thanks again for the contribution @sebastian-de! |
Contrary to the initial Cloud-Init networking PR (#142) DHCP has to be enabled explicitly.
Add and document the options to enable DHCP or SLAAC.
Tested on PVE 7.3.