Using btrfs Snapshots for Full System Rollback



Similar documents
Btrfs and Rollback How It Works and How to Avoid Pitfalls

Relax-and-Recover. Johannes Meixner. on SUSE Linux Enterprise 12.

Challenges Implementing a Generic Backup-Restore API for Linux

Advanced Systems Management with Machinery

SUSE Linux uutuudet - kuulumiset SUSECon:sta

Installing, Tuning, and Deploying Oracle Database on SUSE Linux Enterprise Server 12 Technical Introduction

Running SAP HANA One on SoftLayer Bare Metal with SUSE Linux Enterprise Server CAS19256

We are watching SUSE

Implementing Linux Authentication and Authorisation Using SSSD

Using SUSE Linux Enterprise to "Focus In" on Retail Optical Sales

kgraft Live patching of the Linux kernel

SUSE Customer Center Roadmap

Configuration Management in SUSE Manager 3

Build Platform as a Service (PaaS) with SUSE Studio, WSO2 Middleware, and EC2 Chris Haddad

SUSE Linux Enterprise 12 Security Certifications Common Criteria, EAL, FIPS, PCI DSS,... What's All This About?

Operating System Security Hardening for SAP HANA

SUSE Linux Enterprise 12 Security Certifications

HO15982 Deploy OpenStack. The SUSE OpenStack Cloud Experience. Alejandro Bonilla. Michael Echavarria. Cameron Seader. Sales Engineer

Wicked A Network Manager Olaf Kirch

DevOps and SUSE From check-in to deployment

High Availability Storage

Public Cloud. Build, Use, Manage. Robert Schweikert. Public Cloud Architect

Data Center Automation with SUSE Manager Federal Deployment Agency Bundesagentur für Arbeit Data Center Automation Project

SUSE Storage. FUT7537 Software Defined Storage Introduction and Roadmap: Getting your tentacles around data growth. Larry Morris

Kangaroot SUSE TechUpdate Interoperability SUSE Linux Enterprise and Windows

SUSE Enterprise Storage Highly Scalable Software Defined Storage. Gábor Nyers Sales

Wicked Trip into Wicked Network Management

TUT5605: Deploying an elastic Hadoop cluster Alejandro Bonilla

rear for corporate use Ralf Dannert Systems Engineer SUSE Linux GmbH

Securing Your System: Security Hardening Techniques for SUSE Linux Enterprise Server

High Availability and Disaster Recovery for SAP HANA with SUSE Linux Enterprise Server for SAP Applications

Big Data, SAP HANA. SUSE Linux Enterprise Server for SAP Applications. Kim Aaltonen

Ceph Distributed Storage for the Cloud An update of enterprise use-cases at BMW

Deploying Hadoop with Manager

How SUSE Is Helping You Rock The Public Cloud

Using SUSE Cloud to Orchestrate Multiple Hypervisors and Storage at ADP

Workflow und Identity Management - Genehmigungsprozesse, Role Mining, Role Design und Compliance Management

Software Defined Everything

How To Make A Cloud Work For You

Oracle Products on SUSE Linux Enterprise Server 11

SUSE OpenStack Cloud 4 Private Cloud Platform based on OpenStack. Gábor Nyers Sales gnyers@suse.com

<Insert Picture Here> Btrfs Filesystem

TUT8155 Best Practices: Linux High Availability with VMware Virtual Machines

SUSE Virtualization Technologies Roadmap

Of Pets and Cattle and Hearts

SUSE Cloud 5 Private Cloud based on OpenStack

Implementing the SUSE Linux Enterprise High Availability Extension on System z Mike Friesenegger

Linux w chmurze publicznej SUSE na platformie Microsoft Azure

SUSE Virtualization Technologies Roadmap

Restoring a Suse Linux Enterprise Server 9 64 Bit on Dissimilar Hardware with CBMR for Linux 1.02

Open Source High Availability Writing Resource Agents for your own services. Lars Marowsky-Brée Team Lead SUSE Labs

File Management Suite. Novell. Intelligently Manage File Storage for Maximum Business Benefit. Sophia Germanides

Novell Identity Manager Resource Kit

ZYPP common package and patch management for SUSE Linux. Duncan Mac-Vicar P. Software Engineer, YaST

CAS18543 Migration from a Windows Environment to a SUSE Linux Enterprise based Infrastructure Liberty Christian School

HO5604 Deploying MongoDB. A Scalable, Distributed Database with SUSE Cloud. Alejandro Bonilla. Sales Engineer abonilla@suse.com

How an Open Source Cloud Will Help Keep Your Cloud Strategy Options Open

Novell Remote Manager Administration Guide

NIST ITL July 2012 CA Compromise

Novell Collaboration Vibe OnPrem

Setup software RAID1 array on running CentOS 6.3 using mdadm. (Multiple Device Administrator) 1. Gather information about current system.

How To Migrate To Redhat Enterprise Linux 4

How To Manage Your Volume On Linux (Evms) On A Windows Box (Amd64) On A Raspberry Powerbook (Amd32) On An Ubuntu Box (Aes) On Linux

Apache LDAP Configuration

