Hi guys!
I'm looking for a way to automate my gateways update process, and i'ts almost done.but...
I have a number of Group Networks, and almost two groups configured on each gateway.
When I use mwg-coordinator command line to join the gateway do the cluster I can inform the Group Network, but only one.
/opt/mwg/bin/mwg-coordinator -A "cmd:trigger_action=cmclusteradd;options:ip=10.11.12.13,group=Network-group,forcedetachgui=yes"
Is there a way to inform more than one? Or a way to (command line) add a second Group Network to the gateway?
Thanks a lot!!!
I was working at this challenge, but no progress wit this issue...
Let me share what I do and more about my tests.
First of all, my final aim are to develop a script to automate the gateway update process. We have a cluster with 31 gateways, and to do manually the update task demands a lot of time.
All was done logged at the gateway that are the "head" of the cluster, and previously I enable the authentication by certificate (ssh-keygen & ssh-copy-id)
/opt/mwg/bin/mwg-coordinator -S structure|grep \(|sort|uniq|tr -s " "|cut -d " " -f2,3
This command shows all gateways on the cluster and their UUIDs
/opt/mwg/bin/mwg-coordinator -S structure | grep .| tail -$(echo $(/opt/mwg/bin/mwg-coordinator -S structure |grep -n .| wc -l)-$(/opt/mwg/bin/mwg-coordinator -S structure |grep -n .| grep -n group_network|cut -d":" -f1)|bc)|grep "group\|("|tr -s " " > group_network
This will create a backup of the Group Network configuration
/opt/mwg/bin/mwg-coordinator -A "cmd:trigger_action=cmclusterdelete;options:uuid=4210F73F-0327-A7ED-ABCD-B1351CB5B929,forcedetachgui=yes"
Now I use this to delete each host from the cluster, using their UUIDs. One command for each UUID.
ssh <HOSTNAME> "mwg-switch-repo main; yum clean all; yum upgrade yum; yum upgrade mlos3-upgrade; yum -y upgrade; exit"
All commands needed to update the host. One command for each host
/opt/mwg/bin/mwg-coordinator -A "cmd:trigger_action=cmclusteradd;options:ip=<IP>,group=<NetworkName>,forcedetachgui=yes"
Adding back all gateways to the cluster. One command for each host
Here I'm stopped.
At my scenario each gateway have more that one Group Network, and using this commands, after remounting the cluster, all them will be at the same Group Network. Sure I can correct this at GUI, but I want to automate this.
ls -1 /opt/mwg/storage/default/|grep -v "hash\|initial"|grep -v hash|tail -1
This command will get the path of the last saved (running) configuration, and I can edit the Group Network configuration directly at the XML file (com.scur.engine.cmclusternode.configuration.xml), but unfortunately this changes do not become effective, and the added Group Networks do not appear at the GUI.
Keep trying...
One step more...
It was possible to edit the XML file and add all that I want using a python script.
If I edit the Gateway#1 correspondent XML file, so I need to restart the mwg service at that gateway.
After this, logging on the console all my Group Networks are there.
But it's not finished yet...
I need a cli to save the configuration.
If you could help...
New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.
Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership: