How to Reconfigure Solaris 11 Kernel Zone Resources

Learn how to configure Solaris 11 kernel zone (container) resources.  Oracle Certified Professional Solaris 11 Administrator Mick Hosegood demonstrates the commands and best practices in this free tutorial.

This free Solaris 11 training is segmented into several separate lessons:

  1. Tutorial Agenda and Review (2:34)
    In Lesson 1, Mick sets the tutorial agenda and provides a brief review of Part 1 “Configure and Install Solaris 11 Kernel Zones”.
  2. How to Determine Current Zone Resources (2:32)
    In lesson 2, Mick demonstrates how to determine what the current zone resources are. You’ll learn prsinfo, prtconf, dladm, zonestat, zonecfg and more.
  3. How to Update Solaris 11 Kernel Zone Resources (7:51) (click on video below)
    In this lesson, Mick demonstrates changing memory, network resources and more. You’ll see zonecfg, select capped memory, set physical, verify, add anet, dladm show-link.
  4. Memory Management Tips (1:34)
    In this lesson Oracle Certified Solaris 11 Administrator Mick Hosegood provides a memory management tip related to zone configuration.


Date: May 24, 2016

NOTE: Some corporate firewalls will not allow videos hosted by YouTube.


How to Update Solaris 11 Kernel Zone Resources

>> Mick:  Now as you can see, the zone resources are specified in the zone configuration which is stored as an XML file under etc. zones and that information is called persistent storage or stable storage for the zone. Now we can change that by using the zonecfg command but we may have to reboot the zone in order for that to take effect.




There are some resources that can be set dynamically so you can apply them to running zones. For example, CPU and RAM can be changed in a normal lightweight non-global zone, but unfortunately not in the kernel zone. But we can do things like adding a network device.


Now, we can change the resources but we need to do it persistently and then we need to reboot the zone. So let’s go through an example.




Go into zone config, zonecfg and I’ll get a prompt. Bear in mind, I’m doing this on the persistent storage and it won’t affect the running zone.




Select capped memory and then I can type info to see what the current setting is, 4 gigs and I’m going to change it to 6 gigs. Do an info again, end to close that little section, verify everything’s good.


I could also change CPUs in the similar fashion. Having verified, I’m going to commit and then exit. So if I do zonecfg -z kzone1 export, the information is changed. There you can see physical is now 6 gigs but the zone hasn’t used any of that and I would need to do a reboot to bring that into effect. So why don’t we do that?


If I zlogin, I’ll log in to the console using the -C option and then we can watch the reboot occurring.




Just to show you in case you’re wondering, the memory is still 4 gigs. So if I reboot –


Being a kernel zone, it will probably take a little bit longer to reboot than a normal non-global zone that doesn’t have its own kernel.




Any second now we should be able to log in once again. They send me a message. It is because I don’t have DNS running and I don’t have a fully qualified host name which [3:02 inaudible] doesn’t like.


So let’s log in again and let’s do the prtconf command again. Now I’ve got 6 gigs. So the zone configuration required that I reboot the machine to do that. That’s not always the case. If we move on, let me show you how I can actually add to a running zone.


So woody is running. I’m going to exit from the console back to buzz which is my host global zone and I’m going to do zonecfg kzone1 -r which will allow me to operate on a running zone and I’m going to add another network interface which is known as an anet, the current zone that’s called a virtual network interface or VNIC.


A VNIC with an ID of 0 which I showed you earlier, now I can do set id=1, not strictly necessary but this will come up as net1. The existing one being net0.




Now if I do commit that has actually changed the running zone, it hasn’t changed the persistent storage. Now if I export, there you can see the currently running configuration. And if I exit and go back into my kzone1 again –




Do a dladm show link and there we have it, we have a new net1. Now I would have to make a change to the persistence storage. Let’s come out of there and I would have the zone config without the -r. Now I’ve only got one anet id 0 and I can add anet set id=1 and verify, commit to storage, and then exit. Then if I do zonecfg -z kzone1 export, I’ve now got another network address in permanent storage so my changes will now persist when I reboot the zone.




Unfortunately, I can’t change things like RAM and I can’t change CPUs with the kernel zone. I have to reboot. But I can do things like add a network interface and I can add other hardware as well if I need to.




Now, what I could’ve done instead of what I did in that I didn’t need to change the running zone, I could’ve changed the persistent storage as an example that I just did. And then rather than applying to the running zone, I can do a zoneadm -z Apache apply which would then have applied the persistent storage to the running zone.


If I changed aspects like the anet or added an anet, those things would be applied. But if I did things like memory and CPU, nothing would happen. As you can see from the example here, zoneadm -z kzone1 apply, it says nothing to apply because it can’t do it.


There are quite a few other options. By the way, ordinary zones, non-kernel zones can have RAM and CPUs dynamically changed and there’s a very good documentation for Oracle Solaris and Kernel Zones and there’s a reference there at the bottom of the page which you can easily Google which will show you the different options possible.


Bear in mind, just another reminder that changing things like CPUs and zones may contradict Oracle database licensing and you’d be well-advised to download this article that I’m showing you here, this PDF which is called Hard Partitioning with Oracle Solaris Zones, which will give you some examples to show what Oracle will accept as ways of setting CPUs for Oracle licensing purposes.

Copyright 2017

Free Online Registration Required

The tutorial session you want to view requires your registering with us.

It’s fast and easy, and totally FREE.

And best of all, once you are registered, you’ll also have access to all the other 100’s of FREE Video Tutorials we offer!