ORACLE OPS CENTER: PROVISIONING AND PATCH AUTOMATION PACK

Abstract. Microsoft Corporation Published: August 2009

Yosemite Server Backup Installation Guide

From Idea to Working Deployment:

Novell SUSE Linux Enterprise Virtual Machine Driver Pack

SUSE Linux Enterprise Server 11 SP4

File Systems Management Guide

2 Installing Privileged User Manager 2.3

IBRIX Fusion 3.1 Release Notes

Customizing Boot Media for Linux* Direct Boot

IBM Endpoint Manager Version 9.2. Patch Management for SUSE Linux Enterprise User's Guide

Securing Your System: Security Hardening Techniques for SUSE Linux Enterprise Server 12

Based on Geo Clustering for SUSE Linux Enterprise Server High Availability Extension

Current & Future Features of SUSE Linux Enterprise Server for System z

Storage Administration Guide. SUSE Linux Enterprise Server 12 SP1

SUSE Linux Enterprise 12 Sebastián Martínez

Using Encrypted File Systems with Caché 5.0

Advanced SUSE Linux Enterprise Server Administration (Course 3038) Chapter 5 Manage Backup and Recovery

Leveraging Wikis to Manage SCP Documentation TWiki Novell Technical Services

NATIONAL POPULATION REGISTER (NPR)

TUT19344 Managing RH/CentOS with SUSE Manager

Introducing Director 11

Use QNAP NAS for Backup

Linux Embedded devices with PicoDebian Martin Noha

Novell Archive and Version Services Administration Guide

NetIQ Sentinel Quick Start Guide

Transcription:

Using btrfs Snapshots for Full System Rollback Matthias G. Eckermann Senior Product Manager mge@suse.com Enterprise End User Summit, New York, June 2014 2014-06-20 15:44 UTC

Why this?

Minimizing Downtime RAS System Rollback High Availability Live Kernel Patching 4

Minimizing Downtime RAS System Rollback High Availability Live Kernel Patching 5

System Rollback Reduce Operational Downtime Goal: Go back to well-known system state Peace of mind for: System administrative tasks Package and patch installation System upgrades 6

Introducing snapper

8 http://www.snapper.io/

Snapper Btrfs integration Basic integration into Installer Btrfs as root fs Recommendation for subvolume layout Partitioner Create Btrfs Create subvolumes Tools Snapper manage snapshots Automatically create snapshots Display differences between snapshots Roll-back User Interfaces CLI DBUS Graphical (YaST) In development (GSoC) GUI integration 9

Introducing Snapper CLI example Snapper headers: Type : [ Pre Post Single ] # : Nr of snapshot Pre # : if type is Post the matching Pre nr. Date : timestamp Cleanup : cleanup algorithm for this snapshot Description : A fitting description of the snapshot (free text) Userdata : key=value pairs to record all sorts of useful information about the snapshot in an easily parsable format 10

Special Use case: Snapper and ITIL # @Begin of implementation Change: snapper create \ --type pre \ --description "ChgMgt Work order: Upgrade syslog configuration to forward log entries to central log server" \ --userdata \ "WorkOrder=201201253030000012-1, State=InProgress,Agent=jdoe@example.com" # @End of implementation Change: snapper create \ --type post --pre-number 240 \ --description "Done: ChgMgt Work order: Upgrade syslog configuration to forward log entries to central log server" \ --userdata "WorkOrder=201201253030000012-1, State=Closed, Agent=jdoe@example.com" 11

Rollback

File based Rollback How it works The system uses the same instance of a subvolume: working instance single files are copied from the snapshot to the working instance using CoW Benefits Subvolumes are treated as read-only Subvolumes can be used for Backup Supports Pick and Choose Disadvantages rollback not atomic Implemented in Snapper as undochange 13

Rollback per Subvolume How it works Instead of the original subvolume, the snapshot is mounted with the options subvol=<name> Remember: snapshots are subvolumes btrfs subvolume set-default... for permanent assignments Benefits atomic operation Very fast Disadvantages Additional complexity May require explicit mounting of subvolumes No rollback per single file Full System Rollback 14

Snapshot/Rollback Overview Past & Present snapper undochange Selective Rollback for Package updates Administrative changes Present & Future snapper rollback Full Rollback for Package updates Administrative changes No rollback of Kernel / initrd High Demand Kernel / initrd (initramfs) No rollback of Bootloader Bootloader System data, e.g. /var/log Customer data: /home, if on own partition (default) System data, e.g. /var/log 15

Full System Rollback

Full System Rollback Use Cases I have changed something, the system is still working, but now some functionality is missing / performance is bad /... reset the system, reboot, enjoy! Reboot later mode Something changed, and the system is not booting anymore (worst case scenario) need immediate reboot Reboot now mode 17

Snapshot / Rollback Reboot Later Mode Administrator is in a current read-write filesystem, but wants to rollback snapper list to view and select a snapshot Call snapper rollback <number> this will and reboot Create a new read-only snapshot of the currently running system Create a new read-write snapshot of the snapshot <number>, lineary after the just recently created read-only snapshot setdefault to the new read-write snapshot 18

