OmniOS now includes LX support (from Joyent/SmartOS)

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
SmartOS and now OmniOS are on the way to become a serious virtualisation platform alternative to ESXi or Proxmox. Especially with OmniOS as this is a full featured storage platform for an enterprise class NAS or SAN as well.

As SmartOS offers lightweight virtualisation for Solaris zones, Linux zones and a full virtualisation with KVM example this Windows VM I would suggest not to mix them in one thread as they behave quite different

btw
I have extended the add-on menu (napp-it 16.07f+) to start/stop/add/remove LX branded zones.
read also the following about container (Docker/lx branded zones) and full virtualisation via KVM

from 2007
Cuddletech | Zones start looking like Containers: CPU and Memory Caps

from 2016
Cuddletech | Containers, Now and Then

Docker on SmartOS optionally OmniOS, next step?
Joyent | Triton: Docker and the “best of all worlds”


Joyent | Dockerizing my first app
Docker on SmartOS, the harder way
 
Last edited:

Bronko

Member
May 13, 2016
111
10
18
105
I will add more infos in
http://www.napp-it.org/doc/downloads/zones.pdf

This includes a sample with CentOS
...
3.1 Distribution and management of preconfigured zones

I would suggest to install a preconfigured zone as a clone of a base zone, ready for distribution, like these:

/etc/zones/base_centos-6.8.cfg:
(without net declaration)
Code:
create -b
set zonepath=/box9/zones/centos-6.8
set brand=lx
set autoboot=false
set ip-type=exclusive
add attr
set name=kernel-version
set type=string
set value=2.6.32
end
commit
exit
~$ zonecfg -z base_centos-6.8 -f /etc/zones/base_centos-6.8.cfg
~$ cd /etc/zones
~$ curl -o centos6.zss.gz https://images.joyent.com/images/5b7e86e4-2797-11e6-b7d7-cbe6a1a48791/file
~$ zoneadm -z base_centos-6.8 install -s /etc/zones/centos6.zss.gz

Never boot the base zone! These steps should be a part of napp-it installation scripts.

The final steps to boot into a cloned zone as a part of napp-it web-gui scripts:

~$ dladm create-vnic lx0 -l e1000g0

/etc/zones/centos-6.8.cfg:
Code:
create -b
set zonepath=/box9/zones/centos-6.8
set brand=lx
set autoboot=false
set ip-type=exclusive
add net
set physical=lx0
end
add attr
set name=kernel-version
set type=string
set value=2.6.32
end
commit
exit
~$ zonecfg -z centos-6.8 -f /etc/zones/centos-6.8.cfg
~$ zoneadm -z centos-6.8 clone base_centos-6.8
~$ zoneadm -z centos-6.8 boot
~$ zlogin -C centos-6.8

Since the clone command is based on the ZFS Snapshot feature it is very fast.
 
Last edited:

manxam

Active Member
Jul 25, 2015
234
50
28
SmartOS and now OmniOS are on the way to become a serious virtualisation platform alternative to ESXi or Proxmox. Especially with OmniOS as this is a full featured storage platform for an enterprise class NAS or SAN as well.

As SmartOS offers lightweight virtualisation for Solaris zones, Linux zones and a full virtualisation with KVM example this Windows VM I would suggest not to mix them in one thread as they behave quite different

btw
I have extended the add-on menu (napp-it 16.07f+) to start/stop/add/remove LX branded zones.
read also the following about container (Docker/lx branded zones) and full virtualisation via KVM

from 2007
Cuddletech | Zones start looking like Containers: CPU and Memory Caps

from 2016
Cuddletech | Containers, Now and Then

Docker on SmartOS optionally OmniOS, next step?
Joyent | Triton: Docker and the “best of all worlds”


Joyent | Dockerizing my first app
Docker on SmartOS, the harder way
Hi Gea, I have updated to bloody, installed the brand/lx package, and updated to Napp-it 16.10dev but in the "Add on" menu I only have "Zones help". Is there a reason that I do not see the above "start/stop/add/remove" LX zones in this menu?

Thanks,
M
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
The current idea

The add-on menu requires that you install or restore zones below a /"datapool"/zones filesystem. The add-on menu displays then all folders below zones (beside a filesystem named "shared") and offers the option to create/edit a zone.cfg within this folder, to initialise the zone (add to initialised) and to start/stop/uninitialise then.

If you have installed a zone to a different filesystem, move (rename/send) to "/datapool"/zones
 

Bronko

Member
May 13, 2016
111
10
18
105
@gea
Did you kept the zone description and index files in system default path? (Solaris 11: /etc/zones)? I have no bloody setup currently, sorry.
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
No, my current idea is to place the zone description (zone.cfg) into the zone folder ex /datapool/zones/centos-6.8/zone.cfg as my plan is to keep everything in the zone folder to allow a deploy or restore a preconfigured zone with a service with a simple restore of that filesystem.
 

Bronko

Member
May 13, 2016
111
10
18
105
Ok, sorry; what I meant was the system zone_name.xml files and index file at /etc/zones.
To hold the build/description *.cfg files in the datapool itself is nice to rebuild a zone somewhere.

Did you got the clone setup? I come from Solaris 11 with tons of sparse-root zones in there and it was the most comfortable way to create new zones, within 3 seconds. Even OmniOS/Joyent/SmartOS just know whole-root zones, currently.
 
Last edited:

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
At the moment I care only about OmniOS and the new LX/ Linux branded zones feature from SmartOS. The XML config files and the management tools from SmartOS are not (yet) available on OmniOS.

