aboutsummaryrefslogtreecommitdiff
path: root/docker/centos/binary/nova-base
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-05-13 06:46:24 -0500
committerSam Yaple <sam@yaple.net>2015-05-15 01:32:22 -0500
commit13062e23e86b5d86020949754540460cb5b0b4fe (patch)
treee0b3c8411418949a3d8df221da7c8cb2831b6d5d /docker/centos/binary/nova-base
parent354ba01c8f5c7e1695cbea3bfc07aee5b75e76d9 (diff)
downloadkolla-13062e23e86b5d86020949754540460cb5b0b4fe.tar.gz
kolla-13062e23e86b5d86020949754540460cb5b0b4fe.zip
Restructure builds to allow more flexibility
As a restructure, nothing is changed from the original behaviour and naming despite the file structure changing. The symlinks to build had to be updated generating lots of "deleted" and "new_file". The new structure is: docker/${base_distro}/${type}/${container} base_distro == centos, ubuntu, fedora, etc type == source, binary, rdo type rdo is a symlink to binary for backwards compatibility Two new flags are added to the build-all script to support the ability to support different base distros and a flag to support binary or source containers. There are several added folders that are empty to hold the directory structure for future containers of these types. To use a prefix other than centos-rdo- you can set PREFIX in the toplevel directory .buildconf file Change-Id: Ifc7bac0d827470f506c8b5c004a833da9ce13b90
Diffstat (limited to 'docker/centos/binary/nova-base')
-rw-r--r--docker/centos/binary/nova-base/Dockerfile11
l---------docker/centos/binary/nova-base/build1
-rwxr-xr-xdocker/centos/binary/nova-base/config-nova.sh137
3 files changed, 149 insertions, 0 deletions
diff --git a/docker/centos/binary/nova-base/Dockerfile b/docker/centos/binary/nova-base/Dockerfile
new file mode 100644
index 000000000..d116ac973
--- /dev/null
+++ b/docker/centos/binary/nova-base/Dockerfile
@@ -0,0 +1,11 @@
+FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+RUN yum -y install openstack-nova-common \
+ python-keystoneclient \
+ python-cinderclient \
+ python-nova \
+ bridge-utils && yum clean all
+
+ADD config-nova.sh /opt/kolla/config-nova.sh
+
diff --git a/docker/centos/binary/nova-base/build b/docker/centos/binary/nova-base/build
new file mode 120000
index 000000000..8d652f7ee
--- /dev/null
+++ b/docker/centos/binary/nova-base/build
@@ -0,0 +1 @@
+../../../../tools/build-docker-image \ No newline at end of file
diff --git a/docker/centos/binary/nova-base/config-nova.sh b/docker/centos/binary/nova-base/config-nova.sh
new file mode 100755
index 000000000..b5172ee80
--- /dev/null
+++ b/docker/centos/binary/nova-base/config-nova.sh
@@ -0,0 +1,137 @@
+#!/bin/bash
+
+. /opt/kolla/kolla-common.sh
+
+: ${NOVA_DB_USER:=nova}
+: ${NOVA_DB_NAME:=nova}
+: ${NOVA_KEYSTONE_USER:=admin}
+: ${NOVA_KEYSTONE_PASSWORD:=kolla}
+: ${ADMIN_TENANT_NAME:=admin}
+: ${RABBIT_USERID:=guest}
+: ${RABBIT_PASSWORD:=guest}
+: ${NETWORK_MANAGER:=nova}
+: ${FLAT_NETWORK:=eth1}
+: ${PUBLIC_NETWORK:=eth0}
+: ${ENABLED_APIS:=ec2,osapi_compute,metadata}
+: ${METADATA_HOST:=$PUBLIC_IP}
+: ${NEUTRON_SHARED_SECRET:=sharedsecret}
+
+check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \
+ RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \
+ KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP \
+ PUBLIC_INTERFACE FLAT_INTERFACE DEBUG_LOGGING \
+ VERBOSE_LOGGING
+
+cfg=/etc/nova/nova.conf
+
+crudini --set $cfg DEFAULT amqp_durable_queues False
+crudini --set $cfg DEFAULT rabbit_host ${RABBITMQ_SERVICE_HOST}
+crudini --set $cfg DEFAULT rabbit_port 5672
+crudini --set $cfg DEFAULT rabbit_hosts ${RABBITMQ_SERVICE_HOST}:5672
+crudini --set $cfg DEFAULT rabbit_use_ssl False
+crudini --set $cfg DEFAULT rabbit_userid ${RABBIT_USERID}
+crudini --set $cfg DEFAULT rabbit_password "${RABBIT_PASSWORD}"
+crudini --set $cfg DEFAULT rabbit_virtual_host /
+crudini --set $cfg DEFAULT rabbit_ha_queues False
+crudini --set $cfg DEFAULT rpc_backend nova.openstack.common.rpc.impl_kombu
+crudini --set $cfg DEFAULT enabled_apis ${ENABLED_APIS}
+crudini --set $cfg DEFAULT ec2_listen 0.0.0.0
+crudini --set $cfg DEFAULT osapi_compute_listen 0.0.0.0
+crudini --set $cfg DEFAULT osapi_compute_workers 8
+crudini --set $cfg DEFAULT metadata_host ${METADATA_HOST}
+crudini --set $cfg DEFAULT metadata_listen 0.0.0.0
+crudini --set $cfg DEFAULT metadata_workers 8
+crudini --set $cfg DEFAULT service_down_time 60
+crudini --set $cfg DEFAULT rootwrap_config /etc/nova/rootwrap.conf
+crudini --set $cfg DEFAULT auth_strategy keystone
+crudini --set $cfg DEFAULT use_forwarded_for False
+crudini --set $cfg DEFAULT glance_api_servers ${GLANCE_API_SERVICE_HOST}:9292
+crudini --set $cfg DEFAULT cpu_allocation_ratio 16.0
+crudini --set $cfg DEFAULT ram_allocation_ratio 1.5
+crudini --set $cfg DEFAULT scheduler_default_filters RetryFilter,AvailabilityZoneFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,CoreFilter
+crudini --set $cfg DEFAULT compute_driver nova.virt.libvirt.LibvirtDriver
+crudini --set $cfg DEFAULT vif_plugging_is_fatal True
+crudini --set $cfg DEFAULT vif_plugging_timeout 300
+crudini --set $cfg DEFAULT volume_api_class nova.volume.cinder.API
+crudini --set $cfg DEFAULT image_service nova.image.glance.GlanceImageService
+crudini --set $cfg DEFAULT osapi_volume_listen 0.0.0.0
+crudini --set $cfg DEFAULT instances_path /var/lib/nova/instances
+crudini --set $cfg DEFAULT lock_path /var/lib/nova/lock
+
+# This is not created by openstack-nova packaging
+mkdir -p /var/lib/nova/lock
+
+# configure logging
+crudini --set $cfg DEFAULT log_dir "${NOVA_LOG_DIR}"
+crudini --set $cfg DEFAULT debug "${DEBUG_LOGGING}"
+crudini --set $cfg DEFAULT verbose "${VERBOSE_LOGGING}"
+
+crudini --set $cfg DEFAULT admin_token "${KEYSTONE_ADMIN_TOKEN}"
+
+crudini --set $cfg conductor workers 8
+
+if [ "${NETWORK_MANAGER}" == "nova" ] ; then
+ crudini --set $cfg DEFAULT network_manager nova.network.manager.FlatDHCPManager
+ crudini --set $cfg DEFAULT firewall_driver nova.virt.libvirt.firewall.IptablesFirewallDriver
+ crudini --set $cfg DEFAULT network_size 254
+ crudini --set $cfg DEFAULT allow_same_net_traffic False
+ crudini --set $cfg DEFAULT multi_host True
+ crudini --set $cfg DEFAULT send_arp_for_ha True
+ crudini --set $cfg DEFAULT share_dhcp_address True
+ crudini --set $cfg DEFAULT force_dhcp_release True
+ crudini --set $cfg DEFAULT flat_interface $FLAT_INTERFACE
+ crudini --set $cfg DEFAULT flat_network_bridge br100
+ crudini --set $cfg DEFAULT public_interface $PUBLIC_INTERFACE
+elif [ "${NETWORK_MANAGER}" == "neutron" ] ; then
+ check_required_vars NEUTRON_SHARED_SECRET
+ crudini --set $cfg neutron service_metadata_proxy True
+ crudini --set $cfg neutron metadata_proxy_shared_secret ${NEUTRON_SHARED_SECRET}
+ crudini --set $cfg DEFAULT neutron_default_tenant_id default
+ crudini --set $cfg DEFAULT network_api_class nova.network.neutronv2.api.API
+ crudini --set $cfg DEFAULT security_group_api neutron
+ if [[ "${MECHANISM_DRIVERS}" =~ linuxbridge ]] ; then
+ crudini --set $cfg DEFAULT linuxnet_interface_driver nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
+ elif [[ "${MECHANISM_DRIVERS}" =~ openvswitch ]] ; then
+ crudini --set $cfg DEFAULT linuxnet_interface_driver nova.network.linux_net.LinuxOVSInterfaceDriver
+ fi
+ crudini --set $cfg DEFAULT libvirt_vif_driver nova.virt.libvirt.vif.LibvirtGenericVIFDriver
+ crudini --set $cfg DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
+ crudini --set $cfg neutron url http://${NEUTRON_SERVER_SERVICE_HOST}:${NEUTRON_SERVER_SERVICE_PORT}
+ crudini --set $cfg neutron auth_strategy keystone
+ crudini --set $cfg neutron admin_auth_url ${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0
+ crudini --set $cfg neutron admin_tenant_name ${ADMIN_TENANT_NAME}
+ crudini --set $cfg neutron admin_username ${NEUTRON_KEYSTONE_USER}
+ crudini --set $cfg neutron admin_password ${NEUTRON_KEYSTONE_PASSWORD}
+else
+ echo "Incorrect NETWORK_MANAGER ${NETWORK_MANAGER}. Supported options are nova and neutron."
+ exit 1
+fi
+
+# disabled pending answers to http://lists.openstack.org/pipermail/openstack/2014-October/009997.html
+#for option in auth_protocol auth_host auth_port; do
+# crudini --del $cfg \
+# keystone_authtoken \
+# $option
+#done
+
+crudini --set $cfg keystone_authtoken auth_uri "http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/"
+crudini --set $cfg keystone_authtoken auth_protocol http
+crudini --set $cfg keystone_authtoken auth_host ${KEYSTONE_PUBLIC_SERVICE_HOST}
+crudini --set $cfg keystone_authtoken auth_port 5000
+
+crudini --set $cfg keystone_authtoken admin_user ${NOVA_KEYSTONE_USER}
+crudini --set $cfg keystone_authtoken admin_password "${NOVA_KEYSTONE_PASSWORD}"
+crudini --set $cfg keystone_authtoken admin_tenant_name ${ADMIN_TENANT_NAME}
+
+cat > /openrc <<EOF
+export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
+export OS_USERNAME="${NOVA_KEYSTONE_USER}"
+export OS_PASSWORD="${NOVA_KEYSTONE_PASSWORD}"
+export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
+EOF
+
+# Configure database connection
+crudini --set $cfg \
+ database \
+ connection \
+ "mysql://${NOVA_DB_USER}:${NOVA_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${NOVA_DB_NAME}"