Change IP addresses for ganeti cluster.

28 views
Skip to first unread message

tshul...@gmail.com

unread,
Mar 16, 2023, 12:14:36 AM3/16/23
to ganeti
Hi Team, 
Is there any ways to changes IP addresses for ganeti nodes to different network 
Eg: existing 192.168.2.0/24  
           to     192.168.3.0/24

or Do we need to reinstall everything from Zero.


Regards, 

Phil Regnauld

unread,
Mar 16, 2023, 4:10:19 AM3/16/23
to gan...@googlegroups.com
Have done it before, as follows:

1. Stop ganeti with systemctl stop ganeti (or equivalent).
This only stops Ganeti services/daemons, the VMs will continue running.

2. Make a backup copy of the configuration:
cd /var/lib/ganeti
cp -p config.data config.data.ok-2023xxxx

3. Edit the config file (it's one larse JSON file), and find the IP addresses
you need to change.

You'll need to find sections like:

"nodes":{"0be85869-0586-4d9c-9144-588234ae6565":{"name":"virtual3.xxxx","primary_ip":"aa.bb.cc.dd","secondary_ip":"x.y.z.3","master_candidate":true

... and replace the primary_ip, and if you have a replication/secondary
network, the secondary_ip as well.

4. Push the new config file to all nodes manually into /var/lib/ganeti
(make sure the permissions are correct).

4. Update the IPs on the nodes themselves -- maybe you don't need to restart,
but you will need to update /etc/network/interfaces (debian'ish) or
netplan config or other, then reconfigure the IFs.

5. How you stay in touch with the nodes if you don't have an OOB console at
this stage, is for you to figure out :) Maybe use screen, or you have
console access, etc...

6. Verify the IPs are as they should be with ip addr / ifconfig

7. Restart Ganeti on the non master nodes first, check /var/log/ganeti/node-daemon.log
and luxi-daemon.log primarily

8. Restart Ganeti on the master node, check locks

9. Assuming ganeti services come up, do a gnt-node list and gnt-cluster verify

10. Profit!

Rollback is: stop ganeti services, restore config, restore interface settings
to previous values (check config file ownership/permissions) and restart ganeti
services.

Phil
> --
> You received this message because you are subscribed to the Google Groups "ganeti" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ganeti+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ganeti/5d873039-02eb-4ca7-b70c-43e2d000f1a2n%40googlegroups.com.


--

tshul...@gmail.com

unread,
Mar 16, 2023, 5:11:01 AM3/16/23
to ganeti
Thanks. 
Reply all
Reply to author
Forward
0 new messages