diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index 829fb48dea..dd13a1208f 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 41ef0f84e0..7246e89375 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 ddc38809da..b0f20d9fc3 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 63e7145510..0000000000 --- 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 9aebdd636b..47354f866b 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 aa49fcb7cf..0a7a7439ae 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 64785da7d5..740f67f67d 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 175ea0a68b..79c496b968 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 bd060b3bc8..c4ca5e27e9 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 < /etc/sysconfig/network-scripts/ifcfg-$FLAT_INTERFACE <