Microsoft Virtualization Discussions

Add-NaNetVlan and Set-NaNetInterface corrupt /etc/hosts

hland
2,971 Views

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

1 ACCEPTED SOLUTION

hland
2,971 Views

Support discovered that this is a bug in the underlying ZAPI call and therefore in Ontap. It will be fixed in some future release of Data ONTAP. See

http://support.netapp.com/NOW/cgi-bin/bol?Type=Detail&Display=710228

Regards

Hendrik

View solution in original post

1 REPLY 1

hland
2,972 Views

Support discovered that this is a bug in the underlying ZAPI call and therefore in Ontap. It will be fixed in some future release of Data ONTAP. See

http://support.netapp.com/NOW/cgi-bin/bol?Type=Detail&Display=710228

Regards

Hendrik

Public