Skip to content

Commit 749e149

Browse files
Merge pull request #818 from shirishaganta1/shared-mode-proc-mem
MachineConfig.py:Add support which boots the lpar in user defined shared mode
2 parents c9259b0 + 27220a3 commit 749e149

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

common/OpTestHMC.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,11 @@ def change_proc_mode(self, proc_mode, sharing_mode, min_proc_units, desired_proc
412412
'''
413413
if proc_mode == 'shared':
414414
self.set_lpar_cfg("proc_mode=shared,sharing_mode=%s,min_proc_units=%s,max_proc_units=%s,"
415-
"desired_proc_units=%s,min_procs=%s,desired_procs=%s,max_procs=%s" %
415+
"desired_proc_units=%s,min_procs=%s,desired_procs=%s,max_procs=%s,"
416+
"min_mem=%s,desired_mem=%s,max_mem=%s" %
416417
(sharing_mode, min_proc_units, max_proc_units, desired_proc_units,
417418
overcommit_ratio*int(min_proc_units), overcommit_ratio*int(desired_proc_units),
418-
overcommit_ratio*int(max_proc_units)))
419+
3*int(max_proc_units),min_memory, desired_memory, max_memory))
419420
elif proc_mode == 'ded':
420421
self.set_lpar_cfg("proc_mode=ded,sharing_mode=%s,min_procs=%s,max_procs=%s,desired_procs=%s,"
421422
"min_mem=%s,desired_mem=%s,max_mem=%s" %

testcases/MachineConfig.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,26 @@ def LparSetup(self):
189189
try: self.desired_proc_units = float(conf.args.desired_proc_units)
190190
except AttributeError:
191191
self.desired_proc_units = 2.0
192-
try: self.max_proc_units = float(conf.args.max_proc_units)
192+
try: self.max_proc_units = float(self.cv_HMC.get_available_proc_resources()[0])
193193
except AttributeError:
194194
self.max_proc_units = 2.0
195195
try: self.overcommit_ratio = int(conf.args.overcommit_ratio)
196196
except AttributeError:
197197
self.overcommit_ratio = 1
198+
try: self.min_memory = conf.args.min_memory
199+
except AttributeError:
200+
self.min_memory = "4096"
201+
try: self.desired_memory = conf.args.desired_memory
202+
except AttributeError:
203+
self.desired_memory = "40960"
204+
try: self.max_memory = conf.args.max_memory
205+
except AttributeError:
206+
self.max_memory = int(self.cv_HMC.get_available_mem_resources()[0]) + int(self.desired_memory)
198207
proc_mode = 'shared'
199208
self.cv_HMC.profile_bckup()
200209
self.cv_HMC.change_proc_mode(proc_mode, self.sharing_mode, self.min_proc_units,
201-
self.desired_proc_units, self.max_proc_units, self.overcommit_ratio)
210+
self.desired_proc_units, self.max_proc_units,
211+
self.min_memory, self.desired_memory, self.max_memory,self.overcommit_ratio)
202212
'''
203213
If cpu=dedicated is passed in machine_config lpar proc mode changes to dedicated mode.
204214
Pass sharing_mode, min_proc_units, max_proc_units and desired_proc_units in config file.
@@ -231,7 +241,7 @@ def LparSetup(self):
231241
self.desired_memory = "40960"
232242
try: self.max_memory = conf.args.max_memory
233243
except AttributeError:
234-
self.max_memory = self.cv_HMC.get_available_mem_resources()[0]
244+
self.max_memory = int(self.cv_HMC.get_available_mem_resources()[0]) + int(self.desired_memory)
235245
proc_mode = 'ded'
236246
self.cv_HMC.profile_bckup()
237247
self.cv_HMC.change_proc_mode(proc_mode, self.sharing_mode, self.min_proc_units,

0 commit comments

Comments
 (0)