SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
ZFS and FreeBSD Jails
          apeiron (old Greek word for ∞)
          apeiron@cpan.org
          fosscon 2012




Saturday, August 11, 12
A stroll dive down the rabbit hole
          This won't hurt a bit
          (that may or may not be a facsimile of me when working)


Saturday, August 11, 12

http://www.flickr.com/photos/stars6/4381851322/in/photostream/
Some FreeBSD mythbusting

                Fully functional Unix
                Server, desktop, router, firewall, etc.
                >23000 third-party applications in the ports tree
                Probably not the best desktop; well-suited to a server
                Has most of the cool features from Solaris; will be
                talking about one and a half of them today



Saturday, August 11, 12
One and a half?

                This talk discusses ZFS and FreeBSD jails
                ZFS, of course, comes from Solaris
                This talk also covers FreeBSD jails
                When creating zones, the Solaris devs used jails as an
                inspiration




Saturday, August 11, 12
ZFS
          The Zettabyte File System

Saturday, August 11, 12

http://www.flickr.com/photos/ess-jay/2438565511/
What the heck is a Zettabyte, anyway?

                2^70 bytes
                ZFS is meant to scale far beyond the current and
                projected possible future limitations of hardware
                The theoretical maximum filesystem size is 256
                quadrillion zettabytes
                That's 256,000,000,000,000,000 zettabytes
                That's 256,000,000,000,000,000 * 2^70 bytes



Saturday, August 11, 12
Feature summary
                Resource forks            Built-in software RAID
                POSIX attributes and      Snapshots
                ACLs
                                          COW data model (cheap
                Compression               snapshots (very
                                          important for us))
                Encryption
                                          Caching
                Deduplication
                                          Too much for one slide
                Built-in volume manager


Saturday, August 11, 12
Things we'll talk about today


                Volume manager
                Snapshots
                COW data model




Saturday, August 11, 12
Volume manager

                The ZFS volume manager provides native striping
                Makes it easy to add heterogenous disks to a pool
                No more worrying about getting geometries exactly the
                same
                Creates a nice abstraction from the physical layer




Saturday, August 11, 12
Snapshots

                They're exactly what they say on the tin
                Take a snapshot of the filesystem and it's there when
                you want it
                You can do all kinds of cool things with them, like send
                them over the network and clone them




Saturday, August 11, 12
COW Data Model
                The COW model is really where ZFS shines for
                containers
                COW (copy on write): if two copies of a snapshot have
                the same data, only one copy exists on disk until a
                clone writes to a file; then, a copy is made for the delta
                This makes snapshots, clones, and thus jails quick and
                cheap to create
                Absolutely critical to the container use case


Saturday, August 11, 12
Let's be Jailbirds
          You may pay me $50 to get out

Saturday, August 11, 12
Some FreeBSD background

                FreeBSD boots via /sbin/init like any other Unix
                /sbin/init runs /etc/rc, which sources /etc/rc.conf
                /etc/rc.conf controls which services start at boot, and
                also configures things like IP addresses, default route,
                and jails




Saturday, August 11, 12
Jails: Not just chroot(2)
                Everything lives under a directory mounted on the FS
                You can access the jail via chroot, but you don't get all
                the wins with this technique
                Every jail has at least one IPv4/IPv6 address
                Lightweight
                Lots of management tools
                Advanced technique: run Linux in a jail


Saturday, August 11, 12
Some jail tools
                jexec       jailrc
                jls         jailuser
                jailadmin   jailutils
                jailctl     jkill
                jailer      jps
                jailme      ... and so on




Saturday, August 11, 12
How jails work

                Install enough of FreeBSD to boot (/sbin/init calls /etc/
                rc, which boots the system)
                Generally do this by building + installing source tree
                Then configure the jail and start it
                We'll be using the more flexible jailrc from the ports
                tree, rather than the default script



Saturday, August 11, 12
Still not as cool as Zones
          But pretty close

Saturday, August 11, 12

http://www.flickr.com/photos/paldorslate/1761863421/
What does this get us?
          It turns out that it gets us lots of cool stuff

Saturday, August 11, 12

http://www.flickr.com/photos/daikrieg/1294053038/
Basic workflow summary
                Create a zpool         Snapshot
                Create a filesystem     Clone desired
                                       environment or base as
                Install base jail to
                                       desired
                filesystem
                                       ???
                Snapshot
                                       Profit!
                Create desired
                environment



