How to add swap space to Solaris Zone without reboot

How to add swap space to Solaris zone without reboot

root@sin:/# zoneadm list -civ
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                               native   shared
   1 lab01             running    /zones/lab01                    native   shared
root@sin:/#

If you see the following error


root@sin:/# zlogin lab01
Last login: Tue Feb 18 09:44:33 on pts/20
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
Sourcing //.profile-EIS.....
-bash: fork: Not enough space


You can can add swap space without reboot the zone lab01, always verify that you have the enough space to add it



root@sin:/# prctl -n zone.max-swap -r -v 30gb -i zone lab01
root@sin:/# zlogin lab01
[Connected to zone 'lab01' pts/7]
Last login: Mon Feb 24 08:08:50 on pts/7
Oracle Corporation      SunOS 5.10      Generic Patch   January 2005
Sourcing //.profile-EIS.....
DISPLAY=zone:global:0.0
lab01:#exit


Now you can edit the file /etc/zones/lab01.xml and edit the following line in the global zone


root@sin:/#  vi /etc/zones/lab01.xml
  <rctl name="zone.max-swap">
    <rctl-value priv="privileged" limit="21474836480" action="deny"/>

The correct value should be now

  <rctl name="zone.max-swap">
    <rctl-value priv="privileged" limit="32212254720" action="deny"/>

After that the zone will be booting with the new swap, however you can edit the zone with the zonecfg command



Regards
Roger

Comments