X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_lxc.py;h=9ca2aa83d5e2d149b7e87d47c80dfc17b71b4645;hb=619f6ee406f8e11a5054c1e2c988f6eb95bce324;hp=94de3db189589d67edc41cba251186712c5177b1;hpb=5d884de3c1a7764a681d048beac8ef5234213d19;p=nodemanager.git diff --git a/sliver_lxc.py b/sliver_lxc.py index 94de3db..9ca2aa8 100644 --- a/sliver_lxc.py +++ b/sliver_lxc.py @@ -104,21 +104,22 @@ class Sliver_LXC(Sliver_Libvirt, Initscript): logger.log('sliver_lxc: %s: ERROR Expected reference image in %s'%(name,refImgDir)) return - # in fedora20 we have some difficulty in properly cleaning up /vservers/ - # also note that running e.g. btrfs subvolume create /vservers/.lvref/image /vservers/foo - # behaves differently, whether /vservers/foo exists or not: - # if /vservers/foo does not exist, it creates /vservers/foo - # but if it does exist, then it creates /vservers/foo/image !! - # so we need to check the expected container rootfs does not exist yet - # this hopefully could be removed in a future release - if os.path.exists (containerDir): - logger.log("sliver_lxc: %s: WARNING cleaning up pre-existing %s"%(name,containerDir)) - command = ['btrfs', 'subvolume', 'delete', containerDir] - logger.log_call(command, BTRFS_TIMEOUT) - # re-check - if os.path.exists (containerDir): - logger.log('sliver_lxc: %s: ERROR Could not create sliver - could not clean up empty %s'%(name,containerDir)) - return +# this hopefully should be fixed now +# # in fedora20 we have some difficulty in properly cleaning up /vservers/ +# # also note that running e.g. btrfs subvolume create /vservers/.lvref/image /vservers/foo +# # behaves differently, whether /vservers/foo exists or not: +# # if /vservers/foo does not exist, it creates /vservers/foo +# # but if it does exist, then it creates /vservers/foo/image !! +# # so we need to check the expected container rootfs does not exist yet +# # this hopefully could be removed in a future release +# if os.path.exists (containerDir): +# logger.log("sliver_lxc: %s: WARNING cleaning up pre-existing %s"%(name,containerDir)) +# command = ['btrfs', 'subvolume', 'delete', containerDir] +# logger.log_call(command, BTRFS_TIMEOUT) +# # re-check +# if os.path.exists (containerDir): +# logger.log('sliver_lxc: %s: ERROR Could not create sliver - could not clean up empty %s'%(name,containerDir)) +# return # Snapshot the reference image fs (assume the reference image is in its own # subvolume) @@ -346,10 +347,12 @@ unset pathmunge if not os.path.exists(containerDir): logger.log('sliver_lxc.destroy: %s cleanly destroyed.'%name) else: - logger.log("-TMP-cwd %s : %s"%(name,os.getcwd())) - logger.log("-TMP-lsof %s"%name) - command=['lsof'] - logger.log_call(command) + # we're in / + #logger.log("-TMP-cwd %s : %s"%(name,os.getcwd())) + # also lsof never shows anything relevant; this is painful.. + #logger.log("-TMP-lsof %s"%name) + #command=['lsof'] + #logger.log_call(command) logger.log("-TMP-ls-l %s"%name) command = ['ls', '-l', containerDir] logger.log_call(command)