diff options
| author | Swapnil Kulkarni <me@coolsvap.net> | 2015-07-15 10:32:21 +0000 |
|---|---|---|
| committer | Swapnil Kulkarni <me@coolsvap.net> | 2015-07-16 11:37:40 +0000 |
| commit | 51b7915ae8094fe149ff1752be01d6ff29fed15e (patch) | |
| tree | d96b1ee8b7898f7ea22006990cc8f2a9572aa45e /docker/common/nova | |
| parent | 5c8561b1d71cf9d20dc533a1cf369cd9dbaeadb5 (diff) | |
| download | kolla-51b7915ae8094fe149ff1752be01d6ff29fed15e.tar.gz kolla-51b7915ae8094fe149ff1752be01d6ff29fed15e.zip | |
Updated directory structure to make it consistent
Closes-Bug: #1474774
Change-Id: Id61d777a8b741c800e0d034e3ee889c11bcf5fbc
Diffstat (limited to 'docker/common/nova')
28 files changed, 581 insertions, 0 deletions
diff --git a/docker/common/nova/nova-api/check.sh b/docker/common/nova/nova-api/check.sh new file mode 100755 index 000000000..b250682d8 --- /dev/null +++ b/docker/common/nova/nova-api/check.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +RES=0 + +. /openrc +if ! keystone token-get > /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! nova list > /dev/null; then + echo "ERROR: nova list failed" >&2 + RES=1 + fi +fi + +exit $RES + diff --git a/docker/common/nova/nova-api/config-external.sh b/docker/common/nova/nova-api/config-external.sh new file mode 100755 index 000000000..d0859893d --- /dev/null +++ b/docker/common/nova/nova-api/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-api/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-api/config-internal.sh b/docker/common/nova/nova-api/config-internal.sh new file mode 100755 index 000000000..7928370a4 --- /dev/null +++ b/docker/common/nova/nova-api/config-internal.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + NOVA_KEYSTONE_USER NOVA_KEYSTONE_PASSWORD \ + ADMIN_TENANT_NAME NOVA_API_SERVICE_HOST \ + NOVA_EC2_API_SERVICE_HOST PUBLIC_IP NOVA_DB_NAME +fail_unless_os_service_running keystone +fail_unless_db $NOVA_DB_NAME + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="http://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_API_LOG_FILE}" + +crux user-create --update \ + -n "${NOVA_KEYSTONE_USER}" \ + -p "${NOVA_KEYSTONE_PASSWORD}" \ + -t "${ADMIN_TENANT_NAME}" \ + -r admin + +crux endpoint-create --remove-all \ + -n ec2 -t ec2 \ + -I "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Cloud" \ + -P "http://${PUBLIC_IP}:8773/services/Cloud" \ + -A "http://${NOVA_EC2_API_SERVICE_HOST}:8773/services/Admin" + +crux endpoint-create --remove-all \ + -n nova -t compute \ + -I "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" \ + -P "http://${PUBLIC_IP}:8774/v2/\$(tenant_id)s" \ + -A "http://${NOVA_API_SERVICE_HOST}:8774/v2/\$(tenant_id)s" + +crux endpoint-create --remove-all \ + -n novav3 -t computev3 \ + -I "http://${NOVA_API_SERVICE_HOST}:8774/v3" \ + -P "http://${PUBLIC_IP}:8774/v3" \ + -A "http://${NOVA_API_SERVICE_HOST}:8774/v3" + +exec /usr/bin/nova-api --config-file /etc/nova/nova.conf diff --git a/docker/common/nova/nova-api/start.sh b/docker/common/nova/nova-api/start.sh new file mode 100755 index 000000000..0d7ffca9b --- /dev/null +++ b/docker/common/nova/nova-api/start.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-api" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases +# of the KOLLA_BOOTSTRAP variable being set, including empty. +if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then + su -s /bin/sh -c "nova-manage db sync" nova + exit 0 +fi + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-base/config-nova.sh b/docker/common/nova/nova-base/config-nova.sh new file mode 100755 index 000000000..8789a14a5 --- /dev/null +++ b/docker/common/nova/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}" diff --git a/docker/common/nova/nova-compute/config-external.sh b/docker/common/nova/nova-compute/config-external.sh new file mode 100755 index 000000000..e844bf50c --- /dev/null +++ b/docker/common/nova/nova-compute/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-compute/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-compute/config-internal.sh b/docker/common/nova/nova-compute/config-internal.sh new file mode 100755 index 000000000..ac7f781f4 --- /dev/null +++ b/docker/common/nova/nova-compute/config-internal.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova-compute.sh + +sleep 6 + +# https://bugs.launchpad.net/kolla/+bug/1461635 +# Cinder requires mounting /dev in the cinder-volume, nova-compute, +# and libvirt containers. If /dev/pts/ptmx does not have proper permissions +# on the host, then libvirt will fail to boot an instance. +# This is a bug in Docker where it is not correctly mounting /dev/pts +# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962 +# **Temporary fix** +chmod 666 /dev/pts/ptmx + +echo "Starting nova-compute." +exec /usr/bin/nova-compute --config-file /etc/nova/nova.conf diff --git a/docker/common/nova/nova-compute/config-nova-compute.sh b/docker/common/nova/nova-compute/config-nova-compute.sh new file mode 100755 index 000000000..9a2c12572 --- /dev/null +++ b/docker/common/nova/nova-compute/config-nova-compute.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-nova.sh + +cfg=/etc/nova/nova.conf + +check_required_vars NOVA_VNCSERVER_PROXYCLIENT_ADDRESS NOVA_NOVNC_PROXY_PORT \ + NOVA_NOVNC_BASE_ADDRESS + +# Configures novnc to listen on all interfaces and instructs nova-compute to +# announce PROXYCLIENT_IP to the nova-vncproxy. Clients like Horizon will +# connect with this address. +# As such, NOVA_VNCSERVER_PROXYCLIENT_ADDRESS is unique per compute node. +crudini --set $cfg DEFAULT vnc_enabled "True" +crudini --set $cfg DEFAULT vncserver_listen "0.0.0.0" +crudini --set $cfg DEFAULT vncserver_proxyclient_address "${NOVA_VNCSERVER_PROXYCLIENT_ADDRESS}" +crudini --set $cfg DEFAULT novncproxy_base_url "http://${NOVA_NOVNC_BASE_ADDRESS}:${NOVA_NOVNC_PROXY_PORT}/vnc_auto.html" + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_COMPUTE_LOG_FILE}" + +# set qmeu emulation if no hardware acceleration found +if [[ `egrep -c '(vmx|svm)' /proc/cpuinfo` == 0 ]]; then + crudini --set $cfg libvirt virt_type qemu +fi + +mkdir -p /var/lib/nova/instances diff --git a/docker/common/nova/nova-compute/start.sh b/docker/common/nova/nova-compute/start.sh new file mode 100755 index 000000000..c1ca94269 --- /dev/null +++ b/docker/common/nova/nova-compute/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-compute" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-conductor/config-external.sh b/docker/common/nova/nova-conductor/config-external.sh new file mode 100755 index 000000000..ea3b123ec --- /dev/null +++ b/docker/common/nova/nova-conductor/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-conductor/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-conductor/config-internal.sh b/docker/common/nova/nova-conductor/config-internal.sh new file mode 100755 index 000000000..3bba8cf3a --- /dev/null +++ b/docker/common/nova/nova-conductor/config-internal.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova.sh + +check_required_vars NOVA_DB_NAME NOVA_DB_USER NOVA_DB_PASSWORD \ + INIT_NOVA_DB +fail_unless_db + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_CONDUCTOR_LOG_FILE}" + +if [ "${INIT_NOVA_DB}" == "true" ]; then + mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF +CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME}; +GRANT ALL PRIVILEGES ON ${NOVA_DB_NAME}.* TO + '${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}' +EOF + + nova-manage db sync +fi + +exec /usr/bin/nova-conductor --config-file /etc/nova/nova.conf diff --git a/docker/common/nova/nova-conductor/start.sh b/docker/common/nova/nova-conductor/start.sh new file mode 100755 index 000000000..4a0074d39 --- /dev/null +++ b/docker/common/nova/nova-conductor/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-conductor" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-consoleauth/config-external.sh b/docker/common/nova/nova-consoleauth/config-external.sh new file mode 100755 index 000000000..1da10d83f --- /dev/null +++ b/docker/common/nova/nova-consoleauth/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-consoleauth/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-consoleauth/config-internal.sh b/docker/common/nova/nova-consoleauth/config-internal.sh new file mode 100755 index 000000000..a1b0864ac --- /dev/null +++ b/docker/common/nova/nova-consoleauth/config-internal.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +. /opt/kolla/config-nova.sh + +cfg=/etc/nova/nova.conf + +crudini --set $cfg DEFAULT log_file "${NOVA_CONSOLEAUTH_LOG_FILE}" + +echo Starting nova-consoleauth +exec /usr/bin/nova-consoleauth diff --git a/docker/common/nova/nova-consoleauth/start.sh b/docker/common/nova/nova-consoleauth/start.sh new file mode 100755 index 000000000..88f1b7a6b --- /dev/null +++ b/docker/common/nova/nova-consoleauth/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-consoleauth" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-libvirt/config-external.sh b/docker/common/nova/nova-libvirt/config-external.sh new file mode 100755 index 000000000..59567d52d --- /dev/null +++ b/docker/common/nova/nova-libvirt/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="" +TARGET="" +OWNER="" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-libvirt/config-internal.sh b/docker/common/nova/nova-libvirt/config-internal.sh new file mode 100755 index 000000000..1f2ddbed8 --- /dev/null +++ b/docker/common/nova/nova-libvirt/config-internal.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +if [[ $(cat /proc/cpuinfo | grep vmx) ]]; then + modprobe kvm_intel +elif [[ $(cat /proc/cpuinfo | grep svm) ]]; then + modprobe kvm_amd +else + echo "WARNING: Your hardware does not support hardware virtualization -" \ + "using qemu software virtualization instead" +fi + +modprobe ip6_tables ip_tables ebtable_nat + +# If libvirt is not installed on the host permissions need to be set +# If running in qemu, we don't need to set anything as /dev/kvm won't exist +if [[ -c /dev/kvm ]]; then + chmod 660 /dev/kvm + chown root:kvm /dev/kvm +fi + +# https://bugs.launchpad.net/kolla/+bug/1461635 +# Cinder requires mounting /dev in the cinder-volume, nova-compute, +# and libvirt containers. If /dev/pts/ptmx does not have proper permissions +# on the host, then libvirt will fail to boot an instance. +# This is a bug in Docker where it is not correctly mounting /dev/pts +# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962 +# **Temporary fix** +chmod 666 /dev/pts/ptmx + +echo "Starting libvirtd." +exec /usr/sbin/libvirtd diff --git a/docker/common/nova/nova-libvirt/start.sh b/docker/common/nova/nova-libvirt/start.sh new file mode 100755 index 000000000..00d7046d1 --- /dev/null +++ b/docker/common/nova/nova-libvirt/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/sbin/libvirtd" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-network/config-external.sh b/docker/common/nova/nova-network/config-external.sh new file mode 100755 index 000000000..7c1d6bb37 --- /dev/null +++ b/docker/common/nova/nova-network/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-network/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-network/config-internal.sh b/docker/common/nova/nova-network/config-internal.sh new file mode 100755 index 000000000..92381b720 --- /dev/null +++ b/docker/common/nova/nova-network/config-internal.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova-network.sh + +# Start nova-network +exec /usr/bin/nova-network --config-file /etc/nova/nova.conf diff --git a/docker/common/nova/nova-network/config-nova-network.sh b/docker/common/nova/nova-network/config-nova-network.sh new file mode 100755 index 000000000..6976d3a20 --- /dev/null +++ b/docker/common/nova/nova-network/config-nova-network.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +. /opt/kolla/config-nova.sh + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_NETWORK_LOG_FILE}" + +# Configure eth1 as a physcial interface for nova flat network +cat > /etc/sysconfig/network-scripts/ifcfg-$FLAT_INTERFACE <<EOF +DEVICE="$FLAT_INTERFACE" +BOOTPROTO="none" +ONBOOT="yes" +TYPE="Ethernet" +EOF + +/usr/sbin/ifup $FLAT_INTERFACE + +cfg=/etc/nova/nova.conf + +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_network_bridge br100 diff --git a/docker/common/nova/nova-network/start.sh b/docker/common/nova/nova-network/start.sh new file mode 100755 index 000000000..b6faa8215 --- /dev/null +++ b/docker/common/nova/nova-network/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-network" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-novncproxy/config-external.sh b/docker/common/nova/nova-novncproxy/config-external.sh new file mode 100755 index 000000000..fdc33a5bd --- /dev/null +++ b/docker/common/nova/nova-novncproxy/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-novncproxy/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-novncproxy/config-internal.sh b/docker/common/nova/nova-novncproxy/config-internal.sh new file mode 100755 index 000000000..9edafbca3 --- /dev/null +++ b/docker/common/nova/nova-novncproxy/config-internal.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e +. /opt/kolla/kolla-common.sh + +cfg=/etc/nova/nova.conf + +check_required_vars PUBLIC_IP NOVA_NOVNC_PROXY_SERVICE_HOST NOVA_NOVNC_PROXY_PORT \ + NOVA_NOVNC_BASE_ADDRESS NOVA_VNCSERVER_LISTEN_ADDRESS \ + NOVA_VNCSERVER_PROXYCLIENT_ADDRESS + +crudini --set $cfg DEFAULT log_file "${NOVA_NOVNCPROXY_LOG_FILE}" + +# Listen on all interfaces on port $NOVA_NOVNC_PROXY_PORT for incoming novnc +# requests. +# The base_url is given to clients to connect to, like Horizon, so this could +# very well be fancy DNS name. +echo Configuring VNC... +crudini --set $cfg DEFAULT vncserver_listen "${NOVA_VNCSERVER_LISTEN_ADDRESS}" +crudini --set $cfg DEFAULT vncserver_proxyclient_address "${NOVA_VNCSERVER_PROXYCLIENT_ADDRESS}" + +echo Starting nova-novncproxy +exec /usr/bin/nova-novncproxy diff --git a/docker/common/nova/nova-novncproxy/start.sh b/docker/common/nova/nova-novncproxy/start.sh new file mode 100755 index 000000000..aec5ce759 --- /dev/null +++ b/docker/common/nova/nova-novncproxy/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-novncproxy" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS diff --git a/docker/common/nova/nova-scheduler/config-external.sh b/docker/common/nova/nova-scheduler/config-external.sh new file mode 100755 index 000000000..3df0f9b7b --- /dev/null +++ b/docker/common/nova/nova-scheduler/config-external.sh @@ -0,0 +1,10 @@ +#!/bin/bash +SOURCE="/opt/kolla/nova-scheduler/nova.conf" +TARGET="/etc/nova/nova.conf" +OWNER="nova" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/nova/nova-scheduler/config-internal.sh b/docker/common/nova/nova-scheduler/config-internal.sh new file mode 100755 index 000000000..504c049ed --- /dev/null +++ b/docker/common/nova/nova-scheduler/config-internal.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-nova.sh + +check_required_vars NOVA_DB_NAME +fail_unless_db $NOVA_DB_NAME + +cfg=/etc/nova/nova.conf + +# configure logging +crudini --set $cfg DEFAULT log_file "${NOVA_SCHEDULER_LOG_FILE}" + +exec /usr/bin/nova-scheduler --config-file /etc/nova/nova.conf diff --git a/docker/common/nova/nova-scheduler/start.sh b/docker/common/nova/nova-scheduler/start.sh new file mode 100755 index 000000000..a578b95a6 --- /dev/null +++ b/docker/common/nova/nova-scheduler/start.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/nova-scheduler" +ARGS="" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Config-internal script exec out of this function, it does not return here. +set_configs + +exec $CMD $ARGS |
