10.5. Converting CentOS 7 and 8 in Virtual Environments to VzLinux 8

The CentOS 7 and 8 operating systems running in virtual machines and containers can be converted to VzLinux 8:

  • CentOS 8 virtual machines can be converted from the inside.

  • CentOS 7 and 8 containers can be converted from the host.

To be eligible for conversion, a virtual environment must not be running cPanel and Plesk or have package repositories configured other than official and EPEL.

Note the following:

  • Internet access is required.

  • If conversion fails with “[Errno 24] Too many open files”, try increasing the corresponding limit, which is 1024 by default, and restart the conversion. For example, run ulimit -n 10240 to increase the limit of open files to 10240. It will last until the end of the session.

10.5.1. Converting CentOS 8 in Virtual Machines

To convert CentOS 8 in a virtual machine to VzLinux 8, do the following:

  1. Log in to the VM as the root user.

  2. Download the vzdeploy8 script and mark it as executable:

    # wget http://repo.virtuozzo.com/vzlinux/vzdeploy/vzdeploy8
    # chmod 755 vzdeploy8


    The script is also available at GitHub and the official package repository.

  3. Run the script:

    # ./vzdeploy8

The script will swap the CentOS repositories with the VzLinux ones and replace the required packages.

10.5.2. Converting CentOS 7 and 8 in Containers

To convert CentOS 7 or 8 in one or more containers to VzLinux 8, do the following:

  1. Install the conversion tools:

    # yum install vzdeploy8
  2. Find the convertable containers. For example:

    # vzconvert8 list
    ct1 (3f85ee14-40d2-47ff-b9ea-5855226ae7cc)
    ct2 (4fb8edc8-9a1e-45ac-9adb-aca8e78b57c6)
    ct3 (70ea3ab8-7b92-4f53-aa1a-b471e38e9e7d)
  3. Start the conversion. For example:

    # vzconvert8 convert --parallel 3 ct1 ct2 ct3 --log log.txt

    In this example, all specified containers are converted in parallel. Omit --parallel <N> to have the containers converted one by one. In addition, the log files log.txt and log.txt.<CT_ID> will be saved.

After the procedure completes, you can check that it was successful. For example:

# prlctl list -a -o name,uuid,dist
ct1  {3f85ee14-40d2-47ff-b9ea-5855226ae7cc}  vzlinux8
ct2  {4fb8edc8-9a1e-45ac-9adb-aca8e78b57c6}  vzlinux8
ct3  {70ea3ab8-7b92-4f53-aa1a-b471e38e9e7d}  vzlinux8 Troubleshooting

If conversion of CentOS in a container fails, try doing the following:

  1. Check the log files for any issues.

  2. Restore the container to its original state from the earliest snapshot named pre-vzlinux8. Such a snapshot is created automatically when each conversion starts (and remains after it succeeds). For example:

    # prlctl snapshot-list ct1
    PARENT_SNAPSHOT_ID                      SNAPSHOT_ID
    # prlctl snapshot-list ct1 -i 77bcbd69-2b7e-4815-9677-d0db922877cd
    Name: pre-vzlinux8
    Date: 2021-09-22 12:38:56
    # prlctl snapshot-switch ct1 -i 77bcbd69-2b7e-4815-9677-d0db922877cd
  3. Restart the conversion.