OpenVZ Forum


Home » General » Support » Possible to export/import VE?
Possible to export/import VE? [message #41209] Mon, 13 December 2010 17:01 Go to next message
neo62matrix is currently offline  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 #41213 is a reply to message #41209] Tue, 14 December 2010 09:49 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

1) yes
2) yes

Bye,
Thorsten
Re: Possible to export/import VE? [message #41216 is a reply to message #41213] Tue, 14 December 2010 10:38 Go to previous messageGo to next message
neo62matrix is currently offline  neo62matrix
Messages: 3
Registered: December 2010
Location: France
Junior Member
curx wrote on Tue, 14 December 2010 04:49
Hi,

1) yes
2) yes

Bye,
Thorsten


Thanks you! Smile

And how to do it?
Re: Possible to export/import VE? [message #41221 is a reply to message #41216] Tue, 14 December 2010 13:01 Go to previous message
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
Previous Topic: custom actions after "vzctl start"
Next Topic: VZDump across network via SSH?
Goto Forum:
  


Current Time: Wed Jul 17 07:31:57 GMT 2024

Total time taken to generate the page: 0.02901 seconds