Neutron: create network resources when agents are started

Creating network resources before the agents start with the ml2
plugin might result in bnding failures for some resources such as
DHCP ports because the resources are created before the agents
report to the server.

This patch should ensure all agents have started and reported
their state to the server before creating network resources.

Change-Id: Ifafb73bd3c5409a555a573ad9a94b96d79061c38
Related-Bug: #1253896
diff --git a/stack.sh b/stack.sh
index ce5fbd4..d54a652 100755
--- a/stack.sh
+++ b/stack.sh
@@ -1104,10 +1104,7 @@
 
 if is_service_enabled q-svc; then
     echo_summary "Starting Neutron"
-
     start_neutron_service_and_check
-    create_neutron_initial_network
-    setup_neutron_debug
 elif is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-net; then
     NM_CONF=${NOVA_CONF}
     if is_service_enabled n-cell; then
@@ -1127,6 +1124,12 @@
 if is_service_enabled neutron; then
     start_neutron_agents
 fi
+# Once neutron agents are started setup initial network elements
+if is_service_enabled q-svc; then
+    echo_summary "Creating initial neutron network elements"
+    create_neutron_initial_network
+    setup_neutron_debug
+fi
 if is_service_enabled nova; then
     echo_summary "Starting Nova"
     start_nova