Saturday, August 11, 12
Some workflows this supports


                Per-developer dev environments
                Dev/staging/QA/etc./prod
                Dev/prod
                Prod




Saturday, August 11, 12
Show Example jailrc Config




Saturday, August 11, 12
Per-developer container

                Create base jail
                Create snapshot
                Clone as necessary per developer
                hack hack hack...
                Push changes up to git repo / etc.




Saturday, August 11, 12
Dev/staging/QA/etc./prod

                Create base jail
                Snapshot
                Clone for dev
                zfs send | zfs recv for staging/qa/etc./prod
                If something passes a stage, promote it to the next-
                closest to prod



Saturday, August 11, 12
Dev/prod

                Like dev/etc./prod but more cowboyish
                With ZFS it's still better than other filesystems
                Snapshots mean it's easy to fix mistakes when they
                make it into prod (no workflow prevents mistakes
                getting to prod)
                Just clone from a working snapshot and go



Saturday, August 11, 12
Prod

                Even more cowbowish than dev/prod
                This is the sort of thing where developers work directly
                on production
                Unwise, but ZFS makes it less suck
                Snapshots save the day




Saturday, August 11, 12
Live (prepared) demo!




Saturday, August 11, 12
Bibliography


                FreeBSD Handbook
                ZFS Administration Guide
                jailrc manpage




Saturday, August 11, 12
Questions?




Saturday, August 11, 12

Más contenido relacionado

La actualidad más candente

ZFS Workshop
ZFS WorkshopZFS Workshop
ZFS WorkshopAPNIC
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?Jérôme Petazzoni
 
USENIX LISA11 Tutorial: ZFS a
USENIX LISA11 Tutorial: ZFS a USENIX LISA11 Tutorial: ZFS a
USENIX LISA11 Tutorial: ZFS a Richard Elling
 
ZFS Tutorial USENIX LISA09 Conference
ZFS Tutorial USENIX LISA09 ConferenceZFS Tutorial USENIX LISA09 Conference
ZFS Tutorial USENIX LISA09 ConferenceRichard Elling
 
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...NETWAYS
 
ZFS Tutorial LISA 2011
ZFS Tutorial LISA 2011ZFS Tutorial LISA 2011
ZFS Tutorial LISA 2011Richard Elling
 
Scale11x lxc talk
Scale11x lxc talkScale11x lxc talk
Scale11x lxc talkdotCloud
 
SmartOS ZFS Architecture
SmartOS ZFS ArchitectureSmartOS ZFS Architecture
SmartOS ZFS ArchitectureBill Pijewski
 
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensOpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensMatthew Ahrens
 
ZFS by PWR 2013
ZFS by PWR 2013ZFS by PWR 2013
ZFS by PWR 2013pwrsoft
 
ZFS: The Last Word in Filesystems
ZFS: The Last Word in FilesystemsZFS: The Last Word in Filesystems
ZFS: The Last Word in FilesystemsJarod Wang
 
Zfs Nuts And Bolts
Zfs Nuts And BoltsZfs Nuts And Bolts
Zfs Nuts And BoltsEric Sproul
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Partner S.A.
 
Zettabyte File Storage System
Zettabyte File Storage SystemZettabyte File Storage System
Zettabyte File Storage SystemAmdocs
 
Nexenta at VMworld Hands-on Lab
Nexenta at VMworld Hands-on LabNexenta at VMworld Hands-on Lab
Nexenta at VMworld Hands-on LabNexenta Systems
 

La actualidad más candente (20)

ZFS Workshop
ZFS WorkshopZFS Workshop
ZFS Workshop
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?
 
USENIX LISA11 Tutorial: ZFS a
USENIX LISA11 Tutorial: ZFS a USENIX LISA11 Tutorial: ZFS a
USENIX LISA11 Tutorial: ZFS a
 
ZFS Tutorial USENIX LISA09 Conference
ZFS Tutorial USENIX LISA09 ConferenceZFS Tutorial USENIX LISA09 Conference
ZFS Tutorial USENIX LISA09 Conference
 
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
OSDC 2016 - Interesting things you can do with ZFS by Allan Jude&Benedict Reu...
 
ZFS Tutorial LISA 2011
ZFS Tutorial LISA 2011ZFS Tutorial LISA 2011
ZFS Tutorial LISA 2011
 
Scale11x lxc talk
Scale11x lxc talkScale11x lxc talk
Scale11x lxc talk
 
