Re: [libvirt] [PATCH] Openvz: how to use a nondefault config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/3/16 Anton Protopopov <aspsk2@xxxxxxxxx>
Hi all.

When libvirt creates an OpenVZ machine, it does smth like
  # vzctl create $ctid --ostemplate `ostemplate`
And we can't specify an --config `config` argument. In this case vzctl chooses
a default config file (a value of CONFIG variable from /etc/vz/vz.conf).

But there are cases when we want to specify a config file directly, as in
  # vzctl create $ctid --ostemplate `ostemplate` --config `config`

I think, that we can try to use the same `ostemplate` name as --config value, if corresponding template exists,
i.e., if there is a file /etc/vz/conf/ve-`ostemplate`.conf-sample, libvirt will run a command
  # vzctl create $ctid --ostemplate `ostemplate` --config `ostemplate`
Otherwise, it will run it's default command
  # vzctl create $ctid --ostemplate `ostemplate`
(the same arguments.)

-----------
Example of creating a machine with nondefault config:

1. Create /etc/vz/conf/ve-altlinux-test.conf-sample
2. Create /var/lib/vz/template/cache/altlinux-test.tar
3. Use libvirt with (hypothetical) XML:
<domain type="openvz">
  <name>100</name>
  <memory>1</memory>
  <os><type>exe</type></os>
  <devices>
    <filesystem type="template">
      <source name="altlinux-test"/>
      <target dir="/"/>
    </filesystem>
  </devices>
</domain>

-----------
Example of creating a machine with default config:

1. Ensure there is no /etc/vz/conf/ve-altlinux-test.conf-sample
2. Create /var/lib/vz/template/cache/altlinux-test.tar
3. Use libvirt with (the same as above) XML file
-----------

ping?
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]