Ben Rockwood speaking at the BayLISA meetup at Joyent, August 16, 2012.
SmartOS basics for sysadmins:
- sparse zones
- managing zones and KVM instances
- the non-persistent environment
- deployment workflow
- downloading images
- zones workflow
- KVM workflow
- ZFS and VMs
- creating an image
- serving images
- designed for virtualization
SmartOS is a Virtualization Platform.
Designed for Virtualization
Lightweight Deployment via USB or PXE
- No “on disk” installation
- No disk wasted for root disks
- No patching
- Fast and Reliable Upgrades (just reboot)
- Enhanced Security. (Rootkit?)
- No ZFS Boot Environments
- No IPS
- No BS
Sparse Zones: The Revenge Super lightweight virtualization
- No patching, no f**king BE’s
- Reliable and Lightning Fast Cloning
- Simple, Simple, Simple
- Brand is “joyent”
KVM with the power of…
- Containerization via Zones
- Rich resource controls
- ZFS
- Crossbow
- DTrace
- Powerful observability (core dumps, mdb, etc.)
- BSM & RBAC
- etc, etc, etc.
Abstraction toolset for unified management of Zones and KVM instances
vmadm: VM Administration tool
- Create, Start, Stop, Modify, etc.
- Both Zones & KVM instances
imgadm: Image Administration tool
- Find, Download & Install Images
- Integrates with “dataset server” for easy distribution
Thinking SmartOS Overcoming Tactical Challenges in a Non-Persistent Environment
tl;dr Essential Skills
Basic configuration is in /usbkey/config
- In SmartOS this is limited to networking, DNS, and NTP
- Root password and SSH config also in /usbkey
/etc is non-persistent, /opt and /var are. At boot, manifests in /opt/custom/smf are loaded
- All customization (even hostname) needs to be preformed at each boot via SMF
- Use Chef.
Master ‘vmadm’ and ‘imgadm’ tools; <3 JSON
USB Deployment Workflow
1. Download USB image and dd to USB key (2GB+)
2. Insert USB Key and Boot
- Ensure Intel VT is enabled
3. Walk through installer
Will prompt for “admin” network information, create Zpool & root password
4. Add in customization to /opt/custom
- Use Chef, Puppet, CFengine, etc, to simplify your life
5. Download Images and Start Provisioning
Downloading Images
Zones Workflow
1. Import Image
- If you want minimal, use “base” It is not possible to create a zone without a template (image)
2. Write the JSON description
3. Create the zone
KVM Workflow
Same process as Zone, but with 2 options:
- Create an empty instance and boot from ISO
- Import remote dataset from server
QEMU Runs inside minimal zone
- Logs are in /zones/UUID/root/tmp/
Creating an Image
Image = ZFS Snapshot + .dsmanifest JSON
- For KVM instances, snapshot /zones/UUID-disk0
- For Zones, snapshot /zones/UUID
- Dump snapshot to file and compress (gz or bz2)
DS Manifest
- Describes disk image (size, name)
- Includes metadata (UUID, Name, URN, Creator, Creation Date, etc.)
Serving Images
Server is simple, “get /” returns array of .dsmanifest JSON objects
Disk images should be in /UUID/diskname.gz Node based Image Server available on github:
- https://github.com/nshalman/smartos-image-server
- Written by nshalman
New Release Every 2 Weeks! smartos.org