CIFS not enabled properly on cluster resource that was created before upgrading to OES2 SP2

  • 7005192
  • 20-Jan-2010
  • 27-Apr-2012

Environment

Novell Open Enterprise Server 2 (OES 2) Linux SP2

Situation

CIFS not enabled properly on cluster resource that was created before upgrading to OES2 SP2
CIFS object class and attributes are not added to the virtual server object
cifsPool.py script fails with -610 error

Resolution

When a resource is created prior to SP2, the CIFS attributes are not added to the virtual server object even if CIFS is checked.  When CIFS is checked on an existing resource using iManager (prior to sp2), the novcifs command is added to the scripts with an incorrect format.  The cifsPool.py script is needed to correct the novcifs format and to add the attributes to the virtual server object.
 
When a resource is created in SP2, the CIFS attributes are added to the virtual server object even if CIFS is not checked.  When CIFS is checked on an existing resource using iManager on SP2, the novcifs command is added to the scripts with the correct format.  The cifsPool.py script is not needed.
 
If a resource is created prior to SP2 and then iManager on SP2 is used to check CIFS, the attributes are not added to the virtual server object, but the novcifs command has the correct syntax.  The cifspool.py script fails because the load script has the correct syntax for novcifs.
 
See Additional Information for a modified version of cifsPool.py that will work when the novcifs command in the load script has the correct syntax.  Copy the content of Additional Information to a file and use the same syntax as cifsPool.py.  cifsPool.py syntax

Additional Information

Script to add CIFS object class and attributes to virtual server object when the novcifs command in the load script has the correct syntax
------------------------------
import struct
import ldap
import sys
import traceback
import re
import string
 
def cifsEnableServer(ld, ncpServerDn, ipAddress, cifsServerName):
 retval = 0
 ip = string.split(ipAddress, ".")
 ipBytes = struct.pack("BBBB", int(ip[0]), int(ip[1]), int(ip[2]), int(ip[3]))
 attrs = []
 attrs.append( ( ldap.MOD_ADD,"objectClass", "nfapCIFSConfigInfo") )
 attrs.append( (ldap.MOD_ADD,"nfapCIFSAttach", [ "1#" + ipBytes ]) )
 attrs.append( (ldap.MOD_ADD,"nfapCIFSComment", "Cluster Virtual CIFS Server") )
 attrs.append( (ldap.MOD_ADD,"nfapCIFSServerName", cifsServerName) )
 
 ld.modify_s(ncpServerDn, attrs)
 
def getStringAttr(res, attr):
 return res[0][1][attr][0]
 
def getDetails(script):
 tmpscript=[]
 tmpscript=string.split(script,'\n')
 for line in tmpscript:
  line = string.strip(line)
  if len(line) == 0:
   continue
  found = re.search(r'novcifs.+?--vserver[\s]*=[\s]*(.+?)[\s]+--ip-addr[\s]*=[\s]*(.+?)$',line, re.IGNORECASE)
  if found:
   ncpServerDn = found.expand(r'\1')
   ipAddress = found.expand(r'\2')
   return ncpServerDn, ipAddress
 return "",""
 
def changeDnFormat(ncpServerDn):
 ncpServerDn = ncpServerDn.strip('.')
 ncpServerDn = ncpServerDn.rsplit('.',1)[0]
 serverUDN = ncpServerDn.replace('.',',')
 return serverUDN
 
try:
 resourceDn = sys.argv[1]
 cifsServerName = sys.argv[2]
 ldapUrl = sys.argv[3]
 adminDn = sys.argv[4]
 adminPw = sys.argv[5]
 ld = ldap.initialize(ldapUrl)
 ld.simple_bind_s(adminDn, adminPw)
 res = ld.search_s(resourceDn, ldap.SCOPE_BASE)
 loadScript = getStringAttr(res, "nCSCRMLoadScript")
 ncpServerDn,ipAddress = getDetails(loadScript)
 oldNcpServerDn = changeDnFormat(ncpServerDn)
 cifsEnableServer(ld, oldNcpServerDn, ipAddress, cifsServerName)
 
except:
 traceback.print_exc()