+ADDR=($(openstack stack show -f json -c outputs "$STACK_NAME" | \
+ jq -r '.outputs[] | select(.output_key | match("^vm_[0-9]+_ips$")) | .output_value | .[]'))
+
+# The next two blocks of code will parse the list of vm IP's hostnames to determine which type of node
+# the vm is: odl, devstack controller or compute, ha_proxy or tools. For the odl node's the hsotname will contain
+# java in the name. The tools nodes are anything left after odl and devstack nodes have been found.
+#
+# The devstack nodes are identified with devstack in the hostname but require more checks to determine the controller
+# node. Heat names the vms as devstack-<index> with index starting at 0. The vms are created in groups of which
+# the openstack jobs create a vm_1_group for the controller and vm_2_group for the other vms such as the compute
+# and ha_proxy nodes. The list of IP addresses for all the created vms is returned in reverse order of the group
+# creation, but ordered within the group. I.E vm_1_group will be created first and named devstack-0, followed by
+# vm_2_group and named devstack-0, devstack-1 and devstack-2. The list of IPs will be: devstack-0 (vm_2_group, compute),
+# devstack-1, devstack-2, devstack-0 (vm_1_group, controller). Notice both the compute and first control node are both
+# named devstack-0. We know the controller because it would be last in the list of IPs. This first block of code will
+# produce two lists: one for the list of potential controllers and the second is a list of all devstack nodes.