diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index 829fb48deab84668681b0a3349940c3add00270a..dd13a1208f5e7c310083526f24d54a178f37302d 100755 --- a/docker/nova-base/config-nova.sh +++ b/docker/nova-base/config-nova.sh @@ -10,10 +10,13 @@ : ${RABBIT_USERID:=guest} : ${RABBIT_PASSWORD:=guest} : ${NETWORK_MANAGER:=nova} +: ${FLAT_NETWORK:=eth0} +: ${PUBLIC_NETWORK:=eth1} check_required_vars KEYSTONE_ADMIN_TOKEN NOVA_DB_PASSWORD \ RABBITMQ_SERVICE_HOST GLANCE_API_SERVICE_HOST \ - KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP + KEYSTONE_PUBLIC_SERVICE_HOST PUBLIC_IP \ + PUBLIC_INTERFACE FLAT_INTERFACE cfg=/etc/nova/nova.conf @@ -72,9 +75,9 @@ if [ "${NETWORK_MANAGER}" == "nova" ] ; then 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 eth0 + crudini --set $cfg DEFAULT flat_interface $FLAT_INTERFACE crudini --set $cfg DEFAULT flat_network_bridge br100 - crudini --set $cfg DEFAULT public_interface eth1 + crudini --set $cfg DEFAULT public_interface $PUBLIC_INTERFACE elif [ "${NETWORK_MANAGER}" == "neutron" ] ; then check_required_vars NEUTRON_SHARED_SECRET crudini --set $cfg DEFAULT service_neutron_metadata_proxy True diff --git a/docker/nova-compute/nova-compute/Dockerfile b/docker/nova-compute/nova-compute/Dockerfile index 41ef0f84e07ed3d784bb8d039ead8daf2a7fb12d..7246e8937561f15d9739084f3a747f845ad2f610 100644 --- a/docker/nova-compute/nova-compute/Dockerfile +++ b/docker/nova-compute/nova-compute/Dockerfile @@ -1,16 +1,13 @@ FROM kollaglue/fedora-rdo-nova-base MAINTAINER Kolla Project (https://launchpad.net/kolla) -RUN yum -y install openstack-nova-compute \ - libvirtd; yum clean all +RUN yum -y install openstack-nova-compute sysfsutils \ + libvirt-daemon-config-nwfilter ; yum clean all ADD config-nova-compute.sh /opt/kolla/config-nova-compute.sh -ADD libvirt-start.sh /opt/kolla/libvirt-start.sh ADD ./start.sh /start.sh -RUN mkdir -p /var/lib/libvirt/images/ - VOLUME [ "/sys/fs/cgroup" ] VOLUME [ "/var/lib/nova" ] VOLUME [ "/var/lib/libvirt" ] diff --git a/docker/nova-compute/nova-compute/config-nova-compute.sh b/docker/nova-compute/nova-compute/config-nova-compute.sh index ddc38809dae16c6b37f9a74ee5c620e6ad07b67d..b0f20d9fc3cf30278906aa6c7811bea84b3b1372 100755 --- a/docker/nova-compute/nova-compute/config-nova-compute.sh +++ b/docker/nova-compute/nova-compute/config-nova-compute.sh @@ -3,12 +3,12 @@ . /opt/kolla/kolla-common.sh . /opt/kolla/config-nova.sh -#check_required_vars NOVA_LIBVIRT_SERVICE_HOST - cfg=/etc/nova/nova.conf -crudini --set $cfg libvirt virt_type qemu -# separate containers don't work because of libguestfs bug -# https://bugzilla.redhat.com/show_bug.cgi?id=1154408 -#crudini --set $cfg libvirt \ -# connection_uri qemu+tcp://${NOVA_LIBVIRT_SERVICE_HOST}/system +# 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/nova-compute/nova-compute/libvirt-start.sh b/docker/nova-compute/nova-compute/libvirt-start.sh deleted file mode 100755 index 63e71455103326891594a79fe7bc40db55598046..0000000000000000000000000000000000000000 --- a/docker/nova-compute/nova-compute/libvirt-start.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -#/bin/chmod 666 /dev/kvm - -echo "Starting guests." -/usr/libexec/libvirt-guests.sh start - -echo "Starting virtlockd." -/usr/sbin/virtlockd & - -sleep 3 - -echo "Starting libvirtd." -/usr/sbin/libvirtd & diff --git a/docker/nova-compute/nova-compute/start.sh b/docker/nova-compute/nova-compute/start.sh index 9aebdd636bf7cd22f46861dd2542019aabb4c92d..47354f866b36d3f4dd49506486a3d3975f5b7cad 100755 --- a/docker/nova-compute/nova-compute/start.sh +++ b/docker/nova-compute/nova-compute/start.sh @@ -4,10 +4,7 @@ set -e . /opt/kolla/config-nova-compute.sh -# ideally this would be a separate container, but because of libguestfs RFEs -# this is not possible. -. /opt/kolla/libvirt-start.sh - -sleep 5 +sleep 6 +echo "Starting nova-compute." exec /usr/bin/nova-compute diff --git a/docker/nova-compute/nova-libvirt/Dockerfile b/docker/nova-compute/nova-libvirt/Dockerfile index aa49fcb7cfd7afc356f24809294014b33bceeef3..0a7a7439ae31b2cdfff13160cc10b97fcb67ad22 100644 --- a/docker/nova-compute/nova-libvirt/Dockerfile +++ b/docker/nova-compute/nova-libvirt/Dockerfile @@ -1,18 +1,8 @@ FROM kollaglue/fedora-rdo-base MAINTAINER Kolla Project (https://launchpad.net/kolla) -RUN yum -y install libvirt-daemon-driver-* libvirt-daemon libvirt-daemon-kvm qemu-kvm && yum clean all - -EXPOSE 16509 - -RUN echo "listen_tls = 0" >> /etc/libvirt/libvirtd.conf; \ -echo 'listen_tcp = 1' >> /etc/libvirt/libvirtd.conf; \ -echo 'tls_port = "16514"' >> /etc/libvirt/libvirtd.conf; \ -echo 'tcp_port = "16509"' >> /etc/libvirt/libvirtd.conf; \ -echo 'auth_tcp = "none"' >> /etc/libvirt/libvirtd.conf - -RUN echo 'LIBVIRTD_ARGS="--listen"' >> /etc/sysconfig/libvirtd -RUN mkdir -p /var/lib/libvirt/images/ +RUN yum -y install libvirtd libguestfs qemu-system-x86 \ + libvirt-daemon-config-nwfilter; yum clean all VOLUME [ "/sys/fs/cgroup" ] VOLUME [ "/var/lib/nova" ] diff --git a/docker/nova-compute/nova-libvirt/start.sh b/docker/nova-compute/nova-libvirt/start.sh index 64785da7d524bcc87804570750db3781e07621a5..740f67f67dff90d4cd9d395e2e77e087c1981d2c 100755 --- a/docker/nova-compute/nova-libvirt/start.sh +++ b/docker/nova-compute/nova-libvirt/start.sh @@ -1,13 +1,3 @@ #!/bin/sh -/bin/chmod 666 /dev/kvm - -echo "Starting guests." -/usr/libexec/libvirt-guests.sh start - -echo "Starting virtlockd." -/usr/sbin/virtlockd & - -sleep 3 - echo "Starting libvirtd." -exec /usr/sbin/libvirtd --listen +exec /usr/sbin/libvirtd diff --git a/docker/nova-compute/nova-network/Dockerfile b/docker/nova-compute/nova-network/Dockerfile index 175ea0a68bf0de51e7a9b297182b2c0b1338181f..79c496b968fb4a89f1cc880de3fd6fbc7ab3f05d 100644 --- a/docker/nova-compute/nova-network/Dockerfile +++ b/docker/nova-compute/nova-network/Dockerfile @@ -2,7 +2,7 @@ FROM kollaglue/fedora-rdo-nova-base MAINTAINER Kolla Project (https://launchpad.net/kolla) RUN yum -y install openstack-nova-network \ - bridge-utils && yum clean all + bridge-utils initscripts && yum clean all ADD config-nova-network.sh /opt/kolla/config-nova-network.sh ADD ./start.sh /start.sh diff --git a/docker/nova-compute/nova-network/config-nova-network.sh b/docker/nova-compute/nova-network/config-nova-network.sh index bd060b3bc80174f5dda883ebfe1ec1155cb5cf3e..c4ca5e27e9bc981287b8ef18039975f0f7d9ce16 100755 --- a/docker/nova-compute/nova-network/config-nova-network.sh +++ b/docker/nova-compute/nova-network/config-nova-network.sh @@ -2,18 +2,16 @@ . /opt/kolla/config-nova.sh -check_required_vars CONFIG_NETWORK - # Configure eth1 as a physcial interface for nova flat network -cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF -DEVICE="eth1" +cat > /etc/sysconfig/network-scripts/ifcfg-$FLAT_INTERFACE <<EOF +DEVICE="$FLAT_INTERFACE" BOOTPROTO="none" ONBOOT="yes" DEFROUTE="yes" TYPE="Ethernet" EOF -/sbin/ifup eth1 +/usr/sbin/ifup $FLAT_INTERFACE cfg=/etc/nova/nova.conf @@ -25,6 +23,4 @@ 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 eth1 crudini --set $cfg DEFAULT flat_network_bridge br100 -crudini --set $cfg DEFAULT public_interface eth0