Solaris Zone and ZFS

https://docs.oracle.com/cd/E23824_01/html/821-1448/gbcik.html#scrolltoc

Update
pkg update -nv --accept

To see the disks
format

Creating a Basic ZFS File System
/dev/dsk/c1t0d0 and /dev/dsk/c2t0d0
zpool create tank mirror c1t0d0 c2t0d0

mkfile 100m /tank/foo
df -h /tank
Filesystem             size   used  avail capacity  Mounted on

tank                   80G   100M    80G     1%    /tank

 To create a file system named fs in the storage pool tank

zfs create tank/fs

mkfile 100m /tank/fs/foo
df -h /tank/fs
Filesystem             size   used  avail capacity  Mounted on

tank/fs                 80G   100M    80G     1%    /tank/fs

How to Identify Storage Requirements for Your ZFS Storage Pool

They can be entire disks that ZFS formats as a single large slice

  • which devices will store your data
  • These devices must be disks of at least 128 MB in size
  • They must not be in use by other parts of the operating system
  • The devices can be individual slices on a preformatted disk
  • They can be entire disks that ZFS formats as a single large slice
Choose data replication.
  • ZFS supports nonredundant (striped) configurations, as well as mirroring and RAID-Z (a variation on RAID-5).
How to Create a ZFS Storage Pool

zpool create tank mirror c1t0d0 c2t0d0

To drop zpool 
zpool destroy tank

To List storage pool 

zpool list

NAME            SIZE    ALLOC   FREE    CAP  HEALTH     ALTROOT

tank             80G    137K     80G     0%  ONLINE     -

zpool status tank

Create the desired hierarchy.
zfs create tank/home

Set the inherited properties

# zfs set mountpoint=/export/zfs tank/home

# zfs set share=name=home,path=/export/zfs,prot=nfs tank/home name=home,path=/export/zfs,prot=nfs

# zfs set sharenfs=on tank/home

# zfs set compression=on tank/home

# zfs get compression tank/home

NAME             PROPERTY       VALUE                      SOURCE

tank/home        compression    on                         local


To create and Set desired hierarchy
zfs create -o mountpoint=/export/zfs -o sharenfs=on -o compression=on tank/home

To Create the individual file systems.
File systems could have been created and then the properties could have been changed at the home level. All properties can be changed dynamically while file systems are in use.

# zfs create tank/home/jeff
# zfs create tank/home/bill

Note: These file systems inherit their property values from their parent, so they are automatically mounted at /export/zfs/user and are NFS shared. You do not need to edit the /etc/vfstab or /etc/dfs/dfstab

Set the file system-specific properties.

zfs set quota=10G tank/home/jeff

View the results.
zfs list

NAME                   USED  AVAIL  REFER  MOUNTPOINT

tank                  92.0K  67.0G   9.5K  /tank

tank/home             24.0K  67.0G     8K  /export/zfs

tank/home/bill           8K  67.0G     8K  /export/zfs/bill

tank/home/jeff           8K  10.0G     8K  /export/zfs/jeff


To set quota 

zfs set quota=10G tank/home/jeff

To check quota
zfs list 
or
df -h

Creating a ZFS Storage Pool With Log Devices

zonecfg -z nombre_zona commit

zonecfg -z nombre_zona delete

zoneadm -z nombre_zona attach

zoneadm -z nombre_zona verify

zoneadm -z nombre_zona install

zoneadm -z nombre_zona clone

note: También puede utilizar zonecfg para cambiar el nombre de una zona que tenga el estado de configurada o instalada.

(Incomplete)
zoneadm -z nombre_zona uninstall 

(Installed)

zoneadm -z nombre_zona Ready (opcional)

zoneadm -z nombre_zona  boot
zoneadm -z nombre_zona Uninstall 
note: desinstala la configuración de la zona especificada del sistema.
zoneadm -z nombre_zona move ruta
zoneadm -z nombre_zona detach
zonecfg -z nombre_zona se puede utilizar para agregar o eliminar una propiedad attrbootargscapped-memorydatasetcapped-cpudedicated-cpudevicefsip-typelimitprivnetrctl o scheduling-class. También puede cambiar el nombre de una zona que tenga el estado de instalada.

(List)
zoneadm -z nombre_zona boot
zoneadm halt y el reinicio del sistema devuelven una zona con el estado de lista al estado de instalada.


zoneadm -z nombre_zona se puede utilizar para agregar o eliminar una propiedad attrbootargscapped-memorydatasetcapped-cpudedicated-cpudevicefsip-typelimitprivnetrctl o scheduling-class.
(Executing)


zlogin opciones zonename
zoneadm -z nombre_zona reboot
zoneadm -z nombre_zona halt devuelve a una zona lista el estado de instalada.
zoneadm halt y el reinicio del sistema devuelven una zona en ejecución al estado de instalada.
zoneadm -z shutdown cierra la zona sin que se produzcan errores.
zoneadm -z nombre_zon  se puede utilizar para agregar o eliminar una propiedad attrbootargscapped-memorydatasetcapped-cpudedicated-cpudevicefsip-typelimitprivanetnetrctl o scheduling-class. El recurso zonepath no se puede cambiar.
To create encryption FS
# zfs create -o encryption=on tank/ora_data
Enter passphrase for 'tank/ora_data': xxxxxxx
Enter again: xxxxxxxx

# zfs get encryption tank/ora_data

To create share zfs
zfs create vnxpool/share
zfs share vnxpool/share
zfs set sharen=on vnxpool/share

to check
zfs get share vnxpool/share

To start up zone
zoneadm -z epson_db boot






global#zoneadm -z epson_db reboot -- -m verbose

epson_db# reboot -- -m verbose