-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Extend virt.network_define
to create NAT networks
#54197
Conversation
May be that PR could also be submitted to 2019.2.1 since this typically a bug fix... even though it adds some parameters to the API. |
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.
Looks wonderful @cbosdo thank you for getting this together. Left a comment that should get the rest of the checks passing!
for some weird reason, the tests are still showing as not completed after a few hours... |
@cbosdo I think that's due to some of the work we're doing on stabilizing our test suite. You can read https://groups.google.com/forum/#!topic/salt-announce/5RJjtDYszx8 for more info, but I'm pretty sure that we temporarily turned off our PR builds last night, operating under a noisy neighbor sort of theory. Please be patient while we work out the kinks, but also feel free to ping regularly if you don't see any updates happening! |
@waynew Thanks for the update on that! |
re-run full all |
FWIW this looks good to me - I'm not familiar with virt/nat stuff, but I don't see anything otherwise in the code that would concern me! |
Rebased on master |
39d4e94
to
9ed29e7
Compare
8ea26ec
to
201b361
Compare
If using virt.network_define with nat network type, then libvirt complains about missing IP configuration. Allow setting it in both the virt.network_define module and the virt.network_running state.
What does this PR do?
virt.network_define
can already define NAT virtual networks by setting theforward
attribute tonat
... however libvirt fails because it needs an IP configuration in such a case butvirt.network_define
doesn't have parameters for it.The PR adds the missing IP configuration to both
virt.network_define
module andvirt.network_running
state to allow properly setting up NAT virtual networks.What issues does this PR fix or reference?
Previous Behavior
Applying the following state fails with
XML error: nat forwarding requested, but no IP address provided for network 'net1'
error.New Behavior
Changing the state to the following creates a proper network.
The
dhcp_ranges
part is not strictly required for the NAT network creation and are thus optional, but this is so commonly used that I added them in this PR.Tests written?
Yes
Commits signed with GPG?
Yes