OpenVZ Forum


Home » General » Support » Need help creating a template from an ISO
icon5.gif  Need help creating a template from an ISO [message #35461] Fri, 27 March 2009 10:16 Go to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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 [message #35464 is a reply to message #35461] Fri, 27 March 2009 10:39 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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/
Re: Need help creating a template from an ISO [message #35465 is a reply to message #35464] Fri, 27 March 2009 10:44 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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



[Updated on: Fri, 27 March 2009 10:46]

Report message to a moderator

Re: Need help creating a template from an ISO [message #35467 is a reply to message #35465] Fri, 27 March 2009 10:51 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Could you please say what in particular doesn't work?
Re: Need help creating a template from an ISO [message #35468 is a reply to message #35467] Fri, 27 March 2009 10:57 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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.




Re: Need help creating a template from an ISO [message #35470 is a reply to message #35468] Fri, 27 March 2009 11:29 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
use "tar -xv", i.e. without -f option.
Re: Need help creating a template from an ISO [message #35471 is a reply to message #35470] Fri, 27 March 2009 11:58 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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.

Re: Need help creating a template from an ISO [message #35472 is a reply to message #35471] Fri, 27 March 2009 12:23 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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.
Re: Need help creating a template from an ISO [message #35477 is a reply to message #35472] Fri, 27 March 2009 14:29 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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.

[Updated on: Fri, 27 March 2009 14:30]

Report message to a moderator

Re: Need help creating a template from an ISO [message #36270 is a reply to message #35477] Tue, 02 June 2009 16:00 Go to previous messageGo to next message
J_Voice is currently offline  J_Voice
Messages: 5
Registered: June 2009
Location: US
Junior Member
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?
Re: Need help creating a template from an ISO [message #36272 is a reply to message #36270] Wed, 03 June 2009 06:54 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
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 "/".
Re: Need help creating a template from an ISO [message #36286 is a reply to message #36272] Thu, 04 June 2009 15:12 Go to previous messageGo to next message
J_Voice is currently offline  J_Voice
Messages: 5
Registered: June 2009
Location: US
Junior Member
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.
Re: Need help creating a template from an ISO [message #36287 is a reply to message #36286] Thu, 04 June 2009 15:46 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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

[Updated on: Thu, 04 June 2009 15:47]

Report message to a moderator

icon14.gif  Re: Need help creating a template from an ISO [message #36288 is a reply to message #36287] Thu, 04 June 2009 18:31 Go to previous messageGo to next message
J_Voice is currently offline  J_Voice
Messages: 5
Registered: June 2009
Location: US
Junior Member
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 .




Re: Need help creating a template from an ISO [message #36289 is a reply to message #36288] Thu, 04 June 2009 18:53 Go to previous messageGo to next message
sammy08 is currently offline  sammy08
Messages: 21
Registered: April 2008
Junior Member
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.

Re: Need help creating a template from an ISO [message #36399 is a reply to message #36289] Mon, 15 June 2009 16:21 Go to previous message
J_Voice is currently offline  J_Voice
Messages: 5
Registered: June 2009
Location: US
Junior Member
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 )

Previous Topic: RRD Creation command missing.Openvz VPSes traffic.
Next Topic: Child can ping parent but can't access internet
Goto Forum:
  


Current Time: Mon Jul 15 20:48:40 GMT 2024

Total time taken to generate the page: 0.02458 seconds