summaryrefslogtreecommitdiffstats
path: root/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules
diff options
context:
space:
mode:
authorBilly O'Mahony <billy.o.mahony@intel.com>2016-01-17 16:59:46 +0000
committerMark D. Gray <mark.d.gray@intel.com>2016-01-18 09:02:05 +0000
commit3d6fc2c1932375d30d5176e3fdbd347b287f8c17 (patch)
treebf0540baddaa7b3fc9f03fbca76bd1ed426d6967 /fuel-plugin-ovsnfv/deployment_scripts/puppet/modules
parent0e14c4cb61521bdfc3cd597342f526e1c30ff405 (diff)
fuel_plugin: Add remove_agent.sh
Change-Id: Ia289a4898eb280fd1856d448c5eb590504c40b3a Signed-off-by: Mark D. Gray <mark.d.gray@intel.com> Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com> Signed-off-by: Michal Ptacek <michalx.ptacek@intel.com> (cherry picked from commit 0216b070223946ce02e6095d75a75ba39010e936)
Diffstat (limited to 'fuel-plugin-ovsnfv/deployment_scripts/puppet/modules')
-rwxr-xr-xfuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/remove_agent.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/remove_agent.sh b/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/remove_agent.sh
new file mode 100755
index 0000000..98ee30a
--- /dev/null
+++ b/fuel-plugin-ovsnfv/deployment_scripts/puppet/modules/ovsdpdk/files/remove_agent.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -x
+# access openstack cli
+
+export OS_PROJECT_NAME=admin
+export OS_USERNAME=$1
+export OS_PASSWORD=$2
+export OS_TENANT_NAME=$3
+export OS_AUTH_URL=https://$4:5000/v2.0
+
+sleep 150
+neutron agent-list
+
+# Force update of vswitch agents
+for i in `neutron agent-list | grep "Open vSwitch agent" | awk {'print $2'}`; do
+ neutron agent-update $i
+done
+
+sleep 150
+neutron agent-list
+
+# grep id and remove dead agent on all compute nodes
+for i in `nova host-list | grep compute | awk {'print $2'}`; do
+ dead_agent_id=`neutron agent-list | grep $i | grep xxx | grep "Open vSwitch agent" | awk {'print $2'}`
+ neutron agent-delete $dead_agent_id
+done
+
+# modify flavors
+for i in `nova flavor-list | grep m1 | awk {'print $4'}`; do
+ nova flavor-key $i set "hw:mem_page_size=large"
+done
+
+set +x