Solaris Containers and ZFS Cheat Sheet
Solaris Containers and ZFS Cheat Sheet
Solaris Containers and ZFS Cheat Sheet
This a quick cheat sheet of the commands that can be used when using zones (containers), for a more
complete guide see solaris zones.
Zone States
Cheat sheet
zonecfg -z <zone>
Creating a zone
see creating a zone for a more details
deleting a zone from the global
zonecfg -z <zone> delete -F
ssytem
Display zones current
zonecfg -z <zone> info
configuration
Create a zone creation file zonecfg -z <zone> export
# pkgadd -G -d . <package>
add/remove a package (global
zone) If the -G option is missing the package will be
added to all zones
# pkgadd -Z -d . <package>
add/remove a package (non-
global zone) If the -Z option is missing the package will be
added to all zones
Query packages in all non-
# pkginfo -Z
global zones
query packages in a specified
# pkginfo -z <zone>
zone
Destroy pool:
zpool destroy [pool_name]
zpool destroy datapool
Set pool mountpoint:
zfs set mountpoint=/path [pool_name]
zfs set mountpoint=/export/zfs datapool
Export a pool:
zpool export [pool_name]
zpool export datapool
Import a pool:
zpool import [pool_name]
zpool import datapool
Create a filesystem:
zfs create [pool_name]/[fs_name]
zfs create datapool/filesystem
Destroy a filesystem:
zfs destroy [pool_name]/[fs_name]
zfs destroy datapool/filesystem
Rename a filesystem:
zfs rename [pool_name]/[fs_name] [pool_name]/[fs_name]
zfs rename datapool/filesystem datapool/newfilesystem
Move a filesystem:
zfs rename [pool_name]/[fs_name] [pool_name]/[fs_name]/[fs_name]
zfs rename datapool/filesystem datapool/users/filesystem
Make a snapshot:
zfs snapshot [pool_name]/[fs_name]@[time]
zfs snapshot datapool/filesystem@friday
Clone a filesystem:
zfs snapshot [pool_name]/[fs_name]@[time]
zfs clone [pool_name]/[fs_name]@[time] [pool_name]/[fs_name]
zfs snapshot datapool/filesystem@today
zfs clone datapool/filesystem@today datapool/filesystemclone
Backup filesystem to a file:
zfs send [pool_name]/[fs_name] > /path/to/file
zfs send datapool/filesystem@friday > /tmp/filesystem.bkp
These systems have a system controller accessable over the network. They are given a name distinct from the system(s) they
control because they can control multiple different systems. To gain access to the system controller, telnet to the relevant name
and choose the 'Platform Shell' option. You will then need to provide a password. The other options in this list are for access to
the relevant system consoles.
At the command line, the following should be enough for basic operation :-
Command Action
The XSCF is provided on separate hardware from the main M5000 processing capacity. The network interfaces are distinct from
those used by the server and are configured to connect via ssh. To gain access to the console ssh in to the XSCF controller and
subsequently connect to domain 0 on the system. The M5000 servers are all configured with one domain at present. The
controllers are registered in the format 'jamaican-xscf.iso.port.ac.uk'.
Command Action
poweron -d 0 Power on domain 0
poweroff -d 0 Power off domain 0
sendbreak -d 0 Send a break signal to domain 0
console -d 0 Connect to the console of domain 0
showdomainstatus -a show status of all domains
The iLom can be used both via ssh or a web browser interface. To connect to the to the iLom of a server use the name format
'bread-lom.iso.port.ac.uk'. Although the servers are capable of making use of an aLom interface, Sun are reportedly
standerdizing all controllers to the iLom model and as such it would be best to familiarize with the new commands.
Command Action
start /SP/console Connect to the console of the server
set /HOST send_break_action=break send a break signal to the host