Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Rename ganeti nodes

503 views
Skip to first unread message

Sp4rKY

unread,
Oct 29, 2009, 4:16:57 AM10/29/09
to ganeti
Hi,

we are currently reorganizing our network infrastructure for one of
our ganeti clusters.

That means :
- updating ip range from 192.168.25.0/24 to :
* 10.10.10.0/24 for hosts
* 10.10.11.0/24 for vms
- updating fqdns from (hostname|vmname).foo.tld to :
* hostname.host.gnt for hosts
* vmname.vm.gnt for vms

It seems the main issue here is to rename ganeti hosts / update their
IP because I can't find somethign in ganeti to provide that.
All hosts have vm, so I can't just destroy the host, and readd it
later with new name/ip...

For the vm, it should not be an issue, because I can rename them in
ganeti.

Any tips would be welcome :)

Olivier Tharan

unread,
Oct 29, 2009, 5:15:31 AM10/29/09
to gan...@googlegroups.com
On Thu, Oct 29, 2009 at 9:16 AM, Sp4rKY <maxe...@gmail.com> wrote:
>  - updating fqdns from (hostname|vmname).foo.tld to :
>    * hostname.host.gnt for hosts
>    * vmname.vm.gnt for vms
>
> It seems the main issue here is to rename ganeti hosts / update their
> IP because I can't find somethign in ganeti to provide that.
> All hosts have vm, so I can't just destroy the host, and readd it
> later with new name/ip...

It is indeed a bit difficult because the node names are all over in
the configuration, especially the logical volumes used for the disks
contain the node name, etc.

You have described the simple solution, which requires a bit of work
(migrate everything off one node, remove it from the cluster, rename
it, re-add it to the cluster, repeat with next node, etc.

The other solution is to stop the daemons and edit the configuration
files by hand but you must be extra careful with that (make backups,
make sure nothing else is writing to the config files, etc.)

> For the vm, it should not be an issue, because I can rename them in
> ganeti.

Correct.

--
olive

Sp4rKY

unread,
Oct 29, 2009, 5:21:28 AM10/29/09
to ganeti

> You have described the simple solution, which requires a bit of work
> (migrate everything off one node, remove it from the cluster, rename
> it, re-add it to the cluster, repeat with next node, etc.
I will have an issue with that, because the ip range will be updated
from 192.168.25 to 10.10.10,
So I guess I won't be able to add a node using 10.10.10 ip if the
master is 192.168.25,right ?
Or does an alias on eth0 will be enough ? (could be if ganeti likes
having many subnets on same cluster).

>
> The other solution is to stop the daemons and edit the configuration
> files by hand but you must be extra careful with that (make backups,
> make sure nothing else is writing to the config files, etc.)
Where are all these config files located ? Are they only plain-text
files ?
I guess I must edit then on the master node, then propagate them on
other nodes by hands (ganeti-cluster redist-conf will works ? )

Iustin Pop

unread,
Oct 29, 2009, 6:35:26 AM10/29/09
to gan...@googlegroups.com
On Thu, Oct 29, 2009 at 02:21:28AM -0700, Sp4rKY wrote:
>
>
> > You have described the simple solution, which requires a bit of work
> > (migrate everything off one node, remove it from the cluster, rename
> > it, re-add it to the cluster, repeat with next node, etc.
> I will have an issue with that, because the ip range will be updated
> from 192.168.25 to 10.10.10,
> So I guess I won't be able to add a node using 10.10.10 ip if the
> master is 192.168.25,right ?
> Or does an alias on eth0 will be enough ? (could be if ganeti likes
> having many subnets on same cluster).

Yes, it will be enough. Ganeti has no issues with multiple subnets.

> > The other solution is to stop the daemons and edit the configuration
> > files by hand but you must be extra careful with that (make backups,
> > make sure nothing else is writing to the config files, etc.)
> Where are all these config files located ? Are they only plain-text
> files ?

/var/lib/ganeti/, and yes they are plain-text files (in JSON format).

> I guess I must edit then on the master node, then propagate them on
> other nodes by hands (ganeti-cluster redist-conf will works ? )

Yes.

regards,
iustin

Olivier Tharan

unread,
Oct 29, 2009, 1:02:22 PM10/29/09
to gan...@googlegroups.com
On Thu, Oct 29, 2009 at 11:35 AM, Iustin Pop <ius...@google.com> wrote:
>> I guess I must edit then on the master node, then propagate them on
>> other nodes by hands (ganeti-cluster redist-conf will works ? )
>
> Yes.

While the master daemon is stopped, you will actually need to scp the
files by hand. If the files are not in sync, ganeti-masterd does not
start.

--
olive

Iustin Pop

unread,
Nov 2, 2009, 2:31:33 AM11/2/09
to gan...@googlegroups.com

Ah yes, for renaming the nodes indeed. Alternatively one can force startup and then run redist-conf.

iustin

Cyril Bouthors

unread,
Jun 5, 2015, 9:37:21 AM6/5/15
to gan...@googlegroups.com
For the record, here is a working procedure to rename a Ganeti node I have used several times:

ssh $ganeti_master
old
=old_node_name
new=new_node_name
cd
/var/lib/ganeti/
/
etc/init.d/ganeti stop
sed
-i -e "s/$old/$new/g" config.data ssconf_*
/etc/init.d/ganeti start
gnt
-node list | grep -E "$old|$new"



John N.

unread,
Jan 6, 2016, 3:54:42 AM1/6/16
to ganeti
Hi Cyril,

Are you sure this is a safe procedure? and can it be used to rename any mode (master and slave)?

Cheers
J.

Cyril Bouthors

unread,
Jan 6, 2016, 4:26:20 AM1/6/16
to gan...@googlegroups.com

As I said,  I used this procedure several times safely on a live production environment.

candlerb

unread,
Jan 6, 2016, 8:31:18 AM1/6/16
to ganeti
Notes:

* It assumes that your node names are long and unique enough that sed will not mangle any other data in the ssconf file
* I think you should do a 'gnt-cluster redist-conf' after any change like this
* The hostname on the node itself should be changed (i.e. /etc/hostname, hostname -F /etc/hostname)
* Not sure if it's safe if there are running instances on the node? (Probably OK if ganeti refers to nodes by their uuid consistently)
* Possibly other things I haven't thought of

Ivan Rossi

unread,
Aug 26, 2016, 11:27:14 AM8/26/16
to gan...@googlegroups.com
Is this information still current for 2.15?

I have the unfortunate situation where the nodes should change the
domain name from node subdomain.example.it to node.otherdomain.it but
keeping the same IP that is on a private net.
Reply all
Reply to author
Forward
0 new messages