Editing Files from the Data ONTAP CLI16 January 2007
While setting up a Network Appliance storage system today for a customer, I ran into a situation that was a bit puzzling for a moment. I needed to change the IP address on the storage system’s clustered controllers, but in order to do that I needed to edit some files in the /etc directory on the root volume. Normally, that wouldn’t be a big deal; I’d just mount the root volume (vol0) via CIFS or NFS from my MacBook Pro and go from there.
However, in this particular instance, the customer hadn’t licensed the CIFS and NFS protocols because this storage system would be used strictly as an iSCSI target for a VMware ESX Server deployment. That meant there would be no mounting the root volume this time. So how does one go about editing files in the Data ONTAP CLI?
Excellent question. The answer is the
priv set advanced command. Rightly so, NetApp warns you that running
priv set advanced exposes functionality that can be dangerous; don’t muck around in there or you’re likely to find yourself with a non-functional NetApp storage system. However, with a bit of caution, the advanced commands are just what we need in this situation.
The advanced command set includes useful commands like
ls (to list the files in the
/etc directory, for example),
rdfile (think of
more from a Linux/UNIX system), and
wrfile (for redirecting standard input to a text file). While there’s no text editor per se, these three tools can get us most of the way there.
So here’s how I used the advanced command set to change the IP addresses of the storage system:
Enabled the advanced command set with `priv set advanced .
Displayed the current contents of the
/etc/hosts.new(containing the contents of
/etc/hostswith the changes I needed) using
Verified the contents of `/etc/hosts.new using rdfile.
Rebooted the storage system for the change to take effect.
Upon the reboot, the storage system was now using the new IP addresses requested by the customer. Problem solved!Tags: NetApp · ONTAP Previous Post: Linux-AD Integration, Version 4 Next Post: Networking Diagramming on the Mac