quads
quads copied to clipboard
[RFE] Reduce the amount of SSH connections
Is your feature request related to a problem? Please describe. When applying configuration settings for VLANs on the switches, we open an SSH connection per interface in host. Those interfaces can have the same IP address for the switch.
Describe the solution you'd like Would be nice if we could group those changes per interface in host in cloud by IP address and execute all the necessary switch commands in one single SSH session.
Describe alternatives you've considered We can start grouping them per host, open an SSH session and run edit/commit per interface. Report any failures in mongo and use this on a subsequent rerun.
The way that I had tested this for 1.0 was to do the following that was using the old port-files flat file. There are two results that are possible: Combining 1 hosts similar switch ports into the least number of ssh connections:
- Gets us the list of switchip's and interfaces attached based on current cloud / reservation
for host in $(quads --cloud-only cloud02); do awk -F "," '{print $3,$5}' /opt/quads/data/ports/$host >> /tmp/cloud02-interfaces ; done
- Group the interfaces based on switch IP's
sort -V /tmp/cloud02-interfaces awk -F " " '{if(a[$1])a[$1]=a[$1]","$2; else a[$1]=$2;}END{for (i in a)print i, a[i];}' OFS=: /tmp/cloud02-interfaces
I know with the upcoming 1.1 changes it may be need to change based upon the calls to the mongoDB
We are already grouping those from within each host but not per cloud. Would be a much greater enhancement if so. Leaving this open for that reason.
Related to: https://github.com/redhat-performance/quads/issues/266