diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-03-02 12:29:28 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-03-02 12:29:28 +0000 |
| commit | eaf15893a0af7fef1825601bedbd2704a291dd33 (patch) | |
| tree | 198b1b04f99ca58a53c5538918f271ac9b32f3ca /docker | |
| parent | 7925b78142c75a70569644c7a75e0e035993d996 (diff) | |
| parent | 7eca70b1a6dfe58288dcdeae12c99dfab69f890c (diff) | |
| download | kolla-eaf15893a0af7fef1825601bedbd2704a291dd33.tar.gz kolla-eaf15893a0af7fef1825601bedbd2704a291dd33.zip | |
Merge "A functional libvirt + nova_compute + nova_network"
Diffstat (limited to 'docker')
| -rwxr-xr-x | docker/nova-base/config-nova.sh | 9 | ||||
| -rw-r--r-- | docker/nova-compute/nova-compute/Dockerfile | 7 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-compute/config-nova-compute.sh | 14 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-compute/libvirt-start.sh | 13 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-compute/start.sh | 7 | ||||
| -rw-r--r-- | docker/nova-compute/nova-libvirt/Dockerfile | 14 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-libvirt/start.sh | 12 | ||||
| -rw-r--r-- | docker/nova-compute/nova-network/Dockerfile | 2 | ||||
| -rwxr-xr-x | docker/nova-compute/nova-network/config-nova-network.sh | 10 |
9 files changed, 24 insertions, 64 deletions
diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index 829fb48de..dd13a1208 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 41ef0f84e..7246e8937 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 ddc38809d..b0f20d9fc 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 63e714551..000000000 --- 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 9aebdd636..47354f866 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 aa49fcb7c..0a7a7439a 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 64785da7d..740f67f67 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 175ea0a68..79c496b96 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 bd060b3bc..c4ca5e27e 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 |
