How to Update an OpenVZ Template
To bring this thread current, I've added a few minor tweaks to Joe Roper's original post about how to upgrade, update, or migrate an existing OpenVZ template. Thanks to the great work of Darrell Dillman, we'll have a new OpenVZ template for PIAF2 with CentOS 6.2, Asterisk 1.8.8, and FreePBX 2.9 shortly.
1. Create virtual machine
2. update it, and install everything
3. yum clean all ; Save some space.
4. See how big it is, and change the disk size to slightly larger.
5. Restart it, check it works.
6. Run passwd-master and set obscure default password
7. amportal chown
8. mknod /dev/tty9 c 4 9
9. From within Asterisk CLI, use
database del to delete everything that appears with
database show including:
Code:
database del dundi secret
database del dundi secretexpiry
10. Stop it
11. Delete IP address and adjust etc/resolv.conf
12. Clean out bash history in root/.bash_history
13. tar the contents of /var/lib/vz/private/XXX
14. Put tarball in /var/lib/vz/template/cache
15. Template will now be available in Create Virtual Machines.
You can then take the virtual image and transfer it to any OpenVZ server.