add lxc_template.xml to packaging
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 11 Apr 2012 22:06:12 +0000 (00:06 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 11 Apr 2012 22:06:12 +0000 (00:06 +0200)
lxc-sliceimage.spec
lxc_template.xml [new file with mode: 0644]

index 10e5aa4..3c0a0c6 100644 (file)
@@ -33,6 +33,7 @@ rm -rf $RPM_BUILD_ROOT
 install -D -m 755 initscripts/lxc-sliceimage ${RPM_BUILD_ROOT}/%{_initrddir}/lxc-sliceimage
 install -D -m 644 cron.d/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/lxc-sliceimage
 install -D -m 644 logrotate/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/lxc-sliceimage
+install -C -m 644 lxc_template.xml $RPM_BUILD_ROOT/vservers/.lvref/lxc_template.xml
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -41,6 +42,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_initrddir}/lxc-sliceimage
 %{_sysconfdir}/cron.d/lxc-sliceimage
 %{_sysconfdir}/logrotate.d/lxc-sliceimage
+/vservers/.lvref
 
 %post
 chkconfig --add lxc-sliceimage
diff --git a/lxc_template.xml b/lxc_template.xml
new file mode 100644 (file)
index 0000000..66ff206
--- /dev/null
@@ -0,0 +1,25 @@
+<domain type='lxc'>
+  <name>$name</name>
+  <memory>32768</memory>
+  <os>
+    <type>exe</type>
+    <init>/sbin/init</init>
+  </os>
+  <vcpu>1</vcpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <emulator>/usr/libexec/libvirt_lxc</emulator>
+    <filesystem type='mount'>
+      <source dir='/vservers/$name/'/>
+      <target dir='/'/>
+    </filesystem>
+    <interface type='network'>
+      <source network='default'/>
+      <target dev='veth$xid'/>
+    </interface>
+    <console type='pty' />
+  </devices>
+</domain>