Solaris Container is a virtualization technology that come from SUN, from my experience you can only make virtualization for Solaris I don’t know if for another OS. We usually call it with SUN Zone CMIIW. With this container we can manage resource for application and services, another virtualization can do it too, I think…
The bottom line is that my experience with Solaris Container is to deploy some application (Web Application) inside those container in one server, like SUN T5220, so later this server “seems” to have so many OS, each with its own IP address, file, processor, and another resources.
In my case I’m using T5220 which has 64 thread that is equal having 64 CPU, and my application need at least 4 CPU. This would make one T5220 can have around 16 application with their own separated environment (not completely). Because if the server is being shut down, the container is shut down too. But when the server is up we can easily boot, reboot the container. If you want to have the real virtualization, I mean when the server is broken but you don’t want your container broken you have to use SUN Fire E25K server, it will cost you around 1 up to 4 million US dollars 😛
Now we can continue with the configuration. First thing to do is to set the resource management, we can do it by creating a resource pool. Resource pool is is a logical entity that owns a subset of the system resources, like CPU and Memory. Basically in this resource we will define what is the maximum and minimum value of resources that can be used by one zone/domain/container. The subset of that resource pool is processor set, every one resource pool is associated to one processor set. So if you want to give this pool its own unique CPUs, you will need to define the processor set, the number of processors it contains, and associate it with a pool. Here is how to do it:
- Enable the resource pool feaeture
- Save the current configuration
- See if there any existing pool on the system
- Create a processor set containing how many CPU that you want for me min = 2 max = 3
poolcfg -c ‘create pset zone-name-pset (uint pset.min=2; uint pset.max=3)’
- Create a resource pool for the processor set
poolcfg -c ‘create pool zone-name-pool’
- Associate the pool to the processor set, and this pool will be used to the zone-name server
poolcfg -c ‘associate pool zone-name-pool (pset zone-name-pset)’
- Activate the configuration
- Check if your pool already exist
After you create the pool resource you can start to make the zone/container.
- Enter the zone configuration
zonecfg -z zone-name-zone
- If you type the command it will tell you that the zone doesn’t exist, if that so you need to type
- After that you need to specify the directory in the main server where the file of that zone will be exist.
- You need to decide if the zone should be boot automatically at system boot time or not, if you want to make it boot able automatically you can type
- Then you need to specify the network configuration for your zone
- You need to assign the zone to the pool that we already created before
- Verify the configuration, for the syntax
- Then you can commit your configuration
- After that you can install your zone
zoneadm -z zone-name-zone install
- If the installation already finish you can boot the zone
zoneadm -z zone-name-zone boot
- You need to login to the zone to do some pre installation for the solaris setting
zlogin -C zone-name-zone
After you login you can configure your zone like configuring the Solaris OS after fresh installment.
That’s it for the configuration of Solaris Containers, you can read from the source if you have any confusion.