OpenVZ Forum


Home » General » Support » *SOLVED* Easy way to create templates from iso packages
*SOLVED* Easy way to create templates from iso packages [message #14441] Thu, 28 June 2007 03:44 Go to next message
mdes is currently offline  mdes
Messages: 9
Registered: June 2007
Junior Member
I am trying to install liveCD based packages into VEs. Simplest
solution seems to be to create a template use the iso pacakge
but there does not seem to a standard way to do it. I could always
create a VE using the OS template corresponding to the liveCD but
the problem is the package in question is a little flaky when installed via the component RPMs.

So I trying to figure out if I can create a template with the OS
and application package metadata. This seems a common enough requirement if someone wants to virtualize an appliance for openVZ.
Would be glad to work with someone if an utility needs to be written. I have been hacking UNIX and BSD for about 22 years now ! But I am a openVZ newbie, so I do need help there (Back in the 80s we only had chroot).

Thanks
Mdes

[Updated on: Mon, 02 July 2007 05:27] by Moderator

Report message to a moderator

Re: Easy way to create templates from iso packages [message #14458 is a reply to message #14441] Thu, 28 June 2007 12:19 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Hello,

Sorry, I slightly dont' undestand your question... Smile

Can you describe the problem a bit more precisely, step by step?

Thanks,
Vasily.
Re: Easy way to create templates from iso packages [message #14460 is a reply to message #14458] Thu, 28 June 2007 13:59 Go to previous messageGo to next message
mdes is currently offline  mdes
Messages: 9
Registered: June 2007
Junior Member
I guess I was not clear enough.

I have a liveCD of a PBX appliance running fedora 7.

I need to run this inside a VE.

Std procedure would be

1. Create a VE with fedora 7 template

2. Enter the VE

3. Install the application RPMs


The problem is that the install procedure is broken, so just installing the RPMs is not installing the application correctly.



So I trying to see if I can create a template from the liveCD
of the appliance. Along with the OS Metadata, I am trying to
copy all the major directories so that the appliance's metadata
is also copied along with the OS metadata.

So the steps would be

1. Extract OS metadata
2. Extract appliance metadata
3. create template from the metadata extracted from the above 2 steps.


Please note that this procedure is needed only because the install procedure of the PBX appliance is broken.

Thanks

Re: Easy way to create templates from iso packages [message #14464 is a reply to message #14460] Thu, 28 June 2007 14:59 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Sorry, what do you call metadata? Smile This term is used in OpenVZ as http://wiki.openvz.org/OS_template_metadata

I guess you mean something else under metadata? Smile
Re: Easy way to create templates from iso packages [message #14465 is a reply to message #14464] Thu, 28 June 2007 15:14 Go to previous messageGo to next message
mdes is currently offline  mdes
Messages: 9
Registered: June 2007
Junior Member
I guess metadata is an overloaded word.

I am referring to all the stuff that the installed program
installs in the systems directories (/usr/lib, /var, ..). As opposed to the stuff it installs in its private directories.

The appliance I have seems to have created a fair amount of files
across the various systems directories (would be nice if applications kept most stuff in their private directories).
This is one of the reasons we want to use VZ. The application
is not able to co-exist with other apps, due to library
and other app. dependencies.

The only way to recreate this environment is to copy all the
extra files in the various systems directories. Since this
has to be repeated for every release, I am trying to automate
the process.
Re: Easy way to create templates from iso packages [message #14500 is a reply to message #14465] Fri, 29 June 2007 11:56 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
Hi. The easiest way to achieve this, from my experience, is to simply boot into the OS you want to create a template of, stop all the software you can, and create a tar file of the entire OS. You now have a precreated template image which you can use on 'vzctl create'. This method will not get you a nice rpm by rpm installation procedure for upgrading a single package later, but just a huge collection of files which make up your OS. Depending on your situation, this may be easier or less convenient. If you need to change the OS template, such as update a package, what I do is deploy it, enter it, update it, stop it, and tar it back up.




-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
[Issue closed]Re: Easy way to create templates from iso packages [message #14511 is a reply to message #14500] Fri, 29 June 2007 20:22 Go to previous messageGo to next message
mdes is currently offline  mdes
Messages: 9
Registered: June 2007
Junior Member
Thanks,
that was precisely the answer I was looking for. Wasn't sure if
doing that would work. I know it is messy but as I said in my posting, I have no way of creating a working installation by installing a set of RPMs.

But I do wish, packages would stick to a minimal set of directories
when they install themselves. It makes package removal easy. Think it is time a nice XML based package manger was written with journalled install . We could also do with a database/LDAP based OS config data.


Thanks
Re: *SOLVED* Easy way to create templates from iso packages [message #22840 is a reply to message #14441] Tue, 06 November 2007 06:58 Go to previous messageGo to next message
SoftDux is currently offline  SoftDux
Messages: 55
Registered: November 2007
Location: Johannesburg, South Afric...
Member
How do I create an OpenVZ template from a Linux installation CD / DVD, without installing it to another PC first?
Re: *SOLVED* Easy way to create templates from iso packages [message #22927 is a reply to message #22840] Wed, 07 November 2007 15:20 Go to previous messageGo to next message
alticon-brian is currently offline  alticon-brian
Messages: 27
Registered: February 2006
Location: Washington, DC
Junior Member
SoftDux,

That was kindof their point. AFAIK... You don't. As mdes said:

I have no way of creating a working installation by installing a set of RPMs.

The RPMs must be installed somehow. Possibly this is done through actually installing and then tar-ing up the filesystem. Possibly this is done through vzpkgcache (which is a cleaner way of doing the exact same thing).

--Brian
Re: *SOLVED* Easy way to create templates from iso packages [message #22930 is a reply to message #14441] Wed, 07 November 2007 15:30 Go to previous messageGo to next message
SoftDux is currently offline  SoftDux
Messages: 55
Registered: November 2007
Location: Johannesburg, South Afric...
Member
ok, fair enought. I'm new to OpenVZ (as you can see Embarassed )

So, if I have all the CD's / DVD's that I want to make templates from, but I don't want to format the HDD every time to "make a new template", how do I install directly off the DVD / CD?
Re: *SOLVED* Easy way to create templates from iso packages [message #22941 is a reply to message #22930] Wed, 07 November 2007 18:02 Go to previous messageGo to next message
DreamVPS_Joe is currently offline  DreamVPS_Joe
Messages: 1
Registered: November 2007
Junior Member
SoftDux wrote on Wed, 07 November 2007 07:30


So, if I have all the CD's / DVD's that I want to make templates from, but I don't want to format the HDD every time to "make a new template", how do I install directly off the DVD / CD?

Use VMware and install each OS as a VM. From there, you can tar up the entire root fs and make your image like that. Put it on your ovz node, and then you will have to do some additional steps, such as disabling some services, fixing mtab and fstab. If you look through the openvz wiki, you'll find more info on this, like the centos guide: http://wiki.openvz.org/Creating_a_CentOS_5.0_Template

Joe


Re: *SOLVED* Easy way to create templates from iso packages [message #22943 is a reply to message #14441] Wed, 07 November 2007 18:16 Go to previous message
SoftDux is currently offline  SoftDux
Messages: 55
Registered: November 2007
Location: Johannesburg, South Afric...
Member
ok, that's worth a shot Smile I'll give it a go, thanx
Previous Topic: How to create a full template for centos
Next Topic: *SOLVED* Live-Migration and SYSV message queues
Goto Forum:
  


Current Time: Fri Nov 15 21:53:58 GMT 2024

Total time taken to generate the page: 0.03325 seconds