Post

Create OpenVZ OS Template

  1. Login to OpenVZ(Hardware Node).
  2. Start the VM for the template creation.(replace 105 with your container ID)

    1
    
     vzctl start 105
    
  3. Remove the IP from the VM.

    1
    
     sudo vzctl set 105 --ipdel all --save
    
  4. Stop the container.

    1
    
     vzctl stop 105
    
  5. Create template

    1
    
     cd /vz/private/105/
    
    1
    
     tar -czf /vz/template/cache/<OS>-<ARCH>.tar.gz ./
    
  6. Create the configuration file.

    1
    
     cp /etc/vz/dists/centos.conf /etc/vz/dists/template-name.conf
    
This post is licensed under CC BY 4.0 by the author.