Snapshot / Rollback Reboot Now Mode Boot into an existing read-only snapshot The system should work, as all variable data are on writable subvolumes anyways. To continue to work in this snapshot, the admin should call snapper rollback this will and reboot Create a new read-only snapshot of the old read-write one, linearly after the last existing one Create a new read-write snapshot of the snapshot you are currently in in read-only mode, lineary after the just recently created read-only snapshot setdefault to the new read-write snapshot 19

User view on Snapshot History

Snapshot / Rollback User view on Snapshot History (1) ro ro ro ro curr. rw 21

Snapshot / Rollback User view on Snapshot History (2) ro ro ro ro curr. rw ro ro-clone 1 22

Snapshot / Rollback User view on Snapshot History (3) rw-clone = Rollback btrfs subvol 2 set-default 3 ro ro ro ro old rw ro new rw ro-clone 1 23

Snapshot / Rollback User view on Snapshot History (4) New Snapshots ro ro ro 3 ro 4 old rw new ro 5 rw 4 ro 6 Diffs are possible 24

Snapshot / Rollback User view on Snapshot History (5) Condensed view What happens, if we rollback again? ro 3 ro 4 ro 5 ro 6 rw Caveat: this does not reflect 1:1 what happens technically. 25

Summary

Snapper availability... http://software.opensuse.org/download/package?project=filesystems:snapper&package=snapper 27

System Rollback Reduce Operational Downtime Goal: Go back to well-known system state Peace of mind for: System administrative tasks Package and patch installation System upgrades 28

Go ahead, try btrfs and snapper today! Your questions!? Thank you. 29

Demo scripts

Demonstration #1 Using Snapshots with YaST2 snapper # Description Tools 1 Track and visualize YaST activities with snapper Start YaST2 Create a new user (yast users) Start YaST snapper View the changes 2 Undo some of the changes Start YaST snapper Select the snapshot pair created by the yast users module 3 Install a new package by either using YaST2 and visualize the result using YaST2 snapper YaST2 Functions Automatic snapshots Integration with YaST and Zypp Rollback Hook scripts for integration YaST GUI and NCurses 31

Demonstration#2 btrfs subvols and snapshots # Description Tools 1 List the currently available subvolumes 2 List the currently available subvolumes display details about the parents of the subvolumes 3 Create your own subvolume /mydata btrfs subvol... btrfs subvol -p... btrfs subvol... 32

Demonstration#3 Snapper Command Line # Description Tools 1 List the currently available snapshots snapper list... 2 Show, which files differ in the snapshot pair created by yast users 3 Show the difference only in /etc/shadow in the snapshot pair created by yast users snapper status... snapper diff... 4 Undo a change remove unnecessary files in the user's home directory, e.g..xim.template snapper undochange... 5 Create your own snapshot and modify its description 6 Add a Key-Value pair to an existing snapshot snapper create -d <description> snapper modify <num> snapper modify --userdata <num> 7 Create your own snapshot pair snapper create --type pre... snapper list snapper create --type post --pre-number <n1>... 8 Change description and user data of some more of your snapshots snapper modify <num> 9 Rollback the full system to a former state snapper rollback <num> current 33

Demonstration#4 Full System Rollback # Description Tools 1 List the currently available snapshots snapper list 2 Install a new kernel zypper in... 3 List the currently available snapshots snapper list 4 Show the current kernel version and reboot uname -a ; reboot 5 List the currently available snapshots snapper list 6 Rollback to the former version and reboot snapper rollback <num> ; reboot 7 List the currently available snapshots snapper list 8 Show the current kernel version uname -a 34

Demonstration#5 Migrating from ext3 to btrfs # Description Tools 1 Create a logical volume or partition or loop device. Name it toconvert or the like. 2 Create an ext3 filesystem on this toconvert and mount it to /toconvert 3 Create some directories and files on /toconvert. Optional: create md5 checksums mkfs.ext3 -b 4096... mkdir, mount mkdir, vi Optional: md5sum 4 Perform the conversion and mount the filesystem again 5 Control, if your data are all there and check the optional md5sums 6 Understand, how btrfs saves the old ext3 filesystem metadata. /toconvert/ext2_saved/image umount /toconvert btrfs-convert... mount... find, md5sum,... mount -o loop... 35

Demonstration#6 Using snapper for /home/$user Requirements /home/$user is a btrfs subvolume snapper with DBUS interface (SLES 11 SP3, opensuse 12.3,...) Create a snapper configuration for the user allowing him/her to do snapshots Additional Option Automated snapshotting on login/logout Requires small changes to the configuration of Linux PAM (Pluggable Configuration Modules) 36

Corporate Headquarters Maxfeldstrasse 5 90409 Nuremberg Germany +49 911 740 53 0 (Worldwide) www.suse.com Join us on: www.opensuse.org 37

Unpublished Work of SUSE. All Rights Reserved. This work is an unpublished work and contains confidential, proprietary and trade secret information of SUSE. Access to this work is restricted to SUSE employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of SUSE. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability. General Disclaimer This document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. SUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for SUSE products remains at the sole discretion of SUSE. Further, SUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All SUSE marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.