Skip to content
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

Allow creating isolated OVN networks (no uplink) #936

Closed
stgraber opened this issue Jun 12, 2024 · 6 comments · Fixed by #1070
Closed

Allow creating isolated OVN networks (no uplink) #936

stgraber opened this issue Jun 12, 2024 · 6 comments · Fixed by #1070
Assignees
Labels
Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@stgraber
Copy link
Member

This came up in https://discuss.linuxcontainers.org/t/isolated-ovn-network/20167/6

While there are workarounds, it'd probably make sense to just support creating an OVN network with no parent, likely by introducing a special value of none (and consequently preventing a managed network be named none).

@stgraber stgraber added Feature New feature, not a bug Easy Good for new contributors labels Jun 12, 2024
@stgraber stgraber added this to the soon milestone Jun 12, 2024
@SpiffyEight77
Copy link
Contributor

Hey @stgraber, I'm really interested in delving into incus and would like to work on this issue. Could you please assign it to me? 🙇🏻‍♂️

@stgraber
Copy link
Member Author

Done!

@SpiffyEight77
Copy link
Contributor

SpiffyEight77 commented Jul 18, 2024

Hey @stgraber, sorry to bother you at this moment. I've read the source code for this issue and have a few questions I'd like to make a confirmation with you.

  1. From my understanding, we intend to use the following command to create isolated OVN networks for the instance.
incus network create my-ovn --type ovn network=none ipv4.gateway=10.0.0.1/16 ipv4.ovn.ranges=10.0.0.2-10.255.255.254
  1. I need to allow the network=none in this method.

func (n *ovn) validateUplinkNetwork(p *api.Project, uplinkNetworkName string) (string, error) {

  1. After that, there are many settings such as MTU and DHCP that I'm still trying to understand. Should I modify these settings when network=none? 🙇🏻‍♂️

@stgraber
Copy link
Member Author

So the initial steps probably should be:

  • Modify networksPost to make none an invalid name for a new network, so we avoid anyone getting themselves in a confusing situation.
  • Look for where validateUplinkNetwork is called today and bypass the validation check if the value is none. We shouldn't modify validateUplinkNetwork itself as that function should still be left to validate an uplink network and should only be called if one is provided.
  • Edit setupUplinkPort to skip if the value is none
  • Edit startUplinkPort to skip if the value is none
  • Edit deleteUplinkPort to skip if the value is none
  • Make checkUplinkUse immediately return false if the value is none
  • Make Start skip the IsAvailable check if network is none
  • Make InstanceDevicePortValidateExternalRoutes return if network is none
  • Make ForwardCreate fail if network is none
  • Make LoadBalancerCreate fail if network is none

I think that's about it for what I'm seeing in the OVN driver code.

@SpiffyEight77
Copy link
Contributor

@stgraber
Thank you for your guidance. I will keep studying the source code and implement this feature. 🙇🏻‍♂️

@SpiffyEight77
Copy link
Contributor

SpiffyEight77 commented Aug 5, 2024

Hey @stgraber sorry to bother you again.

I've tried to implement this feature, which creates isolated OVN networks (no uplink), but I've encountered additional problems.

After creating the isolated OVN networks using this command and assigning them to the instance, I noticed that upon starting, the instance does not receive IPv4 or IPv6 addresses. This issue appears to be due to a method returning an empty slice.

existingOpts, err := n.state.OVNNB.GetLogicalSwitchDHCPOptions(context.TODO(), n.getIntSwitchName())

Another issue occurs when I try to delete isolated networks (those without an uplink), which results in an "object not found" error. I am still debugging this problem.

I would like to hear your advice. 🙇🏻‍♂️

I am very interested in the incus project and hope to thoroughly read and understand the source code. I hope you don't mind my weak computer science background. 🙇🏻‍♂️

@stgraber stgraber modified the milestones: soon, incus-6.4 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Good for new contributors Feature New feature, not a bug
Development

Successfully merging a pull request may close this issue.

2 participants