different way of handling cloudlab extra space

Change-Id: Ic28ffb2847d2d348d7217cd380b21d2f1aef8cf4
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 7091493..3ae74e0 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -101,8 +101,18 @@
 function cloudlab_setup() {
   if [ -e /usr/testbed/bin/mkextrafs ]
   then
+    sudo mkdir -p /var/extra
+
     # Sometimes this command fails on the first try
-    sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/var/lib/libvirt/images/" || sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/var/lib/libvirt/images/"
+    sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/var/extra/" || sudo /usr/testbed/bin/mkextrafs -r /dev/sdb -qf "/var/extra/"
+
+    # we'll replace /var/lib/libvirt/images with a symlink below
+    [ -d /var/lib/libvirt/images/ ] && [ ! -h /var/lib/libvirt/images ] && sudo rmdir /var/lib/libvirt/images
+
+    sudo mkdir -p /var/extra/libvirt_images
+    sudo mkdir -p /var/extra/docker
+    [ ! -e /var/lib/libvirt/images ] && sudo ln -s /var/extra/libvirt_images /var/lib/libvirt/images
+    [ ! -e /var/lib/docker ] && sudo ln -s /var/extra/docker /var/lib/docker
 
     cd $CORDDIR/build
     SRC="#- 'on_cloudlab=True'"