1. Login to OpenVZ(Hardware Node).
  2. Start the VM for the template creation.(replace 105 with your container ID)
    vzctl start 105
  3. Remove the IP from the VM.
    sudo vzctl set 105 --ipdel all --save
  4. Stop the container.
    vzctl stop 105
  5. Create template
    cd /vz/private/105/
    tar -czf /vz/template/cache/<OS>-<ARCH>.tar.gz ./
  6. Create the configuration file.
    cp /etc/vz/dists/centos.conf /etc/vz/dists/template-name.conf

One thought on “Create OpenVZ OS Template

  1. This is well done, it is how we do our own internal knowledge base and we’re glad to see so many IT people still using OpenVZ. We use it extensively and can deploy multiple OpenVZ nodes more quickly than KVM or VMWare and it is so handy to just enter them rather than dealing with password management on temporary containers for testing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s