diff --git a/lib/nova b/lib/nova index af5d1222a0..d6ba253359 100644 --- a/lib/nova +++ b/lib/nova @@ -631,7 +631,7 @@ function init_nova_cells { if is_service_enabled n-cell; then cp $NOVA_CONF $NOVA_CELLS_CONF iniset $NOVA_CELLS_CONF database connection `database_connection_url $NOVA_CELLS_DB` - iniset $NOVA_CELLS_CONF oslo_messaging_rabbit rabbit_virtual_host child_cell + iniset_rpc_backend nova $NOVA_CELLS_CONF DEFAULT child_cell iniset $NOVA_CELLS_CONF DEFAULT dhcpbridge_flagfile $NOVA_CELLS_CONF iniset $NOVA_CELLS_CONF cells enable True iniset $NOVA_CELLS_CONF cells cell_type compute diff --git a/lib/rpc_backend b/lib/rpc_backend index 05e303e3e7..0ee46dca6f 100644 --- a/lib/rpc_backend +++ b/lib/rpc_backend @@ -104,8 +104,9 @@ function restart_rpc_backend { # builds transport url string function get_transport_url { + local virtual_host=$1 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then - echo "rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/" + echo "rabbit://$RABBIT_USERID:$RABBIT_PASSWORD@$RABBIT_HOST:5672/$virtual_host" fi } @@ -114,11 +115,9 @@ function iniset_rpc_backend { local package=$1 local file=$2 local section=${3:-DEFAULT} + local virtual_host=$4 if is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then - iniset $file $section rpc_backend "rabbit" - iniset $file oslo_messaging_rabbit rabbit_hosts $RABBIT_HOST - iniset $file oslo_messaging_rabbit rabbit_password $RABBIT_PASSWORD - iniset $file oslo_messaging_rabbit rabbit_userid $RABBIT_USERID + iniset $file $section transport_url $(get_transport_url "$virtual_host") if [ -n "$RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD" ]; then iniset $file oslo_messaging_rabbit heartbeat_timeout_threshold $RABBIT_HEARTBEAT_TIMEOUT_THRESHOLD fi