Add emulators/py-nova 14.0.2, Openstack Compute Service

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)
This commit is contained in:
Roman Bogorodskiy 2016-12-18 06:30:58 +00:00
parent 570d3f1ea4
commit b7e05e4ed3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=428837
25 changed files with 2340 additions and 2 deletions

2
GIDs
View File

@ -137,7 +137,7 @@ moinmoin:*:192:
cups:*:193:
saned:*:194:
radns:*:195:
# free: 196
nova:*:196:
# free: 197
# free: 198
mcserver:*:199:

2
UIDs
View File

@ -142,7 +142,7 @@ moinmoin:*:192:192::0:0:MoinMoin User:/nonexistent:/usr/sbin/nologin
cups:*:193:193::0:0:Cups Owner:/nonexistent:/usr/sbin/nologin
saned:*:194:194::0:0:SANE Scanner Daemon:/nonexistent:/bin/sh
radns:*:195:195::0:0:radns user:/nonexistent:/usr/sbin/nologin
# free: 196
nova:*:196:196::0:0:Nova daemon pseudo-user:/var/lib/nova:/usr/sbin/nologin
# free: 197
# free: 198
mcserver:*:199:199::0:0:Minecraft Server:/nonexistent:/bin/sh

View File

@ -115,6 +115,7 @@
SUBDIR += ppsspp-qt4
SUBDIR += ppsspp-qt5
SUBDIR += py-gns3-converter
SUBDIR += py-nova
SUBDIR += q4wine
SUBDIR += qemu
SUBDIR += qemu-cheri

141
emulators/py-nova/Makefile Normal file
View File

