summaryrefslogtreecommitdiffstats
path: root/fuel/prototypes/auto-deploy/deploy/tools
diff options
context:
space:
mode:
Diffstat (limited to 'fuel/prototypes/auto-deploy/deploy/tools')
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant0.sh40
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant1.sh67
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant2.sh98
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_fuel_settings.py50
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_interfaces.py77
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_network_scheme.py42
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_network_settings.py52
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_opnfv_settings.py42
-rwxr-xr-xfuel/prototypes/auto-deploy/deploy/tools/transplant_settings.py36
9 files changed, 0 insertions, 504 deletions
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant0.sh b/fuel/prototypes/auto-deploy/deploy/tools/transplant0.sh
deleted file mode 100755
index 7c5883b..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant0.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-cleanup () {
- if [ -n "$tmpDir" ]; then
- rm -Rf $tmpDir
- fi
-}
-
-trap cleanup exit
-
-error_exit () {
- echo "Error: $@" >&2
- exit 1
-}
-
-tmpDir=`mktemp -d /tmp/deaXXXX`
-
-export PATH=`dirname $0`:$PATH
-
-if [ $# -lt 1 ]; then
- error_exit "Argument error"
-fi
-deafile=$1
-shift
-
-if [ ! -f "$deafile" ]; then
- error_exit "Can't find $deafile"
-fi
-
-transplant_fuel_settings.py /etc/fuel/astute.yaml $deafile || \
- error_exit "Could not transplant astute settings"
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant1.sh b/fuel/prototypes/auto-deploy/deploy/tools/transplant1.sh
deleted file mode 100755
index 2401c6f..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant1.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-cleanup () {
- if [ -n "$tmpDir" ]; then
- rm -Rf $tmpDir
- fi
-}
-
-trap cleanup exit
-
-error_exit () {
- echo "Error: $@" >&2
- exit 1
-}
-
-tmpDir=`mktemp -d /tmp/deaXXXX`
-
-export PATH=`dirname $0`:$PATH
-
-if [ $# -lt 1 ]; then
- error_exit "Argument error"
-fi
-deafile=$1
-shift
-
-if [ ! -f "$deafile" ]; then
- error_exit "Can't find $deafile"
-fi
-
-if [ `fuel env | tail -n +3 | grep -v '^$' | wc -l` -ne 1 ]; then
- error_exit "Not exactly one environment"
-fi
-envId=`fuel env | tail -n +3 | grep -v '^$' | awk '{ print $1 }'`
-
-fuel settings --env $envId --download --dir $tmpDir > /dev/null || \
- error_exit "Could not get settings"
-
-fuel network --env $envId --download --dir $tmpDir > /dev/null || \
- error_exit "Could not get network settings"
-
-cp $tmpDir/network_${envId}.yaml network_before.yaml
-
-# Transplant network settings
-transplant_network_settings.py $tmpDir/network_${envId}.yaml $deafile || \
- error_exit "Could not transplant network settings"
-fuel network --env $envId --upload --dir $tmpDir || \
- error_exit "Could not update network settings"
-cp $tmpDir/network_${envId}.yaml network_after.yaml
-
-# Transplant settings
-cp $tmpDir/settings_${envId}.yaml settings_before.yaml
-transplant_settings.py $tmpDir/settings_${envId}.yaml $deafile || \
- error_exit "Could not transplant settings"
-fuel settings --env $envId --upload --dir $tmpDir || \
- error_exit "Could not update settings"
-cp $tmpDir/settings_${envId}.yaml settings_after.yaml
-
-
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant2.sh b/fuel/prototypes/auto-deploy/deploy/tools/transplant2.sh
deleted file mode 100755
index 46c7a60..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant2.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/bash
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-cleanup () {
- if [ -n "$tmpDir" ]; then
- rm -Rf $tmpDir
- fi
-}
-
-trap cleanup exit
-
-error_exit () {
- echo "Error: $@" >&2
- exit 1
-}
-
-# Return offset between DEA node id and cluster node id
-getDeaNodeOffset()
-{
- local baseId
-
- baseId=`fuel node | tail -n +3 | awk '{ print $1 }' | sed 's/ //g' | sort -n | head -1`
- echo "$[baseId - 1]"
-}
-
-tmpDir=`mktemp -d /tmp/deaXXXX`
-
-export PATH=`dirname $0`:$PATH
-
-if [ $# -ne 1 ]; then
- error_exit "Argument error"
-fi
-deaFile=$1
-
-if [ ! -f "$deaFile" ]; then
- error_exit "Can't find $deaFile"
-fi
-
-
-if [ `fuel env | tail -n +3 | grep -v '^$' | wc -l` -ne 1 ]; then
- error_exit "Not exactly one environment"
-fi
-envId=`fuel env | tail -n +3 | grep -v '^$' | awk '{ print $1 }'`
-
-# Phase 1: Graft deployment information
-fuel deployment --env $envId --default --dir $tmpDir || \
- error_exit "Could not dump environment"
-
-for controller in `find $tmpDir -type f | grep -v compute`
-do
- transplant_network_scheme.py $controller $deaFile controller || \
- error_exit "Failed to graft `basename $controller`"
-
- transplant_opnfv_settings.py $controller $deaFile controller || \
- error_exit "Failed to graft `basename $controller`"
-done
-
-for compute in `find $tmpDir -type f | grep compute`
-do
- transplant_network_scheme.py $compute $deaFile compute || \
- error_exit "Failed to graft `basename $compute`"
-
- transplant_opnfv_settings.py $compute $deaFile compute || \
- error_exit "Failed to graft `basename $controller`"
-done
-
-fuel deployment --env $envId --upload --dir $tmpDir || \
- error_exit "Could not upload environment"
-
-# Phase 2: Graft interface information
-deaOffset=`getDeaNodeOffset`
-echo "DEA offset: $deaOffset"
-
-for clusterNodeId in `fuel node | grep True | awk '{ print $1}'`
-do
- deaNodeId=$[clusterNodeId - deaOffset]
- echo "Node $clusterNodeId is $deaNodeId"
- fuel node --node-id $clusterNodeId --network --download --dir $tmpDir || \
- error_exit "Could not download node $clusterNodeId"
-
- transplant_interfaces.py ${tmpDir}/node_${clusterNodeId}/interfaces.yaml \
- $deaFile $deaNodeId || \
- error_exit "Failed to graft interfaces"
-
- fuel node --node-id $clusterNodeId --network --upload --dir $tmpDir || \
- error_exit "Could not upload node $clusterNodeId"
-done
-
-
-
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_fuel_settings.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_fuel_settings.py
deleted file mode 100755
index 49ea5e4..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_fuel_settings.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 3:
- sys.stderr.write("Usage: "+sys.argv[0]+" <astutefile> <deafile>\n")
- sys.exit(1)
-
-fuelfile = sys.argv[1]
-if not os.path.exists(fuelfile):
- sys.stderr.write("ERROR: The file "+fuelfile+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-if not os.path.exists(deafile):
- sys.stderr.write("ERROR: The file "+deafile+" could not be opened\n")
- sys.exit(1)
-
-f = open(deafile, 'r')
-dea = yaml.load(f)
-f.close()
-
-f = open(fuelfile, 'r')
-fuel = yaml.load(f)
-f.close()
-
-dea = dea["fuel"]
-for property in dea.keys():
- if property == "ADMIN_NETWORK":
- for adminproperty in dea[property].keys():
- fuel[property][adminproperty] = dea[property][adminproperty]
- else:
- fuel[property] = dea[property]
-
-f = open(fuelfile, 'w')
-f.write(yaml.dump(fuel, default_flow_style=False))
-f.close()
-
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_interfaces.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_interfaces.py
deleted file mode 100755
index 609f360..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_interfaces.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 4:
- sys.stderr.write("Usage: "+sys.argv[0]+" <infile> <deafile> <nodeid>\n")
- sys.exit(1)
-
-infile = sys.argv[1]
-if not os.path.exists(infile):
- sys.stderr.write("ERROR: The file "+infile+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-if not os.path.exists(deafile):
- sys.stderr.write("ERROR: The file "+deafile+" could not be opened\n")
- sys.exit(1)
-deafile = sys.argv[2]
-nodeid = int(sys.argv[3])
-
-namespace = "interfaces"
-
-f1 = open(infile, 'r')
-doc1 = yaml.load(f1)
-f1.close()
-
-f2 = open(deafile, 'r')
-doc2 = yaml.load(f2)
-f2.close()
-
-
-# Create lookup table network name -> id for current setup
-nwlookup = {}
-for interface in doc1:
- iface = {}
- networks = []
- for network in interface["assigned_networks"]:
- nwlookup[network["name"]] = network["id"]
-
-# Find network information in DEA for this node
-nodeInfo = {}
-for node in doc2["nodes"]:
- if node["id"] == nodeid:
- nodeInfo=node
- print "Found nodeinfo for node %d" % nodeid
-
-out = {}
-out["interfaces"] = {}
-
-for interface in doc1:
- assigned = []
- nw = {}
- interface["assigned_networks"] = []
- try:
- for nwname in nodeInfo["interfaces"][interface["name"]]:
- iface = {}
- iface["id"] = nwlookup[nwname]
- iface["name"] = nwname
- interface["assigned_networks"].append(iface)
- except:
- print "No match for interface " + interface["name"]
-
-f3 = open(infile, 'w')
-f3.write(yaml.dump(doc1, default_flow_style=False))
-f3.close()
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_scheme.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_scheme.py
deleted file mode 100755
index 7d50cbe..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_scheme.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 4:
- sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile> [compute|controller]\n")
- sys.exit(1)
-
-file = sys.argv[1]
-if not os.path.exists(file):
- sys.stderr.write("ERROR: The file "+file+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-namespace = sys.argv[3]
-
-f1 = open(file, 'r')
-doc1 = yaml.load(f1)
-f1.close()
-
-f2 = open(deafile, 'r')
-doc2 = yaml.load(f2)
-f1.close()
-
-doc1["network_scheme"]["transformations"] = doc2[namespace]
-
-f2 = open(file, 'w')
-f2.write(yaml.dump(doc1, default_flow_style=False))
-f2.close()
-
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_settings.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_settings.py
deleted file mode 100755
index c0a46be..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_network_settings.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 3:
- sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile>\n")
- sys.exit(1)
-
-file = sys.argv[1]
-if not os.path.exists(file):
- sys.stderr.write("ERROR: The file "+file+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-if not os.path.exists(deafile):
- sys.stderr.write("ERROR: The file "+deafile+" could not be opened\n")
- sys.exit(1)
-
-f1 = open(file, 'r')
-doc1 = yaml.load(f1)
-f1.close()
-
-f2 = open(deafile, 'r')
-doc2 = yaml.load(f2)
-f2.close()
-
-# Grab IDs from Fuel version, graft onto DEA version and save
-id = []
-groupid = []
-for nw in doc1["networks"]:
- id.append(nw["id"])
- groupid.append(nw["group_id"])
-
-for nw in doc2["network"]["networks"]:
- nw["id"] = id.pop(0)
- nw["group_id"] = groupid.pop(0)
-
-f3 = open(file, 'w')
-f3.write(yaml.dump(doc2["network"], default_flow_style=False))
-f3.close()
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_opnfv_settings.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_opnfv_settings.py
deleted file mode 100755
index 00d0950..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_opnfv_settings.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 4:
- sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile> [compute|controller]\n")
- sys.exit(1)
-
-file = sys.argv[1]
-if not os.path.exists(file):
- sys.stderr.write("ERROR: The file "+file+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-namespace = sys.argv[3]
-
-f1 = open(file, 'r')
-doc1 = yaml.load(f1)
-f1.close()
-
-f2 = open(deafile, 'r')
-doc2 = yaml.load(f2)
-f1.close()
-
-doc1["opnfv"] = doc2["opnfv"][namespace]
-
-f2 = open(file, 'w')
-f2.write(yaml.dump(doc1, default_flow_style=False))
-f2.close()
-
diff --git a/fuel/prototypes/auto-deploy/deploy/tools/transplant_settings.py b/fuel/prototypes/auto-deploy/deploy/tools/transplant_settings.py
deleted file mode 100755
index 7f5c0d8..0000000
--- a/fuel/prototypes/auto-deploy/deploy/tools/transplant_settings.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/python
-##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
-# stefan.k.berg@ericsson.com
-# jonas.bjurel@ericsson.com
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-
-import yaml
-import re
-import sys
-import os
-
-if len(sys.argv) != 3:
- sys.stderr.write("Usage: "+sys.argv[0]+" <file> <deafile>\n")
- sys.exit(1)
-
-file = sys.argv[1]
-if not os.path.exists(file):
- sys.stderr.write("ERROR: The file "+file+" could not be opened\n")
- sys.exit(1)
-
-deafile = sys.argv[2]
-
-f1 = open(deafile, 'r')
-doc = yaml.load(f1)
-f1.close()
-
-out = doc["settings"]
-f2 = open(file, 'w')
-f2.write(yaml.dump(out, default_flow_style=False))
-f2.close()
-