licenses: Add license headers
[ovsnfv.git] / fuel-plugin-ovsnfv / deployment_scripts / puppet / modules / ovsdpdk / files / agents_flavors_update.sh
1 #!/usr/bin/env bash
2
3 # Copyright (c) 2016 Open Platform for NFV Project, Inc. and its contributors
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16
17 set -x
18
19 # access openstack cli
20 source /root/openrc
21
22 sleep 10
23 neutron agent-list
24
25 # Force update of vswitch agents
26 for i in `neutron agent-list | grep "Open vSwitch agent" | awk {'print $2'}`; do
27   neutron agent-update $i
28 done
29
30 sleep 10
31 neutron agent-list
32
33 # grep id and remove dead agent on all compute nodes
34 for i in `nova host-list | grep compute | awk {'print $2'}`; do
35   dead_agent_id=`neutron agent-list | grep $i | grep xxx | grep "Open vSwitch agent" | awk {'print $2'}`
36   neutron agent-delete $dead_agent_id
37 done
38
39 # modify flavors
40 for i in `nova flavor-list | grep m1 | awk {'print $4'}`; do
41   nova flavor-key $i set "hw:mem_page_size=large"
42 done
43
44 set +x