#!/bin/bash
ssh root@node1-1 "cd /var/lib/lxd/storage-pools/container1/containers/;
tar -xczf edgecontainer.tar.gz edgecontainer;
echo "Starting Container Migration";
sudo scp edgecontainer.tar.gz root@node1-2:/var/lib/lxd/storage-pools/container1/containers/;
echo "Migration Successful";"

ssh root@node1-2 "cd /var/lib/lxd/storage-pools/container1/containers/;
tar -xzvf edgecontainer.tar.gz; cd ../../../containers/;
ln -s ../storage-pools/container1/containers/edgecontainer;
echo "Importing container";
lxd import edgecontainer;
echo "List of containers";
lxc list;
echo "Starting container";
lxc stop edgecontainer;
lxc start edgecontainer;
lxc list;
echo "Running Number Plate Recognition on a Migrated Container";
lxc exec edgecontainer /root/runalpr.sh >> time.txt;
python3 sdnreporting1.py;
echo "Experiment successful";"