Possible to export/import VE? [message #41209] |
Mon, 13 December 2010 17:01 |
neo62matrix
Messages: 3 Registered: December 2010 Location: France
|
Junior Member |
|
|
Hi everyone!
I post here, because I didn't find the answer on internet...
I have 2 questions:
1) First, is that possible to install a package in a VE who is not on the template?
2) Can we import a VE who was modify before, in a new OpenVZ system? For example, I send a template to someone, he creates his VE with this template, he adds differents things, like softwares for example... Can he send to me his VE, and can I integrate in my OpenVZ?
Thanks a lot
|
|
|
|
|
Re: Possible to export/import VE? [message #41221 is a reply to message #41216] |
Tue, 14 December 2010 13:01 |
|
curx
Messages: 739 Registered: February 2006 Location: Nürnberg, Germany
|
Senior Member |
|
|
via pm
---8<...
Hi!
I can't send an answer on the post, so I send you a pm, cause it's important for me to have the answer.
You say that it's possible, but how you do it? I have try to tar.gz directly the ve in the /var/lib/vz/private/101 for example, but I didn't work!
Have you an solution?
Thanks a lot!
---8<...
1)
you should "backup" the container via tar (--numeric-owner ... -z), send the copy to anybody to modify this container
as name of this ct tar file: use should use:
linuxdistibution-version-architecture-shortname_of_use.tar.g z
e.g.
debian-6.0-amd64-minimal-prestable.tar.gz
2)
use file 1) as a pre-template, cp file to /var/lib/vz/template/cache
# create new ct and start it
e.g.
% vzctl create <unused_ctid> create --ostemplate debian-6.0-amd64-minimal-prestable
# set some need for your networkin
% vzctl set <unused_ctid>
# enter it
% vzctl enter <unused_ctid>
and modify this ct for any needs
after done stop it, pack it and save this to /var/lib/vz/template/cache and you can use it a ct template
for advanced users, only!
Createing templates without an OpenVZ host:
unpack a template .tar.gz to a new directory and chroot to this "containertree".
For Debian and Derivates:
- move /sbin/start-stop-daemon to /sbin/start-stop-daemon.orig
- create a fake /sbin/start-stop-daemon file
- deploy any packages to your pre-template
- remove fake and move orig file
- leave chroot env
- pack it and use it as a template
Bye,
Thorsten
|
|
|