from pwd import getpwnam
from string import Template
+# vsys probably should not be a plugin
+# the thing is, the right way to handle stuff would be that
+# if slivers get created by doing a,b,c
+# then they sohuld be delted by doing c,b,a
+# the current ordering model for vsys plugins completely fails to capture that
+from plugins.vsys import removeSliverFromVsys
+
import libvirt
import logger
vref = rec['vref']
if vref is None:
- vref = "lxc-f14-x86_64"
+ vref = "lxc-f18-x86_64"
logger.log("sliver_libvirt: %s: WARNING - no vref attached, using hard-wired default %s" % (name,vref))
refImgDir = os.path.join(Sliver_LXC.REF_IMG_BASE_DIR, vref)
dom = conn.lookupByName(name)
except:
dom = conn.defineXML(xml)
- logger.verbose('lxc_create: %s -> %s'%(name, Sliver_Libvirt.debuginfo(dom)))
+ logger.verbose('lxc_create: %s -> %s'%(name, Sliver_Libvirt.dom_details(dom)))
@staticmethod
command = ['/usr/sbin/userdel', '-f', '-r', name]
logger.log_call(command, timeout=15*60)
- if os.path.exists(os.path.join(containerDir,"vsys")):
- # Slivers with vsys running will fail the subvolume delete.
- # A more permanent solution may be to ensure that the vsys module
- # is called before the sliver is destroyed.
- logger.log("destroying vsys directory and restarting vsys")
- logger.log_call(["rm", "-fR", os.path.join(containerDir, "vsys")])
- logger.log_call(["/etc/init.d/vsys", "restart", ])
+ # Slivers with vsys running will fail the subvolume delete.
+ # A more permanent solution may be to ensure that the vsys module
+ # is called before the sliver is destroyed.
+ removeSliverFromVsys (name)
# Remove rootfs of destroyed domain
command = ['btrfs', 'subvolume', 'delete', containerDir]