aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-10-17 14:13:31 +0000
committerGerrit Code Review <review@openstack.org>2014-10-17 14:13:31 +0000
commitbf3c7eda8a5ae9f06c5cfc4166d413d267c1a932 (patch)
tree26e185aa5ad8a9f05bafeb4f8f5e58a0f18b0299
parent28aef69c6e41fdf4e0efec17b85b3adf097f069a (diff)
parenta14b8048c273f12aa4b941c0ff923997ad7524d6 (diff)
downloadkolla-bf3c7eda8a5ae9f06c5cfc4166d413d267c1a932.tar.gz
kolla-bf3c7eda8a5ae9f06c5cfc4166d413d267c1a932.zip
Merge "Make nova-compute work properly with libvirt"
-rw-r--r--docker/nova-compute/nova-compute/Dockerfile2
-rwxr-xr-xdocker/nova-compute/nova-compute/config-nova-compute.sh89
-rwxr-xr-xdocker/nova-compute/nova-compute/start.sh42
-rw-r--r--k8s/replication/nova-compute-replication.yaml2
-rw-r--r--k8s/service/nova-libvirt-service.yaml2
5 files changed, 95 insertions, 42 deletions
diff --git a/docker/nova-compute/nova-compute/Dockerfile b/docker/nova-compute/nova-compute/Dockerfile
index 1a95a60b3..68ac9a3e0 100644
--- a/docker/nova-compute/nova-compute/Dockerfile
+++ b/docker/nova-compute/nova-compute/Dockerfile
@@ -19,5 +19,7 @@ RUN yum -y install curl \
openstack-nova-compute \
; yum clean all
+ADD config-nova-compute.sh /opt/kolla/config-nova-compute.sh
ADD ./start.sh /start.sh
+
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
new file mode 100755
index 000000000..8dc05e7ba
--- /dev/null
+++ b/docker/nova-compute/nova-compute/config-nova-compute.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+. /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}
+
+check_required_vars KEYSTONE_ADMIN_TOKEN \
+ NOVA_DB_PASSWORD \
+ NOVA_LIBVIRT_SERVICE_HOST
+
+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 ec2,osapi_compute,metadata
+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_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 service_neutron_metadata_proxy True
+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 metadata_host ${MY_IP}
+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 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}
+crudini --set $cfg DEFAULT vnc_enabled True
+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 libvirt virt_type kvm
+crudini --set $cfg libvirt connection_uri qemu+tcp://${NOVA_LIBVIRT_SERVICE_HOS}/system
+
+# configure logging to stderr
+crudini --del $cfg DEFAULT log_dir
+crudini --set $cfg DEFAULT log_file ""
+crudini --set $cfg DEFAULT use_stderr True
+crudini --set $cfg DEFAULT admin_token "${KEYSTONE_ADMIN_TOKEN}"
+
+crudini --set $cfg conductor workers 8
+
+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 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
+
diff --git a/docker/nova-compute/nova-compute/start.sh b/docker/nova-compute/nova-compute/start.sh
index e11631bf6..3e39ec9c0 100755
--- a/docker/nova-compute/nova-compute/start.sh
+++ b/docker/nova-compute/nova-compute/start.sh
@@ -1,45 +1,7 @@
#!/bin/sh
-. /opt/kolla/kolla-common.sh
+set -e
-: ${NOVA_KEYSTONE_USER:=nova}
-: ${ADMIN_TENANT_NAME:=admin}
-
-check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_SERVICE_HOST \
- NOVA_LIBVIRT_SERVICE
-
-cfg=/etc/nova/nova.conf
-
-crudini --set $cfg DEFAULT admin_token "${KEYSTONE_ADMIN_TOKEN}"
-crudini --sel $cfg DEFAULT log_file ""
-crudini --del $cfg DEFAULT log_dir
-crudini --set $cfg DEFAULT use_stderr True
-crudini --set $cfg \
- libvirt \
- connection_uri \
- "qemu+tcp://${NOVA_LIBVIRT_SERVICE}/system"
-
-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_SERVICE_HOST}:5000/"
-crudini --set $cfg \
- keystone_authtoken \
- admin_tenant_name \
- "${ADMIN_TENANT_NAME}"
-crudini --set $cfg \
- keystone_authtoken \
- admin_user \
- "${NOVA_KEYSTONE_USER}"
-crudini --set $cfg \
- keystone_authtoken \
- admin_password \
- "${NOVA_KEYSTONE_PASSWORD}"
+. /opt/kolla/config-nova-compute.sh
exec /usr/bin/nova-compute
diff --git a/k8s/replication/nova-compute-replication.yaml b/k8s/replication/nova-compute-replication.yaml
index ea500747f..4c3060c63 100644
--- a/k8s/replication/nova-compute-replication.yaml
+++ b/k8s/replication/nova-compute-replication.yaml
@@ -30,7 +30,7 @@ desiredState:
name: nova-compute
replicaSelector:
name: nova-compute
- replicas: 2
+ replicas: 1
id: nova-compute-controller
kind: ReplicationController
labels:
diff --git a/k8s/service/nova-libvirt-service.yaml b/k8s/service/nova-libvirt-service.yaml
index da2e472ff..76dd911dd 100644
--- a/k8s/service/nova-libvirt-service.yaml
+++ b/k8s/service/nova-libvirt-service.yaml
@@ -1,6 +1,6 @@
apiVersion: v1beta1
containerPort: 16509
-id: novalibvirt
+id: nova-libvirt
kind: Service
port: 16509
selector: