Large update which includes the following
- The introduction of a tools container which can be expanded as
  necessary. It connects to voltha and kafka networks
- The introduction of the envoy proxy container
- The addition of an option to the CreateInstaller.sh script to rebuild
  the voltha VM to pick up any new code changes
- A fix to work around a dpkg issue where it didn't handle depnedencies
  propoerly
- Addition of start and stop scripts for the voltha suite and the use of
  those scripts by the installer. The old per service start eliminated
  from the installer
- Increased the number of vCPUs used by the installer and the voltha VM
  to speed up installer creation.
Note the envoy proxy has not been integrated into the voltha suite yet,
this commit adds the container and some preliminary configuration but
integration of the proxy will be committed in a subsequent update.

Addressed comments from the reviewers

Change-Id: I5475f110ba955631baf05b0e34aa6a934ca69a24
diff --git a/install/CreateInstaller.sh b/install/CreateInstaller.sh
index 4a79b37..b9ae71a 100755
--- a/install/CreateInstaller.sh
+++ b/install/CreateInstaller.sh
@@ -13,6 +13,7 @@
 
 # Command line argument variables
 testMode="no"
+rebuildVoltha="no"
 
 
 
@@ -38,6 +39,10 @@
 				testMode="yes"
 				echo -e "${lBlue}Test mode is ${green}enabled${NC}"
 				;;
+			"rebuild" )
+				rebuildVoltha="yes"
+				echo -e "${lBlue}Voltha rebuild is ${green}enabled${NC}"
+				;;
 		esac
 	done
 }
@@ -231,9 +236,12 @@
 
 # Ensure that the voltha VM is running so that images can be secured
 echo -e "${lBlue}Ensure that the ${lCyan}voltha VM${lBlue} is running${NC}"
-vVM=`virsh list | grep voltha_voltha${uId}`
+vVm=`virsh list | grep "voltha_voltha${uId}"`
+#echo "vVm: $vVm"
+#echo "rebuildVoltha: $rebuildVoltha"
 
-if [ -z "$vVM" ]; then
+
+if [ -z "$vVm" -o "$rebuildVoltha" == "yes" ]; then
 	if [ "$testMode" == "yes" ]; then
 		./BuildVoltha.sh $1
 		rtrn=$?
diff --git a/install/Vagrantfile b/install/Vagrantfile
index bc1f9d2..65c3ce2 100644
--- a/install/Vagrantfile
+++ b/install/Vagrantfile
@@ -18,6 +18,7 @@
       d.vm.provision :shell, inline: "apt-get -y install python"
       d.vm.provider "libvirt" do |v|
         v.memory = 6144
+	v.cpus = 2
       end
     end
   end
diff --git a/install/ansible/roles/cluster-host/tasks/main.yml b/install/ansible/roles/cluster-host/tasks/main.yml
index 8035072..e3115ef 100644
--- a/install/ansible/roles/cluster-host/tasks/main.yml
+++ b/install/ansible/roles/cluster-host/tasks/main.yml
@@ -77,6 +77,14 @@
     links: yes
   tags: [cluster_host]
 
+- name: pre-emptive strike to avoid errors during package installation
+  apt:
+    name: "{{ item }}"
+    state: absent
+  with_items:
+    - ubuntu-core-launcher
+    - snapd
+  tags: [cluster_host]
 
 - name: Dependent software is installed (this can take about 10 Min, DONT'T PANIC, go for coffee instead)
   command: dpkg -R -i "{{ target_voltha_home }}/deb_files"
diff --git a/install/ansible/roles/installer/tasks/main.yml b/install/ansible/roles/installer/tasks/main.yml
index dc6bbcf..b5b7afa 100644
--- a/install/ansible/roles/installer/tasks/main.yml
+++ b/install/ansible/roles/installer/tasks/main.yml
@@ -33,9 +33,12 @@
   with_items:
     - install/installer.sh
     - install/install.cfg
+    - install/voltha-swarm-start.sh
+    - install/voltha-swarm-stop.sh
     - install/ansible
     - compose
     - nginx_config
+    - envoy
   tags: [installer]
 
 - name: Determine if test mode is active
@@ -85,6 +88,7 @@
     - deb_files
     - docker-py
     - netifaces
+    - envoy
   tags: [installer]
 - name: Installer files are owned by vinstall
   file:
@@ -95,5 +99,7 @@
   with_items:
     - installer.sh
     - install.cfg
+    - voltha-swarm-start.sh
+    - voltha-swarm-stop.sh
     - docker-compose-Linux-x86_64
   tags: [installer]
diff --git a/install/ansible/roles/voltha/files/consul_config/base_config.json b/install/ansible/roles/voltha/files/consul_config/base_config.json
deleted file mode 100644
index 217fc09..0000000
--- a/install/ansible/roles/voltha/files/consul_config/base_config.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
-	"server": true,
-	"ui": true, 
-	"bootstrap_expect": 3,
-	"client_addr": "0.0.0.0",
-	"disable_update_check": true,
-	"retry_join": ["10.10.10.3", "10.10.10.4", "10.10.10.5"]
-}
-
diff --git a/install/ansible/roles/voltha/tasks/main.yml b/install/ansible/roles/voltha/tasks/main.yml
index 2fa5ccd..5633b76 100644
--- a/install/ansible/roles/voltha/tasks/main.yml
+++ b/install/ansible/roles/voltha/tasks/main.yml
@@ -31,7 +31,7 @@
   when: target == "cluster"
   tags: [voltha]
 
-- name: Installer files and directories are copied
+- name: Configuration files and directories are copied
   synchronize:
     src: "/home/vinstall/{{ item }}"
     dest: "{{ target_voltha_dir }}"
@@ -43,12 +43,15 @@
   with_items:
     - compose
     - nginx_config
+    - envoy
+    - voltha-swarm-start.sh
+    - voltha-swarm-stop.sh
   when: target == "cluster"
   tags: [voltha]
 
-- name: Installer directories are owned by voltha
+- name: Configuration directories are owned by voltha
   file:
-    path: /home/vinstall/{{ item }}
+    path: "{{ target_voltha_dir }}/{{ item }}"
     owner: voltha
     group: voltha
     recurse: yes
@@ -56,6 +59,20 @@
   with_items:
     - compose
     - nginx_config
+    - envoy
+  when: target == "cluster"
+  tags: [voltha]
+
+- name: Script files are owned by voltha and executable
+  file:
+    path: "{{ target_voltha_dir }}/{{ item }}"
+    owner: voltha
+    group: voltha
+    mode: 0755
+    follow: no
+  with_items:
+    - voltha-swarm-start.sh
+    - voltha-swarm-stop.sh
   when: target == "cluster"
   tags: [voltha]
 
@@ -66,12 +83,14 @@
   when: target == "cluster"
   tags: [voltha]
 
-- name: Configuration files are on the cluster host
-  copy:
-    src: "files/consul_config"
-    dest: "{{ target_voltha_dir }}"
-  when: target == "cluster"
-  tags: [voltha]
+#- name: Configuration files are on the cluster host
+#  copy:
+#    src: "files/consul_config"
+#    dest: "{{ target_voltha_dir }}"
+#    owner: voltha
+#    group: voltha
+#  when: target == "cluster"
+#  tags: [voltha]
 
 - name: Docker containers for Voltha are pulled
   command: docker pull {{ docker_registry }}/{{ item }}
@@ -124,31 +143,22 @@
   with_items: "{{ voltha_containers }}"
   when: target == "installer"
   tags: [voltha]
+
 - name: Docker containers for Voltha are pushed
   command: docker push {{ docker_push_registry }}/{{ item }}
   with_items: "{{ voltha_containers }}"
   when: target == "installer"
   tags: [voltha]
+
 - name: Temporary registry push tags are removed
   command: docker rmi {{ docker_push_registry }}/{{ item }}
   with_items: "{{ voltha_containers }}"
   when: target == "installer"
   tags: [voltha]
 
-- name: voltha overlay network exists
-  command: docker network create --opt encrypted=true --driver overlay --subnet 10.10.12.0/24 voltha_net
+- name: voltha components are started
+  command: "{{ target_voltha_dir }}/voltha-swarm-start.sh"
   become: voltha
   when: target == "startup"
   tags: [voltha]
 
-- name: consul cluster is running
-  command: docker stack deploy -c {{ target_voltha_dir }}/compose/docker-compose-consul-cluster.yml consul
-  become: voltha
-  when: target == "startup"
-  tags: [voltha]
-
-- name: kafka is running
-  command: docker stack deploy -c {{ target_voltha_dir}}/compose/docker-compose-kafka-cluster.yml kafka
-  become: voltha
-  when: target == "startup"
-  tags: [voltha]
diff --git a/install/containers.cfg b/install/containers.cfg
index a9ffbbb..df0d264 100644
--- a/install/containers.cfg
+++ b/install/containers.cfg
@@ -13,3 +13,5 @@
   - wurstmeister/kafka:latest
   - zookeeper:latest
   - gliderlabs/registrator:master
+  - voltha/envoy:latest
+  - registry:2
diff --git a/install/vmTemplate.xml b/install/vmTemplate.xml
index b08cea6..d60ba56 100644
--- a/install/vmTemplate.xml
+++ b/install/vmTemplate.xml
@@ -2,7 +2,7 @@
   <name>{{ VMName }}</name>
   <memory unit='KiB'>1048576</memory>
   <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>2</vcpu>
+  <vcpu placement='static'>4</vcpu>
   <os>
     <type arch='x86_64' machine='pc-i440fx-xenial'>hvm</type>
     <boot dev='hd'/>
diff --git a/install/voltha-swarm-start.sh b/install/voltha-swarm-start.sh
new file mode 100755
index 0000000..71245f1
--- /dev/null
+++ b/install/voltha-swarm-start.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+voltha_base_dir="/cord/incubator/voltha"
+
+docker network create --driver overlay --subnet=10.0.1.0/24 --opt encrypted=true voltha_net
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-consul-cluster.yml consul
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml voltha
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon
+docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf
+docker service create -d --name tools --network voltha_net  --network kafka_net --publish "4022:22" voltha/tools
+
diff --git a/install/voltha-swarm-stop.sh b/install/voltha-swarm-stop.sh
new file mode 100644
index 0000000..8c21cfe
--- /dev/null
+++ b/install/voltha-swarm-stop.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+docker service rm chameleon_chameleon
+docker service rm netconf_netconf
+docker service rm cli_cli
+docker service rm voltha_voltha
+docker stack rm consul
+docker stack rm kafka
+docker service rm tools
+docker network rm voltha_net