SmartOS ZFS Architecture
SmartOS ZFS ArchitectureSmartOS ZFS Architecture
SmartOS ZFS Architecture
 
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt AhrensOpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
OpenZFS novel algorithms: snapshots, space allocation, RAID-Z - Matt Ahrens
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Scale2014
Scale2014Scale2014
Scale2014
 
ZFS by PWR 2013
ZFS by PWR 2013ZFS by PWR 2013
ZFS by PWR 2013
 
ZFS: The Last Word in Filesystems
ZFS: The Last Word in FilesystemsZFS: The Last Word in Filesystems
ZFS: The Last Word in Filesystems
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Zfs Nuts And Bolts
Zfs Nuts And BoltsZfs Nuts And Bolts
Zfs Nuts And Bolts
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
OpenQRM4.9 update
OpenQRM4.9 updateOpenQRM4.9 update
OpenQRM4.9 update
 
Zettabyte File Storage System
Zettabyte File Storage SystemZettabyte File Storage System
Zettabyte File Storage System
 
Nexenta at VMworld Hands-on Lab
Nexenta at VMworld Hands-on LabNexenta at VMworld Hands-on Lab
Nexenta at VMworld Hands-on Lab
 

Similar a ZFS and FreeBSD Jails

Rcos presentation
Rcos presentationRcos presentation
Rcos presentationmskmoorthy
 
Big app design for Node.js
Big app design for Node.jsBig app design for Node.js
Big app design for Node.jsSergi Mansilla
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudAtlassian
 
Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Mark Jaquith
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2markleeuw
 
OSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdfOSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdfnitinscribd
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Matt Aimonetti
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...JAX London
 
Fast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserAndreas Bovens
 
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias ZarickTrivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias ZarickTrivadis
 

Similar a ZFS and FreeBSD Jails (20)

Rcos presentation
Rcos presentationRcos presentation
Rcos presentation
 
Zfs intro v2
Zfs intro v2Zfs intro v2
Zfs intro v2
 
Big app design for Node.js
Big app design for Node.jsBig app design for Node.js
Big app design for Node.js
 
Inside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private CloudInside the Atlassian OnDemand Private Cloud
Inside the Atlassian OnDemand Private Cloud
 
Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!Coding, Scaling, and Deploys... Oh My!
Coding, Scaling, and Deploys... Oh My!
 
Introduction to OpenSolaris 2008.11
Introduction to OpenSolaris 2008.11Introduction to OpenSolaris 2008.11
Introduction to OpenSolaris 2008.11
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2
 
OSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdfOSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdf
 
Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010Macruby - RubyConf Presentation 2010
Macruby - RubyConf Presentation 2010
 
Self2013
Self2013Self2013
Self2013
 
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
 
Fast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browser
 
Nycbsdcon14
Nycbsdcon14Nycbsdcon14
Nycbsdcon14
 
Tlf2014
Tlf2014Tlf2014
Tlf2014
 
Fsoss2011
Fsoss2011Fsoss2011
Fsoss2011
 
Asiabsdcon14
Asiabsdcon14Asiabsdcon14
Asiabsdcon14
 
CloudInit Introduction
CloudInit IntroductionCloudInit Introduction
CloudInit Introduction
 
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias ZarickTrivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
Trivadis TechEvent 2017 ACFS Replication as of 12 2 by Mathias Zarick
 
Gluster 3.3 deep dive
Gluster 3.3 deep diveGluster 3.3 deep dive
Gluster 3.3 deep dive
 
Posscon2013
Posscon2013Posscon2013
Posscon2013
 

Último

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 

