Using NIM to distribute files to your AIX servers.At the IBM Technical Symposium in Sydney last week, a person approached me to discuss NIM and some of its capabilities. During the conversation we discussed how NIM could be used to copy files from the NIM master to its NIM clients. I promised to send them some information on how to achieve this ASAP. They were smart and followed up with an email the next day! They’d even tried to configure this on their systems but hit a small problem.
"Hello Chris, # nim -o define -t file_res -a loca But for the life of me I cannot find anywhere under NIM to allocate the resource to the client i.e. to push the file out.. Do you have any ideas, this one I am stuck on. Can I actually push files out by themselves? Thanks"
The answer is yes! You can define a file_res resource on the NIM master. From the AIX 7.2 Knowledge Centre:
"A file_res resource is where NIM allows for resource files to be stored on the server. When the resource is allocated to a client, a copy of the directory contents is placed on the client at a location that is specified by the dest_dir attribute." "-a
location=Value Specifies the full path name of the
directory on the NIM server. This path is used as a source directory
among clients.
Notes: If the target directory does not exist on the destination machine, the entire source directory contents are copied (including the hidden files in the top-level directory). If the target directory exists on the destination machine, the source directory contents are copied (excluding the hidden files in the top-level directory)."
http
Here's an example. I want to distribute (copy) all of the files located in /usr/local/etc, to a NIM client. The original (source) directory and files reside on the NIM master.
root@MASTER / # ls –l /usr/local/etc/
First, I'll create a new file_res NIM resource, called soe_conf.
root@MASTER / # nim -o define -t file_res -a loca root@MASTER / # lsnim -t file_res # lsnim -l soe_conf
Now I can allocate the new resource to the NIM client named AIXmig. root@MASTER / # lsnim -l AIXmig
Before I customise the client, the /usr/local/etc directory does NOT exist on the NIM client.
root@AIXmig / # ls -ltr /usr/local/etc
On the NIM master, I issue the "nim -o cust" operation against the NIM client AIXmig.
root@MASTER /# nim -o cust AIXmig
Looking again on the NIM client, I now find the directory and all of its files have been copied to the correct location on the host. root@AIXmig / # ls –l /usr/local/etc
The file_res resource, is automatically deallocated from the NIM client.
root@MASTER / # lsnim -l AIXmig |
On NIM BOS installation, i do a copy of reference config files from NIM server to client and i have experienced :
1. The files permission is important to success this copy (775)
2. And subdirectories was not copied.
Thank's.
"If you’re looking for a fast and cheap way of copying a bunch of files from a central location to one or more servers"
how about dcp?
Fileset Level State Type Description (Uninstaller)
----------------------------------------------------------------------------
dsm.dsh 7.1.3.45 C F Distributed Systems Management
Dsh
Well, sure. I've written about dcp (and dsh) a few times before.
http://www.ibmsystemsmag.com/aix/tipstechniques/systemsmanagement/DSH-Simplifies-the-Task-of-Managing-Multiple-Syste/
https://www.ibm.com/developerworks/community/blogs/cgaix/entry/managing_users_with_dsh_and_chpasswd_plus_info_on_dsm_and_dping1?lang=en
NIM is an alternative approach.
Cheers,
Chris