<div class="gmail_quote">2009/3/16 Anton Protopopov <span dir="ltr"><<a href="mailto:aspsk2@gmail.com">aspsk2@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all.<br><br>When libvirt creates an OpenVZ machine, it does smth like<br>  # vzctl create $ctid --ostemplate `ostemplate`<br>And we can't specify an --config `config` argument. In this case vzctl chooses<br>a default config file (a value of CONFIG variable from /etc/vz/vz.conf).<br>

<br>But there are cases when we want to specify a config file directly, as in<br>  # vzctl create $ctid --ostemplate `ostemplate` --config `config`<br><br>I think, that we can try to use the same `ostemplate` name as --config value, if corresponding template exists,<br>

i.e., if there is a file /etc/vz/conf/ve-`ostemplate`.conf-sample, libvirt will run a command<br>  # vzctl create $ctid --ostemplate `ostemplate` --config `ostemplate`<br>Otherwise, it will run it's default command<br>

  # vzctl create $ctid --ostemplate `ostemplate`<br>(the same arguments.)<br><br>-----------<br>Example of creating a machine with nondefault config:<br><br>1. Create /etc/vz/conf/ve-altlinux-test.conf-sample<br>2. Create /var/lib/vz/template/cache/altlinux-test.tar<br>

3. Use libvirt with (hypothetical) XML:<br><domain type="openvz"><br>  <name>100</name><br>  <memory>1</memory><br>  <os><type>exe</type></os><br>  <devices><br>

    <filesystem type="template"><br>      <source name="altlinux-test"/><br>      <target dir="/"/><br>    </filesystem><br>  </devices><br></domain><br><br>

-----------<br>Example of creating a machine with default config:<br>
<br>
1. Ensure there is no /etc/vz/conf/ve-altlinux-test.conf-sample<br>
2. Create /var/lib/vz/template/cache/altlinux-test.tar<br>
3. Use libvirt with (the same as above) XML file<br>
-----------<br>
</blockquote></div><br>ping?<br>