Tutorials/Edge Computing/Service Migration: conmig.sh

File conmig.sh, 853 bytes (added by sumitece87, 19 months ago)
Line 
1#!/bin/bash
2ssh root@node1-1 "cd /var/lib/lxd/storage-pools/container1/containers/;
3tar -xczf edgecontainer.tar.gz edgecontainer;
4echo "Starting Container Migration";
5sudo scp edgecontainer.tar.gz root@node1-2:/var/lib/lxd/storage-pools/container1/containers/;
6echo "Migration Successful";"
7
8ssh root@node1-2 "cd /var/lib/lxd/storage-pools/container1/containers/;
9tar -xzvf edgecontainer.tar.gz; cd ../../../containers/;
10ln -s ../storage-pools/container1/containers/edgecontainer;
11echo "Importing container";
12lxd import edgecontainer;
13echo "List of containers";
14lxc list;
15echo "Starting container";
16lxc stop edgecontainer;
17lxc start edgecontainer;
18lxc list;
19echo "Running Number Plate Recognition on a Migrated Container";
20lxc exec edgecontainer /root/runalpr.sh >> time.txt;
21python3 sdnreporting1.py;
22echo "Experiment successful";"