Hi,
I'm working on a solution to manipulate network configurations in Ontap. However, I found that the cmdlets Add-NaNetVlan and Set-NaNetInterface corrupt the /etc/hosts file on the storage system. Here's what I'm doing:
My initial hosts file looks like this (lab system)
#Auto-generated by zapi_net_config Fri Apr 26 08:34:37 CEST 2013
127.0.0.1 localhost localhost-stack
127.0.10.1 localhost-10 localhost-bsd
127.0.20.1 localhost-20 localhost-sk
::1 localhost
192.168.31.2 labfiler01 labfiler01-e0a
1.2.3.4 labfiler01-e1a-222
1.2.3.5 labfiler01-e1b-226
1.2.3.7 labfiler01-e1a-223
Now in run Add-NaNetVlan -Interface e1b -Vlans 229
The /etc/hosts now looks like this:
#Auto-generated by zapi_net_config Fri Apr 26 09:33:40 CEST 2013
127.0.0.1 localhost localhost-stack
127.0.10.1 localhost-10 localhost-bsd
127.0.20.1 localhost-20 localhost-sk
::1 localhost
192.168.31.2 labfiler01 labfiler01-e0a
1.2.3.4 labfiler01 labfiler01-e1a-222
1.2.3.7 labfiler01 labfiler01-e1a-223
1.2.3.5 labfiler01 labfiler01-e1b-226
Note that PoSh added the hostname to each line in /etc/hosts, basically mapping the hostname to a number of different IP addresses, although it should only resolve to the main IP address (192.168.31.2). Not even sure what adding a VLAN leads to changes in /etc/hosts...
I reverted /etc/hosts back to the original state, than ran Set-NaNetInterface -InterfaceName e1b-229 -Address 1.2.3.9 -Netmask 255.255.255.0
Now /etc/hosts looks like this
#Auto-generated by zapi_net_config Fri Apr 26 09:37:08 CEST 2013
127.0.0.1 localhost localhost-stack
127.0.10.1 localhost-10 localhost-bsd
127.0.20.1 localhost-20 localhost-sk
::1 localhost
192.168.31.2 labfiler01 labfiler01-e0a
1.2.3.4 labfiler01 labfiler01-e1a-222
1.2.3.7 labfiler01 labfiler01-e1a-223
1.2.3.5 labfiler01 labfiler01-e1b-226
1.2.3.9 labfiler01 labfiler01-e1b-229
It correctly added a line to the hosts file but again included the hostname in this line as well as in every other line.
Is this a bug in the toolkit? Can I do anything to prevent this behaviour?
Thanks
Hendrik