Initial baseline of hypervisor snap

This commit is contained in:
James Page 2016-11-24 09:16:50 +00:00
commit dcd50354c3
8 changed files with 189 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
parts
prime
stage
*.snap
.tox

16
snap/bin/ovs-wrapper Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
export OVS_LOGDIR=${SNAP_COMMON}/log/openvswitch
export OVS_RUNDIR=${SNAP_COMMON}/run/openvswitch
export OVS_SYSCONFDIR=${SNAP_COMMON}/etc
export OVS_PKGDATADIR=${SNAP}/share/openvswitch
export OVS_BINDIR=${SNAP}/bin
export OVS_SBINDIR=${SNAP}/sbin
mkdir -p ${OVS_LOGDIR}
mkdir -p ${OVS_RUNDIR}
mkdir -p ${OVS_SYSCONFDIR}/openvswitch
exec $@

View File

@ -0,0 +1,6 @@
[DEFAULT]
[AGENT]
# Disable root_helper for snap usage
root_helper =

6
snap/etc/nova/nova.conf Normal file
View File

@ -0,0 +1,6 @@
[DEFAULT]
compute_driver = libvirt.LibvirtDriver
root_helper =
[libvirt]
virt_type = kvm

30
snap/snap-openstack.yaml Normal file
View File

@ -0,0 +1,30 @@
setup:
dirs:
- "{snap_common}/etc/nova.conf.d"
- "{snap_common}/etc/nova"
- "{snap_common}/etc/neutron.conf.d"
- "{snap_common}/etc/neutron"
- "{snap_common}/log"
- "{snap_common}/lock"
- "{snap_common}/run"
- "{snap_common}/instances"
templates:
"nova-snap.conf.j2": "{snap_common}/etc/nova.conf.d/nova-snap.conf"
"neutron-snap.conf.j2": "{snap_common}/etc/neutron.conf.d/neutron-snap.conf"
entry_points:
nova-compute:
binary: nova-compute
config-files:
- "{snap}/etc/nova/nova.conf"
- "{snap_common}/etc/nova/nova.conf"
config-dirs:
- "{snap_common}/etc/nova.conf.d"
log-file: "{snap_common}/log/nova-compute.log"
neutron-openvswitch-agent:
binary: neutron-openvswitch-agent
config-files:
- "{snap}/etc/neutron/neutron.conf"
- "{snap_common}/etc/neutron/neutron.conf"
config-dirs:
- "{snap_common}/etc/neutron.conf.d"
log-file: "{snap_common}/log/neutron-openvswitch-agent.log"

View File

@ -0,0 +1,7 @@
[DEFAULT]
# Set state path to writable directory
state_path = {{ snap_common }}
[oslo_concurrency]
# Oslo Concurrency lock path
lock_path = {{ snap_common }}/lock

View File

@ -0,0 +1,7 @@
[DEFAULT]
# Set state path to writable directory
state_path = {{ snap_common }}
[oslo_concurrency]
# Oslo Concurrency lock path
lock_path = {{ snap_common }}/lock

112
snapcraft.yaml Normal file
View File

@ -0,0 +1,112 @@
name: nova-hypervisor
version: ocata
summary: OpenStack Compute Service - KVM Hypervisor (nova)
description: |
OpenStack Nova provides a cloud computing fabric controller,
supporting a wide variety of compute technologies, including
.
libvirt (KVM, Xen, LXC and more),
LXD
Hyper-V
VMware
XenServer
OpenStack Ironic.
.
This snap provides the hypervisor component of an OpenStack
deployment, configured to use Libvirt/KVM + Open vSwitch.
confinement: strict
grade: devel
apps:
nova-compute:
command: snap-openstack nova-compute
daemon: simple
plugs:
- network
- network-control
- firewall-control
- system-trace
- libvirt
neutron-openvswitch-agent:
command: snap-openstack neutron-openvswitch-agent
daemon: simple
plugs:
- network
- network-bind
- network-control
- firewall-control
- process-control
- system-trace
- system-observe
openvswitch:
command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl start --system-id=random
stop-command: ovs-wrapper $SNAP/share/openvswitch/scripts/ovs-ctl stop
daemon: forking
plugs:
- network
- network-bind
- network-control
- openvswitch-support
- process-control
- system-trace
ovs-vsctl:
command: ovs-wrapper $SNAP/bin/ovs-vsctl
plugs:
- network
ovs-appctl:
command: ovs-wrapper $SNAP/bin/ovs-appctl
plugs:
- network
ovs-ofctl:
command: ovs-wrapper $SNAP/bin/ovs-ofctl
plugs:
- network
ovs-dpctl:
command: ovs-wrapper $SNAP/bin/ovs-dpctl
plugs:
- network
parts:
openvswitch:
source: http://openvswitch.org/releases/openvswitch-2.6.1.tar.gz
plugin: autotools
build-packages:
- libssl-dev
- libnuma-dev
- python-all
- python-six
- python-setuptools
stage-packages:
- uuid-runtime
configflags:
- "--localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common"
- "--sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/etc"
nova:
after:
- openvswitch
plugin: python
python-version: python2
source: http://tarballs.openstack.org/nova/nova-master.tar.gz
python-packages:
- pymysql
- libvirt-python
- python-memcached
- http://tarballs.openstack.org/neutron/neutron-master.tar.gz
- http://tarballs.openstack.org/nova-lxd/nova-lxd-master.tar.gz
- git+https://github.com/openstack-snaps/snap.openstack#egg=snap.openstack
constraints: https://raw.githubusercontent.com/openstack/requirements/master/upper-constraints.txt
build-packages:
- libffi-dev
- libssl-dev
- libxml2-dev
- libxslt1-dev
- libvirt-dev
- pkg-config
- gcc
stage-packages:
- qemu-utils
templates:
after:
- nova
- openvswitch
plugin: dump
source: snap