Changes

Jump to: navigation, search

Updating Debian template

No change in size, 00:51, 16 November 2007
I think the common abbreviation for Hardware Node is HN, not HW. Also why does it suddenly use VE0?
First, you need to create a VE based on the template you want to update. Here is an example:
[HWHN]# vzctl create 555 --ostemplate debian-4.0-i386-minimal
Next, you want to specify an IP address and a nameserver:
[HWHN]# vzctl set 555 --ipadd x.x.x.x --nameserver y.y.y.y --save
You can get the value of nameserver from your /etc/resolv.conf. Your VE should have an Internet access, so you either supply a public IP, or see [[using NAT for VE with private IPs]] for information about how to use private IP and NAT.
Finally, check that Internet is working from inside a VE:
[HWHN]# vzctl exec 555 ping -n 3 www.ru
== Update ==
Enter the VE:
[HWHN]# vzctl enter 555
Update metadata and install updates:
Now, rename the existing template cache:
[HWHN]# mv /vz/template/cache/debian-4.0-i386-minimal.tar.gz{,-old}
Now create a new tarball:
[HWHN]# cd /vz/private/555 [HWHN]# tar czf /vz/template/cache/debian-4.0-i386-minimal.tar.gz .
Clean up:
[HWHN]# vzctl destroy 555 [HWHN]# rm -f /etc/vz/conf/555.conf.destroyed
== Test new template cache ==
First, compare the sizes of the old and the new template caches:
[HWHN]# ls -lh /vz/template/cache/debian-4.0-i386-minimal*
-rw-r--r-- 1 root root 55M 2007-11-13 18:11 /vz/template/cache/debian-4.0-i386-minimal.tar.gz
-rw-r--r-- 1 root root 53M 2007-08-31 02:46 /vz/template/cache/debian-4.0-i386-minimal.tar.gz-old
Try to create and start VE made from your new template:
[HWHN]# vzctl create 222 --ostemplate debian-4.0-i386-minimal [HWHN]# vzctl set 222 --ipadd 10.0.0.222 --save [HWHN]# vzctl start 222 [HWHN]# vzctl enter 222
Now execute a few basic commands to check VE is fine. Examples are: <code>ps axf</code>, <code>dpkg -l</code>, etc.
Finally, clean up the testing VE:
[HWHN]# vzctl stop 222 [HWHN]# vzctl destroy 222 [HWHN]# rm -f /etc/vz/conf/222.conf.destroyed
38
edits

Navigation menu