Need help creating a template from an ISO
Hello All, I want to create a template from an ISO. I installed the system to a machine and was trying to follow this http://wiki.openvz.org/Creating_a_CentOS_5.0_Template without success. The ISO is actually a complete system including the CentOS 5.2 OS and I want to convert it to work in VPS. Any Help would be much appreciated. regards, Kabong08
Re: Need help creating a template from an ISO
Hello, Quote: I want to create a template from an ISO. I installed the system to a machine and was trying to follow this http://wiki.openvz.org/Creating_a_CentOS_5.0_Template without success. Could you please say what in particular failed? What features a template from ISO should have? Why don't you use precreated templates? http://download.openvz.org/template/precreated/contrib/
maratrus wrote on Fri, 27 March 2009 05:39 Hello, Could you please say what in particular failed? What features a template from ISO should have? Why don't you use precreated templates? http://download.openvz.org/template/precreated/contrib/ Hi, The ISO is not just an OS so those precreated templates are no good to me. The ISO is actually a complete VOIP System so when I boot from the CD and the system is installed I have a complete VOIP PBX up and running. So I need to convert it to template. Thanks
Could you please say what in particular doesn't work?
maratrus wrote on Fri, 27 March 2009 05:51 Could you please say what in particular doesn't work? I reached step No. 9 as per the wiki instruction: [root@localhost 50]# gunzip -dc /vz/template/cache/centos-5-0-i386-asterisk-1.4-image.tar.gz | tar -xvf tar: option requires an argument -- f Try `tar --help' or `tar --usage' for more information.
use "tar -xv", i.e. without -f option.
maratrus wrote on Fri, 27 March 2009 06:29 use "tar -xv", i.e. without -f option. I did that but: tar: Skipping to next header gunzip: /vz/template/cache/centos-5-0-i386-asterisk-1.4-image.tar.gz : invalid compressed data--crc error gunzip: /vz/template/cache/centos-5-0-i386-asterisk-1.4-image.tar.gz : invalid compressed data--length error tar: Error exit delayed from previous errors When I originally tarred my image I got this message at the end: tar: Error exit delayed from previous errors I don't know if that has something to do with it.
Quote: When I originally tarred my image I got this message at the end: tar: Error exit delayed from previous errors As far as I understand you tar was not able to create appropriate tarball. You should find a reason and fix it. Did you use -v option during the creation. Please, look closely at output error messages. They might help to find what's wrong with tar.
maratrus wrote on Fri, 27 March 2009 07:23 As far as I understand you tar was not able to create appropriate tarball. You should find a reason and fix it. Did you use -v option during the creation. Please, look closely at output error messages. They might help to find what's wrong with tar. I followed the wiki to the letter and I tried to tar the system about 5 times. I want to try something else but I don't know if it will work. On the CD there is a directory containing 453 rpms needed for the system and there are 2 kickstart files, ks.cfg and ks_advanced.cfg. Is there anyway that we can modify the kickstart to tar the system at the end of the install before it actually reboots to complete the installation? The reason why I am asking the system has loads of services that start on boot and I tried to able the obvious ones before tarring the system but it didn't help. Thanks for your help.
I'm having similar issues, using very similar custom install of CentOS. Wanting to know if anyone has made any progress or any new links?
Hi, yes we were able to create a proper template but most of the subsequent messages were private. Please, compare the command that you're trying to make work with # tar –czvf /tmp/centos-5.0-<ARCH>-<DISTRO>-image.tar.gz –X /tmp/exclude / please, pay attention at trailing "/".
I apologize for being a bit naive with OpenVZ, but I've only been messing with it for a little over 2 weeks now. I'm also certain Sammy and I are after the same goal with what seems to almost the exact same software just from the descriptions, but I'm way behind in the process of doing what you say has been accomplished. A step-by-step (doesn't necessarily have to be verbose) guide on building this template would be infinitely appreciated. thank you tons in advance, I've been scouring forums, wikis, etc. for a week and only found a couple hints.
It wasn't that difficult to create the template. I basically followed http://wiki.openvz.org/Creating_a_CentOS_5.0_Template So you can create a template from an existing server installation that you have. To help you better I have modified step 2 to read as follows: You need to tar the contents of your existing system. 1. First, create a file called /tmp/exclude and add the following lines to it: .bash_history lost+found /dev/* /mnt/* /tmp/* /proc/* /sys/* /usr/src/* a). Now, tar the system into a single file up by typing: tar –czvf /tmp/centos-5.0-<ARCH>-<SYSTEM>-image.tar.gz –X /tmp/exclude / where <ARCH> represents the system architecture (i386 or x86_64) and <SYSTEM> represents what you what to call your system for example "asterisk-1.4" it is an Asterisk 1.4 PBX system. b). Now transfer the file over to the OpenVZ server into /vz/template/cache folder. Then for step 26. 26. Finally, package up the new template by typing tar –czvf /vz/template/cache/centos-5-<ARCH>-<SYSTEM>-AT.tar.gz ./. for example: tar –czvf /vz/template/cache/centos-5-3-i386-Asterisk-1.4.25-AT.tar.gz ./. Would be an Asterisk 1.4.25 Application Template (AT) running on CentOS 5.3-i386 version. Hope this helps. regards, Sammy
That is a great starting point, thank you very much! The next hurdle I know I will have before even continuing is the fact that this Asterisk system has a proprietary 'wrapping' loosely speaking. Basically after installing the OS like an average CentOS install, system restarts , then halts at a prompt wanting a Username and Password that is provided by said company, then using the active internet connection it verifies the credentials then I assume runs some scripts, activates the server for HTTP interface, SIP trunks, etc. Problem is, IF there is a login to get around this temporarily and get to a normal prompt and execute the commands you've explained, It's definitely not provided. I suppose one way would be to purchase the license, wait for the credentials, enter them , then package the system. This might be a workaround for testing but become terrible when producing lots of VEs .
J_Voice wrote on Thu, 04 June 2009 14:31 That is a great starting point, thank you very much! The next hurdle I know I will have before even continuing is the fact that this Asterisk system has a proprietary 'wrapping' loosely speaking. Basically after installing the OS like an average CentOS install, system restarts , then halts at a prompt wanting a Username and Password that is provided by said company, then using the active internet connection it verifies the credentials then I assume runs some scripts, activates the server for HTTP interface, SIP trunks, etc. Problem is, IF there is a login to get around this temporarily and get to a normal prompt and execute the commands you've explained, It's definitely not provided. I am not too sure if I understand what you mean here but you let the system bootup as normal then connect via ssh or login at the console and begin to tar as explain in the previous post.
Ok I've made small progress, but I finally managed to get behind the script that runs immediately after installation , so I could drop to a normal shell as root. I run the tar command with the excludes and it looks great for a couple minutes then fails out with the strangest error I've seen yet: Tar: Error exit delayed from previous errors: That's it. Then it drops back to shell and i'm left with a 3/4 done tarball. ( I've listed the contents and it def. not all there )