summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
Diffstat (limited to 'func')
-rw-r--r--func/minion/modules/virt.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/func/minion/modules/virt.py b/func/minion/modules/virt.py
index ba5759e..e6a896a 100644
--- a/func/minion/modules/virt.py
+++ b/func/minion/modules/virt.py
@@ -122,6 +122,9 @@ class FuncLibvirtConnection(object):
def nodeinfo(self):
return self.conn.getInfo()
+ def get_type(self):
+ return self.conn.getType()
+
class Virt(func_module.FuncModule):
@@ -184,6 +187,24 @@ class Virt(func_module.FuncModule):
pass
return results
+ def autostart(self, vm):
+ self.conn = self.__get_conn()
+ if self.conn.get_type() == "Xen":
+ autostart_args = [
+ "/bin/ln",
+ "-s",
+ "/etc/xen/%s" % vm,
+ "/etc/xen/auto"
+ ]
+ else:
+ autostart_args = [
+ "/usr/bin/virsh",
+ "autostart",
+ vm
+ ]
+
+ return sub_process.call(autostart_args,shell=False,close_fds=True)
+
def freemem(self):
self.conn = self.__get_conn()
# Start with the physical memory and subtract