Merge branch 'lxc_devel' of github.com:planetlab/NodeManager into lxc_devel
[nodemanager.git] / sliver_lxc.py
index 5a0d52f..b1dc99f 100644 (file)
@@ -37,8 +37,8 @@ class Sliver_LXC(lv.Sliver_Libvirt):
         # arch x86_64
         vref = rec['vref']
         if vref is None:
-            logger.log('sliver_libvirt: %s: WARNING - no vref attached defaults to lxc-debian' % (name))
-            vref = "lxc-squeeze-x86_64"
+            logger.log('sliver_libvirt: %s: WARNING - no vref attached defaults to lxc-f14' % (name))
+            vref = "lxc-f14-x86_64"
 
         refImgDir    = os.path.join(Sliver_LXC.REF_IMG_BASE_DIR, vref)
         containerDir = os.path.join(Sliver_LXC.CON_BASE_DIR, name)
@@ -52,12 +52,14 @@ class Sliver_LXC(lv.Sliver_Libvirt):
         # subvolume)
         command = ['btrfs', 'subvolume', 'snapshot', refImgDir, containerDir]
         logger.log_call(command, timeout=15*60)
+        command = ['chmod', '755', containerDir]
+        logger.log_call(command, timeout=15*60)
 
         # TODO: set quotas...
 
         # Set hostname. A valid hostname cannot have '_'
-        with open(os.path.join(containerDir, 'etc/hostname'), 'w') as f:
-            print >>f, name.replace('_', '-')
+        #with open(os.path.join(containerDir, 'etc/hostname'), 'w') as f:
+        #    print >>f, name.replace('_', '-')
 
         # Add slices group if not already present
         command = ['/usr/sbin/groupadd', 'slices']