Transcript

Tutorial Agenda and Review

>> Mick:  Hello and welcome to SkillBuilders. This is a second tutorial concerning Oracle Solaris 11 Kernel Zones. Part 1 introduced you to zone configuration and installation and this part 2 tutorial will concentrate on reconfiguring kernel zone resources.

 

[pause]

 

Just to explain, if you have just joined this tutorial without seeing part 1, Solaris is an operating system owned and developed by Oracle and both versions 10 and 11, 11 being the current version, supports lightweight virtual machines called zones, otherwise known as containers. Up until now zones have depended entirely on the kernel of the host system known as the global zone. But since Solaris 11.2, we can have kernel zones which can run entirely using their own kernel just like any other normal operating system.

 

As a reminder of the installation steps we took in the part 1 tutorial, we can see on this page that first of all you have to establish whether the machine supports kernel zones or not. And the way to do that is to run virtinfo and there we can see kernel zones are supported. If that doesn’t come out, then it’s tough luck because you won’t be able to create a kernel zone. And as we explained on the previous tutorial you need fairly hefty hardware in order to support zones, the kernel variety being anything between a T4 Oracle server and a T7. You can also support kernel zones on Intel architecture.

 

[pause]

 

Having established that we can actually use the kernel zone, we can then configure it. And on the left-hand side you can see the configuration steps we took to create the zone and then the zoneadm command to install it.

 

So on this system I have a kernel zone installed. And if I run that zoneadm command, I can list the current zones.

 

My global zone is my host system, kzone1 is my kernel zone and Apache is another lightweight zone non-kernel zone that I’m using to support the Apache web server.

 

Copyright SkillBuilders.com 2017

×
Transcript

How to Determine Current Zone Resources

>> Mick:  So let’s move on and have a look. How do we know what a kernel zone currently is using in terms of resources? There are a variety of ways. First of all, from the global zone we can do zonecfg -z the name of the zone and then export, and that will print on the screen the detailed configuration that is stored in the etc zones for the particular zone. Here we can see the amount of RAM, 4 gigs and the number of CPUs, 4. Very shortly we’re going to have a look at how that can be changed.

 

[pause]

 

We can also log into the zone.

 

[pause]

 

I’m just using the z login command. And as I’m running as root on my global zone, I get in without a password.

 

My zone is called woody, as you can see and I can use the normal commands such as psrinfo and I can see I’ve got four virtual CPUs assigned and I can do things like prtconf|gref Mem and I can see that I’ve got four gigabytes of RAM installed as well.

 

By the way, I’m also going to show you how to do networks in the zone where I can do dladm show-link and I can see that we currently have one network interface running. So very shortly I’m going to add another network interface to the zone and I’m going to make some changes to the memory and the CPUs as well.

 

[pause]

 

When zones are running, you can use the zone stat command to display information about zone resources, and you would do this within the global zone. And the example there on the left-hand side is running zone stat at an interval of every five seconds. I can show you quickly, if I exit from the zone, clear the screen and then run the zonestat 5. I’ll get some zone information coming out every five seconds.

 

There are other options to zonestat. For example, I can do zonestat -z and specify specific zone. Then that gives me a bit of a clue as to the resources that are currently being consumed.

Copyright SkillBuilders.com 2017

×
Transcript

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.

 

[pause]

 

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.

 

[pause]

 

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.

 

[pause]

 

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.

 

[pause]

 

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.

 

[pause]

 

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.

 

[pause]

 

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 –

 

[pause]

 

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.

 

[pause]

 

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.

 

[pause]

 

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 SkillBuilders.com 2017

×
Transcript

Memory Management Tips

How to Reconfigure Solaris 11 Kernel Zones Resources Lesson 4 of 4

 

>> Mick:  One last thing. Just to remind you that I went through on the previous tutorial, you may need to put a little kernel tweak in to set a limitation on the ZFS ARC cache. And there’s some information here just as an example.

 

You would create a file, a text file in etc system.d. Any text filename will do containing that parameter. Set user_reserve_hint_pct= and the percentage of RAM that you want to make sure is available for your applications. Otherwise, ZFS tends to use a lot of free memory and may not release it quickly enough and cause a few headaches with memory management.

 

There’s a very elaborate and detailed document available from Oracle. Log in to My Oracle Support and look for that Doc ID 1663862.1 and that will explain everything in fine detail.

 

[pause]

 

Thank you very much for looking at this tutorial. I hope you’ve learned a little bit from it and join us for another tutorial a bit more down the line where we’ll be looking at kernel zone shared storage. And this has been brought to you by SkillBuilders who are experts with Oracle Databases. Thank you very much indeed.

Copyright SkillBuilders.com 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!

 

×