mirror of
https://git.freebsd.org/ports.git
synced 2025-05-28 17:06:32 -04:00
Please note that this is a development version of nova. Many features are not available. Currently nova works on FreeBSD 11 and supports QEMU and Xen. Common issues: - Security groups are not implemented - ARP spoofing, DHCP isolation protection are not implemented - Nova services work from the root user - No IPv6 support QEMU issues: - Need to enable serialconsole (TCP) - Need to disable online CPU tracking - Cannot mount cinder volumes Xen issues: - Live snapshots don't work - No support for cinder volume hot-plugging - XENBUS delay (5 min) when using qemu driver and COW images - Some Linux images cannot be booted For further FreeBSD specific notes please refer to port's pkg-message. PR: 215151 Submitted by: Alexander Nusov (alexander.nusov@nfvexpress.com)
90 lines
3.3 KiB
Diff
90 lines
3.3 KiB
Diff
From 2e4a0e0a2588c4d52495fad8105aa1a4609797f6 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
|
|
Date: Tue, 8 Nov 2016 16:50:56 +0300
|
|
Subject: [PATCH] add freebsd l3 driver
|
|
|
|
---
|
|
nova/network/l3.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
1 file changed, 61 insertions(+)
|
|
|
|
diff --git a/nova/network/l3.py b/nova/network/l3.py
|
|
index c13e6e2..a5982d5 100644
|
|
--- a/nova/network/l3.py
|
|
+++ b/nova/network/l3.py
|
|
@@ -16,6 +16,7 @@
|
|
from oslo_log import log as logging
|
|
|
|
from nova.network import linux_net
|
|
+from nova.network import freebsd_net
|
|
from nova import utils
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
@@ -134,6 +135,66 @@ class LinuxNetL3(L3Driver):
|
|
pass
|
|
|
|
|
|
+class FreeBSDNetL3(L3Driver):
|
|
+ """L3 driver that uses freebsd_net as the backend."""
|
|
+ def __init__(self):
|
|
+ self.initialized = False
|
|
+
|
|
+ def initialize(self, **kwargs):
|
|
+ if self.initialized:
|
|
+ return
|
|
+ LOG.debug("Initializing freebsd_net L3 driver")
|
|
+ fixed_range = kwargs.get('fixed_range', False)
|
|
+ networks = kwargs.get('networks', None)
|
|
+ if not fixed_range and networks is not None:
|
|
+ for network in networks:
|
|
+ if network['enable_dhcp']:
|
|
+ is_ext = (network['dhcp_server'] is not None and
|
|
+ network['dhcp_server'] != network['gateway'])
|
|
+ self.initialize_network(network['cidr'], is_ext)
|
|
+ freebsd_net.ensure_metadata_ip()
|
|
+ freebsd_net.metadata_forward()
|
|
+ self.initialized = True
|
|
+
|
|
+ def is_initialized(self):
|
|
+ return self.initialized
|
|
+
|
|
+ def initialize_network(self, cidr, is_external):
|
|
+ freebsd_net.init_host(cidr, is_external)
|
|
+
|
|
+ def initialize_gateway(self, network_ref):
|
|
+ mac_address = utils.generate_mac_address()
|
|
+ dev = freebsd_net.plug(network_ref, mac_address,
|
|
+ gateway=(network_ref['gateway'] is not None))
|
|
+ freebsd_net.initialize_gateway_device(dev, network_ref)
|
|
+
|
|
+ def remove_gateway(self, network_ref):
|
|
+ freebsd_net.unplug(network_ref)
|
|
+
|
|
+ def add_floating_ip(self, floating_ip, fixed_ip, l3_interface_id,
|
|
+ network=None):
|
|
+ freebsd_net.ensure_floating_forward(floating_ip, fixed_ip,
|
|
+ l3_interface_id, network)
|
|
+ freebsd_net.bind_floating_ip(floating_ip, l3_interface_id)
|
|
+
|
|
+ def remove_floating_ip(self, floating_ip, fixed_ip, l3_interface_id,
|
|
+ network=None):
|
|
+ freebsd_net.unbind_floating_ip(floating_ip, l3_interface_id)
|
|
+ freebsd_net.remove_floating_forward(floating_ip, fixed_ip,
|
|
+ l3_interface_id, network)
|
|
+ freebsd_net.clean_conntrack(fixed_ip)
|
|
+
|
|
+ def add_vpn(self, public_ip, port, private_ip):
|
|
+ freebsd_net.ensure_vpn_forward(public_ip, port, private_ip)
|
|
+
|
|
+ def remove_vpn(self, public_ip, port, private_ip):
|
|
+ # FreeBSD net currently doesn't implement any way of removing
|
|
+ # the VPN forwarding rules
|
|
+ pass
|
|
+
|
|
+ def teardown(self):
|
|
+ pass
|
|
+
|
|
class NullL3(L3Driver):
|
|
"""The L3 driver that doesn't do anything. This class can be used when
|
|
nova-network should not manipulate L3 forwarding at all (e.g., in a Flat
|
|
--
|
|
2.8.1
|