Skip to content

Commit 262ad16

Browse files
Edison SuEdison Su
authored andcommitted
disable nfs directory cache on kvm host
1 parent 08bb9ea commit 262ad16

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

python/lib/cloudutils/serviceConfig.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,33 @@ def restore(self):
321321
logging.debug(formatExceptionInfo())
322322
return False
323323

324+
class nfsConfig(serviceCfgBase):
325+
def __init__(self, syscfg):
326+
super(nfsConfig, self).__init__(syscfg)
327+
self.serviceName = "Nfs"
328+
329+
def config(self):
330+
try:
331+
if not os.path.exists("/etc/nfsmount.conf"):
332+
return True
333+
334+
cfo = configFileOps("/etc/nfsmount.conf")
335+
cfo.addEntry("AC", "False")
336+
cfo.save()
337+
338+
self.syscfg.svo.enableService("rpcbind")
339+
self.syscfg.svo.stopService("rpcbind")
340+
self.syscfg.svo.startService("rpcbind")
341+
342+
self.syscfg.svo.enableService("nfs")
343+
self.syscfg.svo.stopService("nfs")
344+
self.syscfg.svo.startService("nfs")
345+
346+
return True
347+
except:
348+
logging.debug(formatExceptionInfo())
349+
return False
350+
324351
class securityPolicyConfigUbuntu(serviceCfgBase):
325352
def __init__(self, syscfg):
326353
super(securityPolicyConfigUbuntu, self).__init__(syscfg)

python/lib/cloudutils/syscfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ def __init__(self, glbEnv):
133133
networkConfigUbuntu(self),
134134
libvirtConfigUbuntu(self),
135135
firewallConfigUbuntu(self),
136+
nfsConfig(self),
136137
cloudAgentConfig(self)]
137138

138139
#it covers RHEL6/Fedora13/Fedora14
@@ -144,6 +145,7 @@ def __init__(self, glbEnv):
144145
networkConfigRedhat(self),
145146
libvirtConfigRedhat(self),
146147
firewallConfigAgent(self),
148+
nfsConfig(self),
147149
cloudAgentConfig(self)]
148150

149151
#It covers RHEL5/CentOS5, the mainly difference is that there is no cgroup

0 commit comments

Comments
 (0)