[Users] Equivalent "virsh" commands to set container parameters like "prlctl set"

Pavel Vokhmyanin pvokhmyanin at virtuozzo.com
Fri Apr 22 13:42:05 MSK 2022


Hello Paulo,

Virsh itself doesn't really have a "create" command. It can define domain based on xml.
You either compose this xml yourself, or use virt-install to compose it for you. You can also use vzctl or install prl-disp-service and use prlctl.

If we're talking about OpenVZ9, you can use these commands for virt-install:

I.e. To create a container do the following:

  1.  Create a disk image with vzpkg. For example:

# mkdir -p /vz/mylinuxct
# vzpkg create image centos-7-x86_64 /vz/mylinuxct/mylinuxct.hdd
Creating Container root image at /vz/mylinuxct/mylinuxct.hdd (centos-7-x86_64)
<...>
Image was succesfully created at /vz/mylinuxct/mylinuxct.hdd


  2.  Create the container based on the disk image. For example:

# virt-install \
--connect vzct:///system \
--name mylinuxct \
--memory 2048 \
--disk 'path=/vz/mylinuxct/mylinuxct.hdd,boot_order=1,size=64' \
--graphics vnc,port=5903,listen=0.0.0.0
<...>
Starting install...
Domain creation completed.
You can restart your domain by running:
  virsh --connect vzct:///system start mylinuxct

Note, that is "vzct" driver, not "vz" or "openvz". It's a new driver implementation that uses libvzctl and vzevent instead of prl-disp-service integration.

Speaking of configuration you mentioned, they are not well documented at the moment. Easiest way for you to figure out how it translates into domain.xml is to use vzctl for configuration, and see how it reflects in the configuration file. Settings were designed to reuse VM (QEMU) configuration schema where possible.


Best Regards,
--
Pavel Vokhmyanin
Management and Integrations
Virtuozzo
________________________________
От: users-bounces at openvz.org <users-bounces at openvz.org> от имени Paulo Coghi - Coghi IT <paulocoghi at gmail.com>
Отправлено: 1 апреля 2022 г. 8:41
Кому: OpenVZ users <users at openvz.org>
Тема: [Users] Equivalent "virsh" commands to set container parameters like "prlctl set"

Hello OpenVZ community,

Now that new OpenVZ versions have officially migrated to virsh as the main management tool, I would like to ask which are the equivalent commands in vitsh to set parameters provided by "prlctl set", like --cpulimit, --cpuunits, --nodemask, --ioprio, --ioprio, --iolimit, --rate, --ratebound.

Also, is there any important step on virsh to ensure the creation of a container instead of a vm, like prlctl create  --vmtype ct?


Cordially,
Paulo Coghi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/users/attachments/20220422/9a8b6192/attachment.html>


More information about the Users mailing list