Último (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 

ZFS and FreeBSD Jails

  • 1. ZFS and FreeBSD Jails apeiron (old Greek word for ∞) apeiron@cpan.org fosscon 2012 Saturday, August 11, 12
  • 2. A stroll dive down the rabbit hole This won't hurt a bit (that may or may not be a facsimile of me when working) Saturday, August 11, 12 http://www.flickr.com/photos/stars6/4381851322/in/photostream/
  • 3. Some FreeBSD mythbusting Fully functional Unix Server, desktop, router, firewall, etc. >23000 third-party applications in the ports tree Probably not the best desktop; well-suited to a server Has most of the cool features from Solaris; will be talking about one and a half of them today Saturday, August 11, 12
  • 4. One and a half? This talk discusses ZFS and FreeBSD jails ZFS, of course, comes from Solaris This talk also covers FreeBSD jails When creating zones, the Solaris devs used jails as an inspiration Saturday, August 11, 12
  • 5. ZFS The Zettabyte File System Saturday, August 11, 12 http://www.flickr.com/photos/ess-jay/2438565511/
  • 6. What the heck is a Zettabyte, anyway? 2^70 bytes ZFS is meant to scale far beyond the current and projected possible future limitations of hardware The theoretical maximum filesystem size is 256 quadrillion zettabytes That's 256,000,000,000,000,000 zettabytes That's 256,000,000,000,000,000 * 2^70 bytes Saturday, August 11, 12
  • 7. Feature summary Resource forks Built-in software RAID POSIX attributes and Snapshots ACLs COW data model (cheap Compression snapshots (very important for us)) Encryption Caching Deduplication Too much for one slide Built-in volume manager Saturday, August 11, 12
  • 8. Things we'll talk about today Volume manager Snapshots COW data model Saturday, August 11, 12
  • 9. Volume manager The ZFS volume manager provides native striping Makes it easy to add heterogenous disks to a pool No more worrying about getting geometries exactly the same Creates a nice abstraction from the physical layer Saturday, August 11, 12
  • 10. Snapshots They're exactly what they say on the tin Take a snapshot of the filesystem and it's there when you want it You can do all kinds of cool things with them, like send them over the network and clone them Saturday, August 11, 12
  • 11. COW Data Model The COW model is really where ZFS shines for containers COW (copy on write): if two copies of a snapshot have the same data, only one copy exists on disk until a clone writes to a file; then, a copy is made for the delta This makes snapshots, clones, and thus jails quick and cheap to create Absolutely critical to the container use case Saturday, August 11, 12
  • 12. Let's be Jailbirds You may pay me $50 to get out Saturday, August 11, 12
  • 13. Some FreeBSD background FreeBSD boots via /sbin/init like any other Unix /sbin/init runs /etc/rc, which sources /etc/rc.conf /etc/rc.conf controls which services start at boot, and also configures things like IP addresses, default route, and jails Saturday, August 11, 12
  • 14. Jails: Not just chroot(2) Everything lives under a directory mounted on the FS You can access the jail via chroot, but you don't get all the wins with this technique Every jail has at least one IPv4/IPv6 address Lightweight Lots of management tools Advanced technique: run Linux in a jail Saturday, August 11, 12
  • 15. Some jail tools jexec jailrc jls jailuser jailadmin jailutils jailctl jkill jailer jps jailme ... and so on Saturday, August 11, 12
  • 16. How jails work Install enough of FreeBSD to boot (/sbin/init calls /etc/ rc, which boots the system) Generally do this by building + installing source tree Then configure the jail and start it We'll be using the more flexible jailrc from the ports tree, rather than the default script Saturday, August 11, 12
  • 17. Still not as cool as Zones But pretty close Saturday, August 11, 12 http://www.flickr.com/photos/paldorslate/1761863421/
  • 18. What does this get us? It turns out that it gets us lots of cool stuff Saturday, August 11, 12 http://www.flickr.com/photos/daikrieg/1294053038/
  • 19. Basic workflow summary Create a zpool Snapshot Create a filesystem Clone desired environment or base as Install base jail to desired filesystem ??? Snapshot Profit! Create desired environment Saturday, August 11, 12
  • 20. Some workflows this supports Per-developer dev environments Dev/staging/QA/etc./prod Dev/prod Prod Saturday, August 11, 12
  • 21. Show Example jailrc Config Saturday, August 11, 12
  • 22. Per-developer container Create base jail Create snapshot Clone as necessary per developer hack hack hack... Push changes up to git repo / etc. Saturday, August 11, 12
  • 23. Dev/staging/QA/etc./prod Create base jail Snapshot Clone for dev zfs send | zfs recv for staging/qa/etc./prod If something passes a stage, promote it to the next- closest to prod Saturday, August 11, 12
  • 24. Dev/prod Like dev/etc./prod but more cowboyish With ZFS it's still better than other filesystems Snapshots mean it's easy to fix mistakes when they make it into prod (no workflow prevents mistakes getting to prod) Just clone from a working snapshot and go Saturday, August 11, 12
  • 25. Prod Even more cowbowish than dev/prod This is the sort of thing where developers work directly on production Unwise, but ZFS makes it less suck Snapshots save the day Saturday, August 11, 12
  • 27. Bibliography FreeBSD Handbook ZFS Administration Guide jailrc manpage Saturday, August 11, 12