Introduction

This blog explains how to restore an OpenVZ / Virtuozzo 7 node after reloading CentOS 7, using a full-node backup that stores container data inside a loopback filesystem (vz-private.ext4).
The steps below are based on a real production recovery, where multiple containers were successfully restored and brought online with minimal downtime.
1. This guide is suitable for:
2. Post-OS reload recovery
3. Disaster Recovery (DR)
4. Server rebuilds

Prerequisites
1. A freshly provisioned server with console or SSH access
2. A supported host operating system installed:
3. Root-level access
1. CentOS 7
2. VzLinux 7
3. Virtuozzo 7
4. Internet connectivity (for package installation)
5. An existing OpenVZ 7 full-node backup
6. Backup created from the same OpenVZ major version

Step 1:
Reload CentOS 7
Reinstall the operating system using your provider’s control panel.
After installation:
1. Log in as root
2. Do not create any containers
3. Do not modify /vz manually yet
Step 2:
Install the OpenVZ kernel and required user-space tools:

$ yum install -y epel-release
$ yum install -y vzkernel vzctl vzquota ploop prlctl
$ reboot

After rebooting, verify the kernel using the following command.

$ uname -r

Verify OpenVZ is operational:

$ vzlist -a

Step 3:
Prepare OpenVZ Directory Structure
Ensure the OpenVZ directory structure exists:

$ mkdir -p /vz/{private,root,template,backup}

Confirm /vz/private is empty:

$ ls -A /vz/private

If not empty, back it up and recreate it.

Step 4:
Restore the Backup Archive
Copy the full-node backup archive to the server (example location: /root) and extract it:

$ cd /root
$ tar -xvf server-backup-2026-01-01.tar.gz

This will extract the backup into:

$ /root/backupopenvz/

Verify contents:

ls /root/backupopenv8

You should see:

Step 5:
Container data is stored inside a loopback ext4 filesystem.
Mount this filesystem directly to /vz/private so OpenVZ can detect containers immediately.

$ mount -o loop /root/backupopenvz/vz-private.ext4 /vz/private/

Verify the mount:

$ mount | grep vz-private

Verify container directories:

$ ls /vz/private

Expected output:

⚠️ Do not add this mount to /etc/fstab.
This mount is intended only for the restore process.
Step 6:
Restore only the OpenVZ configuration directory (do not replace the full /etc):

$ cp -a /root/backupopenvz/etc/vz /etc/

Verify container configs:

$ ls /etc/vz/conf


Expected output:

Step 7:
Restore container OS templates:

$ cp -a /root/backupopenvz/vz/template/* /vz/template/

Verify:

$ ls /vz/template

Step 8:
Start containers one by one:

$ vzctl start 101
$ vzctl start 102
$ vzctl start 103
$ vzctl start 104

Check status:

$ vzlist -a

Step 9:
Enter a container:

vzctl enter 101

Inside the container, verify:

$ ip a
$ df -h
$ ping 8.8.8.8

Exit and repeat for others if required.

Conclusion:
By following these steps, you can reliably restore an OpenVZ / Virtuozzo 7 node after a CentOS 7 reload.
This approach:
1. Preserves container data
2. Avoids configuration corruption
3. Minimises downtime
4. Is repeatable and production-safe

Leave a Reply