class: center, middle # Welcome to DevOps State College --- # Why DevOps State College? * Build a community and make connections * Exchange ideas * Learn * Promote DevOps culture * Fun * Not tied to one vendor/technology --- # What is DevOps? Grand unification of philosophy around how to manage Development (programmers, application analysts, application owners, project managers) and IT Operations (system admins, network admins, security, data center, storage, database admin) in a tightly-integrated way. DevOps is the belief that working together as a collaborative team will produce better results, and break down barriers and finger pointing. --- # Future Presentations * DevOps and AWS Automation - TBA --- # Job Opportunities * AppliedTrust * AppliedTrust is hiring in Philadelphia, Dallas and Boulder offices. * For more information, see https://www.appliedtrust.com/jobs/ or talk to me afterwards --- # Snapshots * What are snapshots? * How do they differ from backups? --- # VM/Instance Level Snapshots * Taking a snapshot of an entire instance or virtual machine. * Typically covers all disks, but could be just the disk the root is on. * Inconsistent on a running system but better than nothing. # When to use it * Before patching * Periodically for restore points of entire OS * Before major architectural changes in your instance (switching from mysql to mongo on your DB server) Examples: * VMWare * AWS AMI backups * Many others --- # Disk Level Snapshots * Taking a snapshot of an entire disk. * Inconsistent on a running system but better than nothing. * If it's a database disk, your database might have an option to lock the database during the snapshot. # When to use it * Periodically for database restore points. Examples: * AWS EBS snapshots * dd command --- # An intro to logical volumes (LVM) * Can live on multiple disks * Each physical disk is added as a physical volume by using `pvcreate` command * Physical disks can be whole disks (/dev/sda) or individual partitions (/dev/sda1) * Each physical disk is added to volume group created using `vgcreate` or extended using `vgextend` * Logical volumes are created in the volume group using `lvcreate` # Why to use LVM * can resize (if filesystem supports it) in the fly. * can add disk to volume group by adding a disk to the system (or an EBS volume) * Can snapshot logical volumes from inside the OS! --- # LVM Snapshots * `lvcreate` a volume using the `-s` flag pointed at an existing volume in the volume group. * snapshots need to have enough free space in the volume group to handle any changes made to the source volume. * Good practice is to leave at least 10% of your volume group unallocated in case you need to take a snapshot. * Snapshot volume can be mounted like any other volume. * Typical practice is to use a tool like `rsync` to copy everything in the snapshot to a backup volume and then remove the snapshot. # Why to use it * Great for database backups * As before, can be inconsistent unless you tell the database to lock during the snapshot. * Fairly quick (a few seconds). --- # btrfs (or why I don't use LVM anymore) * Filesystems like `btrfs` can span multiple volumes making them easy to extend. * snapshots can be taken of subvolumes in the filesystem. * subvolumes can be mounted to an arbitrary location. * Even your root filesystem can be a subvolume!!! * Great for dual boot setups (nixos and archlinux running on same system). * snapshots can be taken of subvolumes but not individual directories so think ahead. * You can always use `rsync` to move contents of a directory to a subvolume. * Snapshots live in the filesystem, so you get logical separation without needing to reallocate disks. * snapshot removal is just rm -rf * Amazing for `/var/lib/docker` even if you don't use it anywhere else. * Can pipe subvolumes (and volumes) across a network to another host! --- # Example * `btrfs subvol create
` * `btrfs subvol snap
` --- # Warnings * you can run out of disk with df still showing disk available (use `btrfs fi df` instead) * Not as stable as other linux filesystems. Use with caution. --- class: center, middle # LIVE DEMO