Solaris zone memory on the fly: Difference between revisions
From Lolly's Wiki
Jump to navigationJump to search
m (Text replacement - "<source" to "<syntaxhighlight") |
m (Text replacement - "</source" to "</syntaxhighlight") |
||
Line 23: | Line 23: | ||
zonecfg:myzone> exit | zonecfg:myzone> exit | ||
# | # | ||
</ | </syntaxhighlight> | ||
== Change settings for the running zone == | == Change settings for the running zone == | ||
===First take a look=== | ===First take a look=== | ||
Line 38: | Line 38: | ||
zone.cpu-shares | zone.cpu-shares | ||
privileged 1 - none - | privileged 1 - none - | ||
</ | </syntaxhighlight> | ||
===Set the new values=== | ===Set the new values=== | ||
Line 45: | Line 45: | ||
# prctl -n zone.max-swap -v 16g -t privileged -r -e deny -i zone myzone | # prctl -n zone.max-swap -v 16g -t privileged -r -e deny -i zone myzone | ||
# prctl -n zone.max-locked-memory -v 16g -t privileged -r -e deny -i zone myzone | # prctl -n zone.max-locked-memory -v 16g -t privileged -r -e deny -i zone myzone | ||
</ | </syntaxhighlight> | ||
===Prove values=== | ===Prove values=== | ||
Line 60: | Line 60: | ||
zone.cpu-shares | zone.cpu-shares | ||
privileged 1 - none - | privileged 1 - none - | ||
</ | </syntaxhighlight> | ||
Done. | Done. |
Revision as of 16:50, 25 November 2021
Setting memory parameter for running zones
You can change memory parameter for running zones. But remember to make it persistent by changing zone config file, too. So I do it always in advance.
Change setting in the config file
# zonecfg -z myzone
zonecfg:myzone> select capped-memory
zonecfg:myzone:capped-memory> info
capped-memory:
[swap: 10G]
zonecfg:myzone:capped-memory> set swap=16G
zonecfg:myzone:capped-memory> set physical=16G
zonecfg:myzone:capped-memory> set locked=10G
zonecfg:myzone:capped-memory> info
physical: 16G
[swap: 16G]
[locked: 10G]
zonecfg:myzone:capped-memory> end
zonecfg:myzone> verify
zonecfg:myzone> commit
zonecfg:myzone> exit
#
Change settings for the running zone
First take a look
# zlogin myzone prtconf | grep Memory
prtconf: devinfo facility not available
Memory size: 65536 Megabytes
# prctl -t privileged -i zone myzone
zone: 1: myzone
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
zone.max-swap
privileged 10.0GB - deny -
zone.cpu-shares
privileged 1 - none -
Set the new values
# rcapadm -z myzone -m 16G
# prctl -n zone.max-swap -v 16g -t privileged -r -e deny -i zone myzone
# prctl -n zone.max-locked-memory -v 16g -t privileged -r -e deny -i zone myzone
Prove values
# zlogin myzone prtconf | grep Memory
prtconf: devinfo facility not available
Memory size: 16384 Megabytes
# prctl -t privileged -i zone myzone
zone: 1: myzone
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
zone.max-swap
privileged 16.0GB - deny -
zone.cpu-shares
privileged 1 - none -
Done.