Copy or clone an instance

1,103 views
Skip to first unread message

Mauro Sánchez

unread,
Apr 18, 2012, 8:33:35 AM4/18/12
to gan...@googlegroups.com
Hello.
Is there a way to copy/clone an instance in a cluster?
Maybe there is no command to do it, but there is another way that I am
not aware of.
I have cluster with two nodes and I would like to copy or clone one of
the instances that I have there, so I don't have to install it from
scratch.
Thanks a lot for the help.
Cheers.
Mauro.

Iustin Pop

unread,
Apr 18, 2012, 9:18:57 AM4/18/12
to gan...@googlegroups.com
On Wed, Apr 18, 2012 at 14:33, Mauro Sánchez <mau...@gmail.com> wrote:
>
> Hello.
> Is there a way to copy/clone an instance in a cluster?
> Maybe there is no command to do it, but there is another way that I am
> not aware of.
> I have cluster with two nodes and I would like to copy or clone one of
> the instances that I have there, so I don't have to install it from
> scratch.

Would gnt-backup export && gnt-instance import with a new name work for you?

iustin

Mauro Sánchez

unread,
Apr 18, 2012, 9:58:34 AM4/18/12
to gan...@googlegroups.com

Ok, and what about the ip address defined in the instance? Would it
generate some kind of trouble?

Iustin Pop

unread,
Apr 18, 2012, 10:00:15 AM4/18/12
to gan...@googlegroups.com
On Wed, Apr 18, 2012 at 10:58:34AM -0300, Mauro S�nchez wrote:
> El d�a 18 de abril de 2012 10:18, Iustin Pop <ius...@google.com> escribi�:

> > On Wed, Apr 18, 2012 at 14:33, Mauro S�nchez <mau...@gmail.com> wrote:
> >>
> >> Hello.
> >> Is there a way to copy/clone an instance in a cluster?
> >> Maybe there is no command to do it, but there is another way that I am
> >> not aware of.
> >> I have cluster with two nodes and I would like to copy or clone one of
> >> the instances that I have there, so I don't have to install it from
> >> scratch.
> >
> > Would gnt-backup export && gnt-instance import with a new name work for you?
> >
> > iustin
>
> Ok, and what about the ip address defined in the instance? Would it
> generate some kind of trouble?

Ah, now I see what you mean. Yes, if you had static IPs, and if the OS
scripts do not do the right thing on rename, then it might.

But if the OS scripts are correct (and for example update
/etc/network/interfaces), then this should be handled automatically.
You'd still have to care if the name/IP is hardcoded in other places.

iustin

Alan Simon

unread,
Jul 9, 2012, 10:26:14 AM7/9/12
to gan...@googlegroups.com
Iustin -

I'm unclear on how to import an exported image with a new name.  What is the correct command to use?

Alan

insrc

unread,
Jul 9, 2012, 11:41:20 AM7/9/12
to gan...@googlegroups.com
On Mon, Jul 9, 2012 at 4:26 PM, Alan Simon <acs...@gmail.com> wrote:
Iustin -

I'm unclear on how to import an exported image with a new name.  What is the correct command to use? 
Think that you're looking for the "--src-dir" and "--src-node" option of gnt-backup. It took me also a while to get the right command :(

So basically, to create a new instance from a exported deboostrap instance saved on gnt-node1:/var/lib/ganeti/export/<exported-instance>: <code>
gnt-backup import --debug -t <instance-disk-type>   --src-node gnt-node1  --src-dir  /var/lib/ganeti/export/<exported-instance>  <new-instance-hostname-to-create>
</code>


HTH,
Thanks

Alan Simon

unread,
Jul 10, 2012, 8:53:10 AM7/10/12
to gan...@googlegroups.com
insrc -

Thank you.  I had to add --node and --net parameters to your example to get it to work.

Alan
Reply all
Reply to author
Forward
0 new messages