So the zone.cfg is the only file based configuration file for the zonecfg/zoneadm tools for OmniOS. This and the way I support it within napp-it may change in future as this is the very first beta for this feature from OmniOS.
 
Last edited:

Bronko

Member
May 13, 2016
111
10
18
105
@gea
Totally agree, zonecfg/zoneadm is everything you need, under Solaris or OmniOS.
Let's give an example.

If you configure a zone with the name test by:

~$ zonecfg -z test -f /root/test_example.cfg

/root/test_example.cfg:
Code:
create -b
set zonepath=/datapool/zones
...
commit
exit
its results in the system zone configuration file /etc/zones/test.xml and extend the /etc/zones/index by
Code:
global:installed:/
test:configured:/datapool/zones/test:f02106bb-2cb7-e9db-9ec4-8938471bbba7
Finally

~$ zoneadm -z test install

create the new zfs filesystem /datapool/zones/test and changed /etc/zones/index to
Code:
global:installed:/
test:installed:/datapool/zones/test:f02106bb-2cb7-e9db-9ec4-8938471bbba7
This is the standard behaviour for Solarish.
 
Last edited:

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
I am not yet decided of the final concept how to include (LX) zones support for OmniOS within napp-it. At the moment I start at a point where a basic setup like you have shown is already done.

This means, if you have configured a zone with a service, what is the easiest way to backup/restore/deploy this special zone to the same or another OmniOS setup. My current idea is to simply restore the filesystem ex ../zones/test with the zone configuration file in this folder and to reconfigure it from that file.
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
It confused me, sorry for the well known facts... ;-)
My own setup is 100% ESXi so there are less well known facts about zones.
Any comments or improvements to my concept are welcome.
 

manxam

Active Member
Jul 25, 2015
234
50
28
Hi Gea, excellent work thus far. I've managed to create, and start, a zone from the UI.
I notice that all of the items "missing" are in the perl script but commented out. Are these disabled as they're "work in progress"? Specifically looking at the "shared" folders. The code looks complete but I don't want to mess something up by un-commenting :)
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
My first contact with zones and lx container was a few days ago so this is all about learning and work in progress. As I am abroad from next week for two weeks I put it online in the current state.

You can uncomment the ask commands in the script and put the values into the zone.cfg template or use the edit option for already created containers. Any insights about correct settings are helpful to allow a fast implementation of Linux containers and integration of add-ons like a Linux VM with Plex or other services.

Anyone knows about kvm branded zones in OmniOS.
A BSD based firewall or a Windows 2016 zone would be nice as well.

edit:
kvm zones from Joyent are not yet in OmniOS

btw
its a good idea to follow omnios-discuss as well
best is to join the maillist, but you can read at The OmniOS-discuss Archives

ex, current entry from M.

Hi,
Regarding ip, gateway … this worked for me (source GitHub - danmcd/io-lx-public: LX port into OmniOS (illumos portion)):
root@server:/root# zonecfg -z lxzone export
lxzone: No such zone configured
root@server:/root# zonecfg -z lxzone
lxzone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:lxzone> create -b
zonecfg:lxzone> set zonepath=/tank/zones/lxzone
zonecfg:lxzone> set brand=lx
zonecfg:lxzone> set autoboot=false
zonecfg:lxzone> set ip-type=exclusive
zonecfg:lxzone> add net
zonecfg:lxzone:net> set physical=lxzone0
zonecfg:lxzone:net> add property (name=gateway,value="192.168.5.1")
zonecfg:lxzone:net> add property (name=ips,value="192.168.5.69/24")
zonecfg:lxzone:net> add property (name=primary,value="true")
zonecfg:lxzone:net> end
zonecfg:lxzone> add attr
zonecfg:lxzone:attr> set name=dns-domain
zonecfg:lxzone:attr> set type=string
zonecfg:lxzone:attr> set value=lxzone
zonecfg:lxzone:attr> end
zonecfg:lxzone> add attr
zonecfg:lxzone:attr> set name=resolvers
zonecfg:lxzone:attr> set type=string
zonecfg:lxzone:attr> set value=192.168.5.1
zonecfg:lxzone:attr> end
zonecfg:lxzone> add attr
zonecfg:lxzone:attr> set name=kernel-version
zonecfg:lxzone:attr> set type=string
zonecfg:lxzone:attr> set value=2.6.32
zonecfg:lxzone:attr> end
zonecfg:lxzone> verify
zonecfg:lxzone> commit
zonecfg:lxzone> exit
 
Last edited:

Bronko

Member
May 13, 2016
111
10
18
105
It should be possible for the zones path to be a folder or zfs filesystem of the syspool too, not only of the datapools, ex. for bare metal installations...
 

Bronko

Member
May 13, 2016
111
10
18
105
sorry, my notice was only related to the napp-it script:
Code:
/var/web-gui/data/napp-it/zfsos/21_Add-On/01_zones_setup/action.pl
It only runs with /'datastore'/zones and failed with ex. /rpool/zones
 

gea

Well-Known Member
Dec 31, 2010
3,141
1,182
113
DE
ah ok
using rpool for general use is not common so I used "datapools" for the script.
 

Bronko

Member
May 13, 2016
111
10
18
105
Yes, this was what I saw in the script.

For sure, we have different point of views and my personal conception is to separate the services (Storage OS as a bare metal installation on rpool beside additional zones with different "services" on rpool too, build on fast and reliable mirrored SSDs) from the datasets in tank-pools: The services goes with the machine, the data with the tank's. I think its worth for napp-i to have the option.