diff --git a/docker/nova-base/Dockerfile b/docker/nova-base/Dockerfile index dfe4ce003b..d8933ba65f 100644 --- a/docker/nova-base/Dockerfile +++ b/docker/nova-base/Dockerfile @@ -4,7 +4,8 @@ MAINTAINER Ryan Hallisey RUN yum -y install openstack-nova-common \ python-keystoneclient \ python-cinderclient \ - python-nova && yum clean all + python-nova \ + bridge-utils && yum clean all ADD config-nova.sh /opt/kolla/config-nova.sh diff --git a/docker/nova-base/config-nova.sh b/docker/nova-base/config-nova.sh index 104466cdda..4f086e8578 100755 --- a/docker/nova-base/config-nova.sh +++ b/docker/nova-base/config-nova.sh @@ -11,7 +11,7 @@ : ${RABBIT_PASSWORD:=guest} check_required_vars KEYSTONE_ADMIN_TOKEN \ - NOVA_DB_PASSWORD NEUTRON_SHARED_SECRET + NOVA_DB_PASSWORD cfg=/etc/nova/nova.conf @@ -36,13 +36,13 @@ 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 service_neutron_metadata_proxy True -crudini --set $cfg DEFAULT neutron_metadata_proxy_shared_secret ${NEUTRON_SHARED_SECRET} -crudini --set $cfg DEFAULT neutron_default_tenant_id default +#crudini --set $cfg DEFAULT service_neutron_metadata_proxy True +#crudini --set $cfg DEFAULT neutron_metadata_proxy_shared_secret ${NEUTRON_SHARED_SECRET} +#crudini --set $cfg DEFAULT neutron_default_tenant_id default crudini --set $cfg DEFAULT novncproxy_host 0.0.0.0 crudini --set $cfg DEFAULT novncproxy_port 6080 crudini --set $cfg DEFAULT glance_api_servers ${GLANCE_API_SERVICE_HOST}:9292 -crudini --set $cfg DEFAULT network_api_class nova.network.neutronv2.api.API +#crudini --set $cfg DEFAULT network_api_class nova.network.neutronv2.api.API crudini --set $cfg DEFAULT metadata_host ${MY_IP} crudini --set $cfg DEFAULT cpu_allocation_ratio 16.0 crudini --set $cfg DEFAULT ram_allocation_ratio 1.5 @@ -50,7 +50,7 @@ crudini --set $cfg DEFAULT scheduler_default_filters RetryFilter,AvailabilityZon 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 firewall_driver nova.virt.firewall.NoopFirewallDriver +#crudini --set $cfg DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver crudini --set $cfg DEFAULT novncproxy_base_url http://${PUBLIC_IP}:6080/vnc_auto.html crudini --set $cfg DEFAULT vncserver_listen 0.0.0.0 crudini --set $cfg DEFAULT vncserver_proxyclient_address ${MY_IP} @@ -67,6 +67,20 @@ crudini --set $cfg DEFAULT admin_token "${KEYSTONE_ADMIN_TOKEN}" crudini --set $cfg conductor workers 8 +/usr/sbin/brctl addbr nova_br + +crudini --set /etc/nova/nova.conf DEFAULT network_manager nova.network.manager.FlatDHCPManager +crudini --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.libvirt.firewall.IptablesFirewallDriver +crudini --set /etc/nova/nova.conf DEFAULT network_size 254 +crudini --set /etc/nova/nova.conf DEFAULT allow_same_net_traffic False +crudini --set /etc/nova/nova.conf DEFAULT multi_host True +crudini --set /etc/nova/nova.conf DEFAULT send_arp_for_ha True +crudini --set /etc/nova/nova.conf DEFAULT share_dhcp_address True +crudini --set /etc/nova/nova.conf DEFAULT force_dhcp_release True +crudini --set /etc/nova/nova.conf DEFAULT flat_interface eth0 +crudini --set /etc/nova/nova.conf DEFAULT flat_network_bridge nova_br +crudini --set /etc/nova/nova.conf DEFAULT public_interface eth0 + # 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 \ diff --git a/docker/nova-compute/nova-compute/Dockerfile b/docker/nova-compute/nova-compute/Dockerfile index ecd6b558fb..e13e71eeeb 100644 --- a/docker/nova-compute/nova-compute/Dockerfile +++ b/docker/nova-compute/nova-compute/Dockerfile @@ -1,24 +1,18 @@ FROM kollaglue/fedora-rdo-nova-base MAINTAINER Steven Dake -# broken out by operation - we don't need libvirt and -# 200 deps for libguestfs (?) -RUN yum -y install curl \ - iscsi-initiator-utils \ - iptables \ - iptables-ipv6 \ - ipmitool \ - libvirt-python \ - python-libguestfs \ - openssh-clients \ - rsync \ - lvm2 \ - genisoimage \ - bridge-utils \ - openstack-nova-compute \ - ; yum clean all +RUN yum -y install openstack-nova-compute \ + libvirtd; 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" ] + CMD ["/start.sh"] diff --git a/docker/nova-compute/nova-compute/config-nova-compute.sh b/docker/nova-compute/nova-compute/config-nova-compute.sh index 7ced0cac66..ddc38809da 100755 --- a/docker/nova-compute/nova-compute/config-nova-compute.sh +++ b/docker/nova-compute/nova-compute/config-nova-compute.sh @@ -3,11 +3,12 @@ . /opt/kolla/kolla-common.sh . /opt/kolla/config-nova.sh -check_required_vars NOVA_LIBVIRT_SERVICE_HOST +#check_required_vars NOVA_LIBVIRT_SERVICE_HOST cfg=/etc/nova/nova.conf -crudini --set $cfg libvirt virt_type kvm -crudini --set $cfg libvirt \ - connection_uri qemu+tcp://${NOVA_LIBVIRT_SERVICE_HOS}/system - +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 diff --git a/docker/nova-compute/nova-compute/start.sh b/docker/nova-compute/nova-compute/start.sh index 3e39ec9c04..9aebdd636b 100755 --- a/docker/nova-compute/nova-compute/start.sh +++ b/docker/nova-compute/nova-compute/start.sh @@ -4,4 +4,10 @@ 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 + exec /usr/bin/nova-compute diff --git a/docker/nova-compute/nova-libvirt/Dockerfile b/docker/nova-compute/nova-libvirt/Dockerfile index a37d97cff3..9ecfc743a5 100644 --- a/docker/nova-compute/nova-libvirt/Dockerfile +++ b/docker/nova-compute/nova-libvirt/Dockerfile @@ -15,6 +15,8 @@ RUN echo 'LIBVIRTD_ARGS="--listen"' >> /etc/sysconfig/libvirtd RUN mkdir -p /var/lib/libvirt/images/ VOLUME [ "/sys/fs/cgroup" ] +VOLUME [ "/var/lib/nova" ] ADD ./start.sh /start.sh + CMD ["/start.sh"] diff --git a/docker/nova-compute/nova-network/Dockerfile b/docker/nova-compute/nova-network/Dockerfile new file mode 100644 index 0000000000..135c03f4fd --- /dev/null +++ b/docker/nova-compute/nova-network/Dockerfile @@ -0,0 +1,12 @@ +FROM kollaglue/fedora-rdo-nova-base +MAINTAINER Steven Dake + +RUN yum -y install openstack-nova-network \ + ; yum clean all + +ADD ./start.sh /start.sh + +VOLUME [ "/var/lib/nova" ] +VOLUME [ "/var/lib/libvirt" ] + +CMD ["/start.sh"] diff --git a/docker/nova-compute/nova-network/build b/docker/nova-compute/nova-network/build new file mode 120000 index 0000000000..43944faa00 --- /dev/null +++ b/docker/nova-compute/nova-network/build @@ -0,0 +1 @@ +../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/nova-compute/nova-network/start.sh b/docker/nova-compute/nova-network/start.sh new file mode 100755 index 0000000000..a925cefc95 --- /dev/null +++ b/docker/nova-compute/nova-network/start.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +. /opt/kolla/config-common.sh +. /opt/kolla/config-nova.sh + +exec /usr/bin/nova-network diff --git a/k8s/replication/nova-compute-replication.yaml b/k8s/replication/nova-compute-replication.yaml index a690fca491..569436b3d6 100644 --- a/k8s/replication/nova-compute-replication.yaml +++ b/k8s/replication/nova-compute-replication.yaml @@ -9,6 +9,7 @@ desiredState: ports: - containerPort: 12000 hostPort: 12000 + privileged: true env: - name: DB_ROOT_PASSWORD value: password @@ -16,11 +17,12 @@ desiredState: value: novadbpassword - name: KEYSTONE_ADMIN_TOKEN value: ADMINTOKEN - - name: nova-libvirt + - name: nova-network image: kollaglue/fedora-rdo-nova-network ports: - containerPort: 12001 hostPort: 12001 + privileged: true env: - name: DB_ROOT_PASSWORD value: password