@ -0,0 +1,141 @@
# Created by: Alexander Nusov <alexander.nusov@nfvexpress.com>
# $FreeBSD$
PORTNAME= nova
PORTVERSION= 14.0.2
CATEGORIES= emulators python
MASTER_SITES= https://fossies.org/linux/misc/openstack/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= alexander.nusov@nfvexpress.com
COMMENT= OpenStack compute service
LICENSE= APACHE20
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pbr>=1.6:devel/py-pbr
RUN_DEPENDS:= ${BUILD_DEPENDS}
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}sqlalchemy10>=0:databases/py-sqlalchemy10 \
${PYTHON_PKGNAMEPREFIX}boto>=2.32.1:devel/py-boto \
${PYTHON_PKGNAMEPREFIX}decorator>=3.4.0:devel/py-decorator \
${PYTHON_PKGNAMEPREFIX}eventlet>=0:net/py-eventlet \
${PYTHON_PKGNAMEPREFIX}Jinja2>=2.8:devel/py-Jinja2 \
${PYTHON_PKGNAMEPREFIX}keystonemiddleware>=0:devel/py-keystonemiddleware \
${PYTHON_PKGNAMEPREFIX}lxml>=2.3:devel/py-lxml \
${PYTHON_PKGNAMEPREFIX}routes>=0:www/py-routes \
${PYTHON_PKGNAMEPREFIX}cryptography>=0:security/py-cryptography \
${PYTHON_PKGNAMEPREFIX}webob>=1.2.3:www/py-webob \
${PYTHON_PKGNAMEPREFIX}greenlet>=0.3.2:devel/py-greenlet \
${PYTHON_PKGNAMEPREFIX}PasteDeploy>=1.5.0:www/py-pastedeploy \
${PYTHON_PKGNAMEPREFIX}Paste>=0:www/py-paste \
${PYTHON_PKGNAMEPREFIX}prettytable>=0:devel/py-prettytable \
${PYTHON_PKGNAMEPREFIX}sqlalchemy-migrate>=0.9.6:databases/py-sqlalchemy-migrate \
${PYTHON_PKGNAMEPREFIX}netaddr>=0:net/py-netaddr \
${PYTHON_PKGNAMEPREFIX}netifaces>=0.10.4:net/py-netifaces \
${PYTHON_PKGNAMEPREFIX}paramiko>=2.0:security/py-paramiko \
${PYTHON_PKGNAMEPREFIX}Babel>=2.3.4:devel/py-babel \
${PYTHON_PKGNAMEPREFIX}iso8601>=0.1.11:devel/py-iso8601 \
${PYTHON_PKGNAMEPREFIX}jsonschema>=0:devel/py-jsonschema \
${PYTHON_PKGNAMEPREFIX}python-cinderclient>=0:net/py-python-cinderclient \
${PYTHON_PKGNAMEPREFIX}keystoneauth1>=2.10.0:devel/py-keystoneauth1 \
${PYTHON_PKGNAMEPREFIX}python-neutronclient>=5.1.0:net/py-python-neutronclient \
${PYTHON_PKGNAMEPREFIX}python-glanceclient>=0:net/py-python-glanceclient \
${PYTHON_PKGNAMEPREFIX}requests>=2.10.0:www/py-requests \
${PYTHON_PKGNAMEPREFIX}six>=1.9.0:devel/py-six \
${PYTHON_PKGNAMEPREFIX}stevedore>=1.16.0:devel/py-stevedore \
${PYTHON_PKGNAMEPREFIX}websockify>=0.8.0:devel/py-websockify \
${PYTHON_PKGNAMEPREFIX}oslo.cache>=1.5.0:devel/py-oslo.cache \
${PYTHON_PKGNAMEPREFIX}oslo.concurrency>=3.8.0:devel/py-oslo.concurrency \
${PYTHON_PKGNAMEPREFIX}oslo.config>=3.14.0:devel/py-oslo.config \
${PYTHON_PKGNAMEPREFIX}oslo.context>=2.9.0:devel/py-oslo.context \
${PYTHON_PKGNAMEPREFIX}oslo.log>=1.14.0:devel/py-oslo.log \
${PYTHON_PKGNAMEPREFIX}oslo.reports>=0.6.0:devel/py-oslo.reports \
${PYTHON_PKGNAMEPREFIX}oslo.serialization>=1.10.0:devel/py-oslo.serialization \
${PYTHON_PKGNAMEPREFIX}oslo.utils>=3.16.0:devel/py-oslo.utils \
${PYTHON_PKGNAMEPREFIX}oslo.db>=0:devel/py-oslo.db \
${PYTHON_PKGNAMEPREFIX}oslo.rootwrap>=5.0.0:devel/py-oslo.rootwrap \
${PYTHON_PKGNAMEPREFIX}oslo.messaging>=5.2.0:devel/py-oslo.messaging \
${PYTHON_PKGNAMEPREFIX}oslo.policy>=1.9.0:devel/py-oslo.policy \
${PYTHON_PKGNAMEPREFIX}oslo.privsep>=1.9.0:devel/py-oslo.privsep \
${PYTHON_PKGNAMEPREFIX}oslo.i18n>=2.1.0:devel/py-oslo.i18n \
${PYTHON_PKGNAMEPREFIX}oslo.service>=1.10.0:devel/py-oslo.service \
${PYTHON_PKGNAMEPREFIX}rfc3986>=0.2.2:www/py-rfc3986 \
${PYTHON_PKGNAMEPREFIX}oslo.middleware>=3.0.0:devel/py-oslo.middleware \
${PYTHON_PKGNAMEPREFIX}psutil121>=0:sysutils/py-psutil121 \
${PYTHON_PKGNAMEPREFIX}oslo.versionedobjects>=1.13.0:devel/py-oslo.versionedobjects \
${PYTHON_PKGNAMEPREFIX}os-brick>=1.6.1:devel/py-os-brick \
${PYTHON_PKGNAMEPREFIX}os-vif>=1.1.0:devel/py-os-vif \
${PYTHON_PKGNAMEPREFIX}os-win>=0.2.3:devel/py-os-win \
${PYTHON_PKGNAMEPREFIX}castellan>=0.4.0:devel/py-castellan \
${PYTHON_PKGNAMEPREFIX}microversion-parse>=0.1.2:devel/py-microversion-parse \
${PYTHON_PKGNAMEPREFIX}wsgi_intercept>=0.6.1:devel/py-wsgi_intercept \
${PYTHON_PKGNAMEPREFIX}sqlparse>=0:databases/py-sqlparse \
${PYTHON_PKGNAMEPREFIX}libvirt>=0:devel/py-libvirt \
e2fsprogs>=0:sysutils/e2fsprogs \
arping>=0:net/arping
EXTRA_PATCHES= ${FILESDIR}/01-firewall-manager.patch:-p1 \
${FILESDIR}/02-freebsd-l3.patch:-p1 \
${FILESDIR}/03-nova-conf.patch:-p1 \
${FILESDIR}/04-xen-phy.patch:-p1 \
${FILESDIR}/05-online-cpus.patch:-p1 \
${FILESDIR}/06-freebsd-net.patch:-p1
ONLY_FOR_ARCHS= amd64
USES= python
USE_PYTHON= autoplist distutils noegginfo
USE_RC_SUBR= nova-api \
nova-consoleauth \
nova-conductor \
nova-scheduler \
nova-network \
nova-compute \
nova-cert \
nova-cells \
nova-serialproxy
USERS= nova
GROUPS= nova
.include <bsd.port.options.mk>
.if ${OPSYS} != FreeBSD
IGNORE= only supported on FreeBSD
.endif
.if ${OSVERSION} < 1100055
IGNORE= only supported on recent FreeBSD 11
.endif
post-extract:
@(cd ${WRKSRC}/etc/nova; ${MV} logging_sample.conf logging.conf.sample)
@(cd ${WRKSRC}/etc/nova; for f in *.conf; do ${MV} $${f} $${f}.sample; done)
post-patch:
${CP} ${FILESDIR}/nova.conf.sample \
${WRKSRC}/etc/nova/nova.conf.sample
${CP} ${FILESDIR}/nova-compute.conf.sample \
${WRKSRC}/etc/nova/nova-compute.conf.sample
${REINPLACE_CMD} -e "s|/etc|${PREFIX}/etc|g" \
${WRKSRC}/nova/api/openstack/placement/wsgi.py \
${WRKSRC}/nova/conf/base.py \
${WRKSRC}/nova/conf/cloudpipe.py \
${WRKSRC}/nova/conf/network.py \
${WRKSRC}/nova/conf/remote_debug.py \
${WRKSRC}/nova/conf/xvp.py \
${WRKSRC}/nova/hacking/checks.py \
${WRKSRC}/nova/network/linux_net.py \
${WRKSRC}/nova/network/manager.py \
${WRKSRC}/nova/virt/disk/api.py \
${WRKSRC}/nova/virt/disk/vfs/guestfs.py \
${WRKSRC}/nova/virt/libvirt/driver.py \
${WRKSRC}/nova/virt/xenapi/agent.py \
${WRKSRC}/nova/wsgi/nova-api.py \
${WRKSRC}/nova/wsgi/nova-metadata.py
post-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
${CP} -R ${WRKSRC}/etc/nova/ ${STAGEDIR}${ETCDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1478994869
SHA256 (nova-14.0.2.tar.gz) = e98291734b4b16615fb1518161c89749f09ad33b6344feb70d62b69e8161a50d
SIZE (nova-14.0.2.tar.gz) = 5574197

View File

@ -0,0 +1,60 @@
From 60668a502b5f7af77861507e94a89b7f4201c2cb Mon Sep 17 00:00:00 2001
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
Date: Tue, 8 Nov 2016 16:52:29 +0300
Subject: [PATCH] add get_firewall_manager
---
nova/network/linux_net.py | 4 ++++
nova/network/manager.py | 8 ++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index b10fa28..2637e26 100644
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -1898,3 +1898,7 @@ def set_vf_interface_vlan(pci_addr, mac_addr, vlan=0):
port_state,
run_as_root=True,
check_exit_code=exit_code)
+
+
+def get_firewall_manager():
+ return iptables_manager
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 9de53d9..f6eb106 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -1799,13 +1799,13 @@ class FlatDHCPManager(RPCAllocateFixedIP, floating_ips.FloatingIP,
ctxt = context.get_admin_context()
networks = objects.NetworkList.get_by_host(ctxt, self.host)
- self.driver.iptables_manager.defer_apply_on()
+ self.driver.get_firewall_manager().defer_apply_on()
self.l3driver.initialize(fixed_range=False, networks=networks)
super(FlatDHCPManager, self).init_host()
self.init_host_floating_ips()
- self.driver.iptables_manager.defer_apply_off()
+ self.driver.get_firewall_manager().defer_apply_off()
def _setup_network_on_host(self, context, network):
"""Sets up network on this host."""
@@ -1887,13 +1887,13 @@ class VlanManager(RPCAllocateFixedIP, floating_ips.FloatingIP, NetworkManager):
ctxt = context.get_admin_context()
networks = objects.NetworkList.get_by_host(ctxt, self.host)
- self.driver.iptables_manager.defer_apply_on()
+ self.driver.get_firewall_manager().defer_apply_on()
self.l3driver.initialize(fixed_range=False, networks=networks)
NetworkManager.init_host(self)
self.init_host_floating_ips()
- self.driver.iptables_manager.defer_apply_off()
+ self.driver.get_firewall_manager().defer_apply_off()
def allocate_fixed_ip(self, context, instance_id, network, **kwargs):
"""Gets a fixed IP from the pool."""
--
2.8.1

View File

@ -0,0 +1,90 @@
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

View File

@ -0,0 +1,51 @@
diff --git a/nova/conf/network.py b/nova/conf/network.py
index 3bb4cd9..eb57041 100644
--- a/nova/conf/network.py
+++ b/nova/conf/network.py
@@ -704,6 +704,30 @@ Related options:
"""),
]
+freebsd_net_opts = [
+ cfg.StrOpt("freebsdnet_interface_driver",
+ default="nova.network.freebsd.FreeBSDBridgeInterfaceDriver",
+ help="""
+This is the class used as the ethernet device driver for freebsdnet bridge
+operations. The default value should be all you need for most cases, but if you
+wish to use a customized class, set this option to the full dot-separated
+import path for that class.
+
+Possible values:
+
+ Any string representing a dot-separated class path that Nova can import.
+"""),
+ cfg.StrOpt("freebsdnet_ovs_integration_bridge",
+ default="br-int",
+ help="""
+The name of the Open vSwitch bridge that is used with freebsdnet when connecting
+with Open vSwitch."
+
+Possible values:
+
+ Any string representing a valid bridge name.
+"""),
+]
ldap_dns_opts = [
cfg.StrOpt('ldap_dns_url',
@@ -766,12 +790,13 @@ by using this option.
'some rpc network calls will be sent directly to host.'),
]
-ALL_DEFAULT_OPTS = (linux_net_opts + network_opts + ldap_dns_opts
+ALL_DEFAULT_OPTS = (linux_net_opts + freebsd_net_opts + network_opts + ldap_dns_opts
+ rpcapi_opts + driver_opts)
def register_opts(conf):
conf.register_opts(linux_net_opts)
+ conf.register_opts(freebsd_net_opts)
conf.register_opts(network_opts)
conf.register_opts(ldap_dns_opts)
conf.register_opts(driver_opts)

View File

@ -0,0 +1,42 @@
From b4e9024ac90ed0eaf155bc24ef7ee3b01112366e Mon Sep 17 00:00:00 2001
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
Date: Tue, 15 Nov 2016 13:08:49 +0300
Subject: [PATCH] foce xen phy option
---
nova/conf/libvirt.py | 3 +++
nova/virt/libvirt/utils.py | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/nova/conf/libvirt.py b/nova/conf/libvirt.py
index bfb278e..2eba080 100644
--- a/nova/conf/libvirt.py
+++ b/nova/conf/libvirt.py
@@ -498,6 +498,9 @@ libvirt_imagebackend_opts = [
help='Discard option for nova managed disks. Need'
' Libvirt(1.0.6) Qemu1.5 (raw format) Qemu1.6(qcow2'
' format)'),
+ cfg.BoolOpt('force_xen_phy',
+ default=False,
+ help='Force using of PHY driver in Xen'),
]
libvirt_imagecache_opts = [
diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py
index f0a4796..ff68d45 100644
--- a/nova/virt/libvirt/utils.py
+++ b/nova/virt/libvirt/utils.py
@@ -112,7 +112,7 @@ def pick_disk_driver_name(hypervisor_version, is_block_dev=False):
:returns: driver_name or None
"""
if CONF.libvirt.virt_type == "xen":
- if is_block_dev:
+ if is_block_dev or CONF.libvirt.force_xen_phy:
return "phy"
else:
# 4002000 == 4.2.0
--
2.8.1

View File

@ -0,0 +1,63 @@
From 8eb8fb92f21243ae0e41f2f626398d09582de29b Mon Sep 17 00:00:00 2001
From: Alexander Nusov <alexander.nusov@nfvexpress.com>
Date: Fri, 25 Nov 2016 17:36:10 +0300
Subject: [PATCH] add online cpu tracking option
---
nova/conf/libvirt.py | 3 +++
nova/virt/libvirt/driver.py | 18 +++++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/nova/conf/libvirt.py b/nova/conf/libvirt.py
index 2eba080..d133b03 100644
--- a/nova/conf/libvirt.py
+++ b/nova/conf/libvirt.py
@@ -471,6 +471,9 @@ events`, refer https://libvirt.org/formatdomain.html#elementsPerf .
None
"""),
+ cfg.BoolOpt('online_cpu_tracking',
+ default=True,
+ help='Enable online cpu tracking'),
]
libvirt_imagebackend_opts = [
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index f9225de..f19ef70 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -5188,11 +5188,12 @@ class LibvirtDriver(driver.ComputeDriver):
cells = []
allowed_cpus = hardware.get_vcpu_pin_set()
- online_cpus = self._host.get_online_cpus()
- if allowed_cpus:
- allowed_cpus &= online_cpus
- else:
- allowed_cpus = online_cpus
+ if CONF.libvirt.online_cpu_tracking:
+ online_cpus = self._host.get_online_cpus()
+ if allowed_cpus:
+ allowed_cpus &= online_cpus
+ else:
+ allowed_cpus = online_cpus
def _get_reserved_memory_for_cell(self, cell_id, page_size):
cell = self._reserved_hugepages.get(cell_id, {})
@@ -5205,8 +5206,11 @@ class LibvirtDriver(driver.ComputeDriver):
if cpu.siblings else ()
for cpu in cell.cpus)
))
- cpuset &= allowed_cpus
- siblings = [sib & allowed_cpus for sib in siblings]
+ if CONF.libvirt.online_cpu_tracking or allowed_cpus:
+ cpuset &= allowed_cpus
+ siblings = [sib & allowed_cpus for sib in siblings]
+
+
# Filter out singles and empty sibling sets that may be left
siblings = [sib for sib in siblings if len(sib) > 1]
--
2.8.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_api
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_api:
#
# nova_api_enable="YES"
#
# nova_api_enable (bool):
# Set it to "YES" to enable nova_api.
# Default is "NO".
#
# nova_api_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_api_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_api_logdir}/nova-api.log"
#
. /etc/rc.subr
name=nova_api
rcvar=nova_api_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-api.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_api_enable:="NO"}
: ${nova_api_logdir:="/var/log/nova"}
: ${nova_api_args:="--log-file ${nova_api_logdir}/nova-api.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-api ${nova_api_args}"
nova_precmd() {
mkdir -p ${nova_api_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_cells
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_cells:
#
# nova_cells_enable="YES"
#
# nova_cells_enable (bool):
# Set it to "YES" to enable nova_cells.
# Default is "NO".
#
# nova_cells_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_cells_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_cells_logdir}/nova-cells.log"
#
. /etc/rc.subr
name=nova_cells
rcvar=nova_cells_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-cells.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_cells_enable:="NO"}
: ${nova_cells_logdir:="/var/log/nova"}
: ${nova_cells_args:="--log-file ${nova_cells_logdir}/nova-cells.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-cells ${nova_cells_args}"
nova_precmd() {
mkdir -p ${nova_cells_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_cert
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_cert:
#
# nova_cert_enable="YES"
#
# nova_cert_enable (bool):
# Set it to "YES" to enable nova_cert.
# Default is "NO".
#
# nova_cert_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_cert_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_cert_logdir}/nova-cert.log"
#
. /etc/rc.subr
name=nova_cert
rcvar=nova_cert_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-cert.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_cert_enable:="NO"}
: ${nova_cert_logdir:="/var/log/nova"}
: ${nova_cert_args:="--log-file ${nova_cert_logdir}/nova-cert.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-cert ${nova_cert_args}"
nova_precmd() {
mkdir -p ${nova_cert_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,15 @@
[DEFAULT]
compute_driver=libvirt.LibvirtDriver
force_raw_images = True
use_cow_images = False
[libvirt]
virt_type=qemu
# Force using PHY driver for Xen hypervisor
force_xen_phy=True
# Disable CPU tracking when using QEMU driver.
# Change this option to True when using Xen driver.
online_cpu_tracking=False

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_compute
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_compute:
#
# nova_compute_enable="YES"
#
# nova_compute_enable (bool):
# Set it to "YES" to enable nova_compute.
# Default is "NO".
#
# nova_compute_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_compute_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_compute_logdir}/nova-compute.log"
#
. /etc/rc.subr
name=nova_compute
rcvar=nova_compute_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-compute.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_compute_enable:="NO"}
: ${nova_compute_logdir:="/var/log/nova"}
: ${nova_compute_args:="--log-file ${nova_compute_logdir}/nova-compute.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-compute ${nova_compute_args}"
nova_precmd() {
mkdir -p ${nova_compute_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_conductor
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_conductor:
#
# nova_conductor_enable="YES"
#
# nova_conductor_enable (bool):
# Set it to "YES" to enable nova_conductor.
# Default is "NO".
#
# nova_conductor_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_conductor_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_conductor_logdir}/nova-conductor.log"
#
. /etc/rc.subr
name=nova_conductor
rcvar=nova_conductor_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-conductor.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_conductor_enable:="NO"}
: ${nova_conductor_logdir:="/var/log/nova"}
: ${nova_conductor_args:="--log-file ${nova_conductor_logdir}/nova-conductor.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-conductor ${nova_conductor_args}"
nova_precmd() {
mkdir -p ${nova_conductor_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_consoleauth
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_consoleauth:
#
# nova_consoleauth_enable="YES"
#
# nova_consoleauth_enable (bool):
# Set it to "YES" to enable nova_consoleauth.
# Default is "NO".
#
# nova_consoleauth_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_consoleauth_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_consoleauth_logdir}/nova-consoleauth.log"
#
. /etc/rc.subr
name=nova_consoleauth
rcvar=nova_consoleauth_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-consoleauth.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_consoleauth_enable:="NO"}
: ${nova_consoleauth_logdir:="/var/log/nova"}
: ${nova_consoleauth_args:="--log-file ${nova_consoleauth_logdir}/nova-consoleauth.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-consoleauth ${nova_consoleauth_args}"
nova_precmd() {
mkdir -p ${nova_consoleauth_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_network
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_network:
#
# nova_network_enable="YES"
#
# nova_network_enable (bool):
# Set it to "YES" to enable nova_network.
# Default is "NO".
#
# nova_network_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_network_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_network_logdir}/nova-network.log"
#
. /etc/rc.subr
name=nova_network
rcvar=nova_network_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-network.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_network_enable:="NO"}
: ${nova_network_logdir:="/var/log/nova"}
: ${nova_network_args:="--log-file ${nova_network_logdir}/nova-network.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-network ${nova_network_args}"
nova_precmd() {
mkdir -p ${nova_network_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_scheduler
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_scheduler:
#
# nova_scheduler_enable="YES"
#
# nova_scheduler_enable (bool):
# Set it to "YES" to enable nova_scheduler.
# Default is "NO".
#
# nova_scheduler_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_scheduler_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_scheduler_logdir}/nova-scheduler.log"
#
. /etc/rc.subr
name=nova_scheduler
rcvar=nova_scheduler_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-scheduler.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_scheduler_enable:="NO"}
: ${nova_scheduler_logdir:="/var/log/nova"}
: ${nova_scheduler_args:="--log-file ${nova_scheduler_logdir}/nova-scheduler.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-scheduler ${nova_scheduler_args}"
nova_precmd() {
mkdir -p ${nova_scheduler_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,53 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: nova_serialproxy
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable nova_serialproxy:
#
# nova_serialproxy_enable="YES"
#
# nova_serialproxy_enable (bool):
# Set it to "YES" to enable nova_serialproxy.
# Default is "NO".
#
# nova_serialproxy_logdir (str):
# Set it to chagge log directory
# Default is "/var/log/nova"
#
# nova_serialproxy_args (str):
# Set it to change command line arguments.
# Default is "--log-file ${nova_serialproxy_logdir}/nova-serialproxy.log"
#
. /etc/rc.subr
name=nova_serialproxy
rcvar=nova_serialproxy_enable
PATH=%%PREFIX%%/bin:%%PREFIX%%/sbin:$PATH
pidfile="/var/run/nova-serialproxy.pid"
procname="%%PREFIX%%/bin/python2.7"
start_precmd=nova_precmd
load_rc_config $name
: ${nova_serialproxy_enable:="NO"}
: ${nova_serialproxy_logdir:="/var/log/nova"}
: ${nova_serialproxy_args:="--log-file ${nova_serialproxy_logdir}/nova-serialproxy.log"}
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} nova-serialproxy ${nova_serialproxy_args}"
nova_precmd() {
mkdir -p ${nova_serialproxy_logdir}
}
run_rc_command "$1"

View File

@ -0,0 +1,80 @@
[DEFAULT]
dhcpbridge_flagfile=/usr/local/etc/nova/nova.conf
dhcpbridge=/usr/local/bin/nova-dhcpbridge
log-dir=/var/log/nova
state_path=/var/lib/nova
force_dhcp_release=False
verbose=True
ec2_private_dns_show_ip=True
enabled_apis=osapi_compute,metadata
rpc_backend = rabbit
auth_strategy = keystone
my_ip = 192.168.1.10
use_neutron = False
firewall_driver = nova.virt.firewall.NoopFirewallDriver
use_ipv6 = False
osapi_compute_listen="0.0.0.0"
osapi_compute_listen_port=8774
network_driver=nova.network.freebsd_net
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
freebsdnet_interface_driver=nova.network.freebsd_net.FreeBSDBridgeInterfaceDriver
l3_lib=nova.network.l3.FreeBSDNetL3
network_api_class=nova.network.api.API
security_group_api=nova
network_manager=nova.network.manager.FlatDHCPManager
network_size=254
allow_same_net_traffic=False
multi_host=True
send_arp_for_ha=False
share_dhcp_address=True
# specify nic for public
public_interface=em0
# specify any name you like for bridge
flat_network_bridge=br100
flat_interface=tap0
[vnc]
enabled = False
[glance]
api_servers = http://controller:9292
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS
[api_database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
[oslo_concurrency]
lock_path=/var/lock/nova
[libvirt]
use_virtio_for_bridges=True
# add this options when using QEMU
cpu_mode=none
[wsgi]
api_paste_config=/usr/local/etc/nova/api-paste.ini
[serial_console]
# Enable serial console when using QEMU driver
enabled=True

View File

@ -0,0 +1,5 @@
OpenStack Nova provides a cloud computing fabric controller, supporting a wide
variety of compute technologies, including: libvirt (KVM, Xen, LXC and more),
Hyper-V, VMware, XenServer and OpenStack Ironic.
WWW: http://openstack.org/nova

View File

@ -0,0 +1,47 @@
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 doesn'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
Nova requires procfs to be mounted.
Please add this line to /etc/fstab:
proc /proc procfs rw 0 0
Also devel/libvirt port should be installed with enabled QEMU
backend or qemu tools installed separately.
Directory to keep VM data should be created manually
# su -m nova -c "mkdir /var/lib/nova/instances"
For proper networking enable PF
# sysrc pf_enable="YES"
# sysrc pflog_enable="YES"
# sysrc gateway_enable="YES"
/etc/pf.conf should contain:
rdr-anchor "org.openstack/*"
nat-anchor "org.openstack/*"
anchor "org.openstack/*"
To boot images on Xen please specify glance metadata properties
glance image-update b1216ff6-23ec-4a08-baee-43994760158a \
--property hypervisor_type=xen \
--property vm_mode=hvm \
--property hw_disk_bus=xen

View File

@ -0,0 +1,18 @@
@owner nova
@dir %%ETCDIR%%
%%ETCDIR%%/release.sample
@sample %%ETCDIR%%/nova.conf.sample
@sample %%ETCDIR%%/nova-compute.conf.sample
@sample %%ETCDIR%%/logging.conf.sample
%%ETCDIR%%/README-nova.conf.txt
%%ETCDIR%%/api-paste.ini
%%ETCDIR%%/cells.json
@sample %%ETCDIR%%/nova-config-generator.conf.sample
@sample %%ETCDIR%%/nova-policy-generator.conf.sample
%%ETCDIR%%/policy.json
@owner root
@sample %%ETCDIR%%/rootwrap.conf.sample
@dir %%ETCDIR%%/rootwrap.d
%%ETCDIR%%/rootwrap.d/api-metadata.filters
%%ETCDIR%%/rootwrap.d/compute.filters
%%ETCDIR%%/rootwrap.d/network.filters