OpenVZ Forum


Home » Mailing lists » Users » how can i easily replicate a container?
how can i easily replicate a container? [message #47752] Fri, 07 September 2012 06:23 Go to next message
Rene Dokbua is currently offline  Rene Dokbua
Messages: 24
Registered: May 2012
Junior Member
Sometimes it's useful to replicate a container, for example for
testing. It seems very quick to make a snapshot using vzctl chkpnt,
but is there a way to restore this as a new container?
Re: how can i easily replicate a container? [message #47754 is a reply to message #47752] Fri, 07 September 2012 15:14 Go to previous messageGo to next message
dowdle is currently offline  dowdle
Messages: 261
Registered: December 2005
Location: Bozeman, Montana
Senior Member
Rene,

----- Original Message -----
> Sometimes it's useful to replicate a container, for example for
> testing. It seems very quick to make a snapshot using vzctl chkpnt,
> but is there a way to restore this as a new container?

I haven't worked with ploop-based containers so maybe it is different for them... but with a non-ploop container... to duplicate it... all you have to do is copy the container filesystem (preferably while it isn't running) and config... then edit the config to a make the new container unique... and then start the new container. Each time a container is started, its settings in the config (hostname, ip address, disk quota, nameserver, etc) are injected into the filesystem and then it is started.

TYL,
--
Scott Dowdle
704 Church Street
Belgrade, MT 59714
(406)388-0827 [home]
(406)994-3931 [work]


--
TYL, Scott Dowdle
Belgrade, Montana, USA
Re: how can i easily replicate a container? [message #47768 is a reply to message #47754] Sat, 08 September 2012 04:50 Go to previous message
Rene Dokbua is currently offline  Rene Dokbua
Messages: 24
Registered: May 2012
Junior Member
Hi Scott,

Yes I know how to do it pre-ploop, but it has considerable downtime.
The question is, is there a way to utilize the snapshop option of
ploop to replicate a container and thereby reducing the downtime.

Rene

On Fri, Sep 7, 2012 at 10:14 PM, Scott Dowdle <dowdle@montanalinux.org> wrote:
> Rene,
>
> ----- Original Message -----
>> Sometimes it's useful to replicate a container, for example for
>> testing. It seems very quick to make a snapshot using vzctl chkpnt,
>> but is there a way to restore this as a new container?
>
> I haven't worked with ploop-based containers so maybe it is different for them... but with a non-ploop container... to duplicate it... all you have to do is copy the container filesystem (preferably while it isn't running) and config... then edit the config to a make the new container unique... and then start the new container. Each time a container is started, its settings in the config (hostname, ip address, disk quota, nameserver, etc) are injected into the filesystem and then it is started.
>
> TYL,
> --
> Scott Dowdle
> 704 Church Street
> Belgrade, MT 59714
> (406)388-0827 [home]
> (406)994-3931 [work]
Previous Topic: Docs to understand how OpenVZ is implemented.
Next Topic: broken URLs for fedora-17 precreated templates on wiki
Goto Forum:
  


Current Time: Sat Nov 09 00:50:32 GMT 2024

Total time taken to generate the page: 0.03189 seconds