KVM to OpenVZ, again

lovendo

New Member
Jan 16, 2014
2
0
1
Hello, I've read lots of posts and guides but still isn't clear to me how can I do the following:

1- I'd like to make a installation of a Linux OS from zero, i.e., install CentOS 6.5 minimal. So I do this in a KVM VirtualMachine.
2- Then, I'd like to personalize the new system, i.e., install apache, mysql, etc.
3- Finally, I'd like to use this system as a Template to create other KVM VM or OpenVZ Containers.

I think what I'm trying to achive is quite normal, but I don't know how to proceed for the 3rd point. Any ideas? Suggestions?
 
as far as KVM is concerned, its explained in the wiki: http://pve.proxmox.com/wiki/VM_Templates_and_Clones

I wouldn't recommend converting a KVM template into an openvz template because this most likely leaves the openvz template MUCH bigger than it actually needs to be if properly set up. Instead, you would want to create the openvz template as a openvz template. By that I mean:

- create a new container from a centos 6.5 minimal template
- install the packages you need
- configure some basic things you want all your further containers to have (time service, syslog etc)
- remove unneccessary data: /tmp contents and the apt/rpm cache
- stop container
- create template. this is as simple as:

Code:
cd /var/lib/vz/private/100    #or whereever you have stored the container you just modified

tar -cvzpf /var/lib/vz/template/cache/centos-6.5-amd64-minimal-modified.tar.gz .    #the name is just a suggestion. Again you need to insert the correct path, where you store your templates
#make sure to not omit this trailing dot ;)  ----------------------------------^
 
Last edited:
Thanks mo_, I really appreciate your answer.

However, this step isn't clear:
- create a new container from a centos 6.5 minimal template

There's not any "CentOS 6.5 Minimal" OpenVZ Template in Proxmox Content > Templates , but "Centos 6-3.1", which in fact is not "minimal".

If I can obtain a "CentOS 6.5 Minimal" container template my problems would be solved easier.
 
hm. yes apparently youre right. however, openvz has more recent templates, such as: download.openvz.org/.../centos-6-x86_64.tar.gz
this template is dated 2014-01-17 01:23:17 215 Mb, so... very much recent (meaning it should be 6.5... I hope). And while it does not say minimal, the "normal" template shouldn't contain too many extraneous packages.

Please note, that this is NOT a proxmox-maintained template, which means that it will work fine, but it does NOT have the manipulations necessary to make the webinterface console work. If you need that:
Proxmox wiki - OpenVZ_Console#Modifying_your_templates
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!