ONTAP Discussions

script to compare rc config on ha pair

ccolht
6,520 Views

Has anybody created a script to compare the nodes in an HA pair to make sure the rc files are in sync? I do most admin on the comandline and while being careful sometimes miss creating a vlan or something. We use a lot of vfilers and system manager is no help here.

If nobody else has done it, I'll do it. Should do it in powershell. Need to break out of my perl shell...

7 REPLIES 7

shaunjurr
6,520 Views

NetApp has provided such a script for many years in the Utility Tools section on NOW:

HA Configuration Checker (cf-config-check.cgi)

ccolht
6,523 Views

I've tried that but it is not very complete for network configs. It doesn't check for ifgrp/vif or vlan configs. It just compares ifconfig <-> ifconfig and rc <-> rc but not ifconfig <-> rc. This would be useful on any filer. I'm running it on a 3240AE pair.

Also, the warnings it gives for option mismatches are mostly incorrect but it doesn't flag any HA issues because of them. I'm running v8.0.1P4 which is not listed as a supported version in the file. Other than ifgrp, there isn't much difference from a network perspective. That is the part that changes most frequently for me. Lots of vlan and vfiler changes.

peter_lehmann
6,523 Views

Two options come to my mind:

1. Try the "Configuration Check" in Operations Manager (select one cluster node in Member Details and then click on it in the left pane)

2. Give it a try with the Ontap PowerShell Toolkit.

I'm not a scripter, so I cannot copy paste a solution in here. But it looks to me you could do almost anything with this PowerShell stuff.

Hope this helps,

Peter

ccolht
6,523 Views

I tried #1 but the results were worse than ha-configcheck:

<snip>

Error: There are 17 partner interfaces on filer1-1.mycompany.com specifying local interface vif0-106 () on filer1-2.mycompany.com.

Error:

vif0-116 on anc-ewc-flr01-2.corp.acsalaska.com may not be taken over correctly because it has netmask 255.0.0.0, whereas partner interface vif0-116 on anc-ewc-flr01-1.corp.acsalaska.com has netmask 255.255.255.0.

Error: Interface vif0-106 on filer1-2.mycompany.com will not be taken over because it does not have a matching interface on partner node filer1-1.mycompany.com.

Error: Interface c0a on filer1-2.mycompany.com will not be taken over because it does not have a matching interface on partner node filer1-1.mycompany.com.

Error: Interface e0P on filer1-2.mycompany.com will not be taken over because it does not have a matching interface on partner node filer1-1.mycompany.com.

Error: Interface losk on filer1-1.mycompany.com will not be taken over because it does not have a matching interface on partner node filer1-2.mycompany.com.

Action: Reconfigure filer1-1.mycompany.com to specify only one partner interface for vif0-106 () on filer1-2.mycompany.com.

Action: Configure a network interface on filer1-1.mycompany.com to specify filer1-2.mycompany.com's vif0-106 interface as its partner.

Action: Configure a network interface on filer1-1.mycompany.com to specify filer1-2.mycompany.com's c0a interface as its partner.

Action: Configure a network interface on filer1-1.mycompany.com to specify filer1-2.mycompany.com's e0P interface as its partner.

Action: Configure a network interface on filer1-2.mycompany.com to specify filer1-1.mycompany.com's losk interface as its partner.

</snip>

It reported that every interface was a partner for every other interface .  It also said I should setup a partner for losk! That would be interesting. The error about the netmasks is not true but reported on every interface. The netmask is not given on the partner's head. I think it was using the deffault network for class A networks to compare. Very odd.

Here's how my rc files are arranged:

# global config

ifgrp creates

vlan create <mgmt vlans>

ifconfig <mgmt interfaces>

route add default

#vfilers

# custA

vlan create vifx vlanX vlanY vlanZ

ifconfig vifx-X <args if primary> partner vifx-X

...

# custB

vlan create vifx vlanD vlanE

ifconfig vifx-E<args if primary> partner vifx-E

...

vfiler run <custB> route add default x.x.x.x 1

...

Perhaps the config checker is confused by this? I don't use the `hostname` trick. ha-config-check looks for that but doesn't require it.

I guess I'll write something. Probably start with ha-config-check since I know perl.

owemanu
5,570 Views

Hi, did you manage to produce a script that worked? If so could you possibly share it with me.

Thanks

Fooldall
4,853 Views

A working script here to use as a template would be key.


@owemanu wrote:

Hi, did you manage to produce a script that worked? If so could you possibly share it with me.

Thanks


 

OLANREWAJOU
6,520 Views

You need to add the path to your ha-config-check.cgi to your path environment variable in Windows 7 and the  run the script using "ha-config-check.exe -s username@filerA username@filerB".

It worked for me!

Public