Turtles all the Way Down. Image 2013 CC-BY-NC-SA by Tony Gray

Similar documents
Manage your disk space... for free :)

System Administration. Storage Systems

Arch Linux with an SSD Cache using LVM on BCache. Jeremy Runyan

CIS UNIX System Administration

BT Cloud Compute. Adding a Volume to an existing VM running Linux. The power to build your own cloud solutions to serve your specific business needs

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

Introduction to a Virtualization Testsuite --Based on Autotest Testing Framework. Yu Mingfei

Fedora Linux Installation Guide

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

Changing user login password on templates

Red Hat Enterprise Linux 8.0 Beta

Project 3: An Introduction to File Systems. COP 4610 / CGS 5765 Principles of Operating Systems

NASA Lab. Partition/Filesystem/Bootloader. TinRay, Yu-Chuan

Rocket RAID 2644 SAS Controller opensuse Linux Installation Guide

New RHEL 7.5 features: VDO, USBGuard, NBDE and AIDE. RHUG Q Marc Skinner Principal Solutions Architect 3/21/2018

Storage Performance Tuning for FAST! Virtual Machines

Upgrade Cisco Interface Module for LoRaWAN IXM using the Console

Ubuntu Linux Installation Guide

File system manager. Single tool to manage your storage. Red Hat. October 24, 2011

Manually Mount Usb Flash Drive Linux Command Line Redhat

Linux/QEMU/Libvirt. 4 Years in the Trenches. Chet Burgess Cisco Systems Scale 14x Sunday January 24th

Manually Mount Usb Flash Drive Ubuntu Server 12.04

SLES Linux Installation Guide

RHEL 5 Essentials. Red Hat Enterprise Linux 5 Essentials

RocketRAID 2680/2684 SAS Controller Red Hat Enterprise/CentOS Linux Installation Guide

Fedora Linux Installation Guide

Build your own NAS with OpenMediaVault

Red Hat Enterprise 7 Beta File Systems

ABOUT ZEPCAM SOFTWARE INSTALLATION MANAGEMENT AND BACKUPS. Description What is it Installation requirement Server requirement

RocketRAID 2522 SATA Controller Ubuntu Linux Installation Guide

MFT / Linux Setup Documentation May 25, 2008

Z-Drive R4 and 4500 Linux Device Driver

Red Hat Enterprise Linux 6

Adding a block devices and extending file systems in Linux environments

Deploy the ASAv Using KVM

A block layer overview. Red Hat Kevin Wolf 8 November 2012

Fedora 12 Essentials

1 LINUX KERNEL & DEVICES

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Course 55187B Linux System Administration

GL-280: Red Hat Linux 7 Update. Course Description. Course Outline

Manually Mount Usb Flash Drive Ubuntu Server

Contrail Cloud Deployment Guide

RocketRAID 231x/230x SATA Controller Red Hat Enterprise/CentOS Linux Installation Guide

kernels-in-kernels kernels within kernels by Lee Elston Version 1.0 c CC-BY SA4

RocketRAID 231x/230x SATA Controller Fedora Linux Installation Guide

BIG-IP Virtual Edition and Linux KVM: Setup. Version 12.1

exam.30q. Number: Passing Score: 800 Time Limit: 120 min File Version: 1 LPI

Red Hat HyperConverged Infrastructure. RHUG Q Marc Skinner Principal Solutions Architect 8/23/2017

RocketRAID 231x/230x SATA Controller Debian Linux Installation Guide

LPI201 LPIC-2 Exam Prep (Course 1) (LPI201) HL965S

End-to-End Encryption of Data-at-Rest for Linux on IBM Z and LinuxONE

SA2 v6 Linux System Administration II Net Configuration, Software, Troubleshooting

Open Source Storage. Ric Wheeler Architect & Senior Manager April 30, 2012

KVM Guest Management With Virt-Manager On Ubuntu 8.10

Red Hat Ceph Storage Ceph Block Device

Project 3: An Introduction to File Systems. COP4610 Florida State University

Week 10 Project 3: An Introduction to File Systems. Classes COP4610 / CGS5765 Florida State University

Enterprise Volume Management System Project. April 2002

A comparison of performance between KVM and Docker instances in OpenStack

Manual Install Ubuntu Server From Usb Drive

Red Hat OpenStack Platform 13

Install Cisco ISE on a Linux KVM

Linux File Systems: Challenges and Futures Ric Wheeler Red Hat

ONTAP Select with NVMe Storage

"Charting the Course... Enterprise Linux System Administration Course Summary

Exam LFCS/Course 55187B Linux System Administration

(Ubuntu 10.04), the installation command is slightly different.

How to Dual-Boot OS X and Ubuntu

Ganeti. Scalable Virtualization with Ganeti. by Lance Albertson

Red Hat Virtualization 4.1 Technical Presentation May Adapted for MSP RHUG Greg Scott

Red Hat announcements and new RHEL 7.5 features: VDO, USBGuard, NBDE and AIDE. Canada RHUGs Q Marc Skinner Principal Solutions Architect 9/2018

Stratis: A New Approach to Local Storage Management

Red Hat Ceph Storage Ceph Block Device

Virtualization Provisioning & Centralized Management with iscsi. RACF Brookhaven National Laboratory James Pryor CHEP 2010

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

File System. Computadors Grau en Ciència i Enginyeria de Dades. Xavier Verdú, Xavier Martorell

Manually Mount Usb Flash Drive Linux Command Line Fedora

Ubuntu Manual Disk Partitioning Guide

Linux Kernel Update - from scratch (almost) Platform: Archlinux, UEFI, GRUB2, and initramfs. Prof. Rossano Pablo Pinto

Virtualization and Performance

Ubuntu Manually Mount Cdrom Drive Command Line Vmware

"Charting the Course... MOC B: Linux System Administration. Course Summary

CREATING, EDITING AND MANAGING VMS

Installing a Virtual Machine Using an ISO Image

Enterprise Linux System Administration

Red Hat Enterprise Virtualization Hypervisor Roadmap. Bhavna Sarathy Senior Technology Product Manager, Red Hat

Linux System Administration, level 1. Lecture 4: Partitioning and Filesystems Part II: Tools & Methods

Virtual Machine Image Guide. OpenStack contributors

NetBSD on Google Compute Engine --- Step by step guide ---

Install Cisco ISE on a Linux KVM

This section describes the procedures needed to add a new disk to a VM. vmkfstools -c 4g /vmfs/volumes/datastore_name/vmname/xxxx.

ASIANUX SERVER 3 SP1 INSTALLATION GUIDE

Red Hat Enterprise Linux 6 Logical Volume Manager Administration. LVM Administrator Guide

Transparent Hugepage

Storage Controller Information

RocketRAID 2310/2300 Controller Fedora Linux Installation Guide

USING NGC WITH GOOGLE CLOUD PLATFORM

Control Center Planning Guide

The Btrfs Filesystem. Chris Mason

Transcription:

Turtles all the Way Down Image 2013 CC-BY-NC-SA by Tony Gray

Turtles all the Way Down Misadventures with Trim and Thin Steven Ellis Senior Solution Architect Red Hat NZ sellis@redhat.com / @StevensHat

Agenda s + Trim + Thin Redundant Turtles Turtle Serial Console Turtles Virtual Turtles Migrating Turtles Nesting Turtles Cows

+ Trim / Unmap / Discard Critical to effective use of s Lack of Trim can impact Lifetime of disk Blocks aren t released / re-allocated correctly Performance OS + File-system need to support Trim Delete requests are passed to

Turtles? Virtual Disk Encryption Encryption

File-system Discard

File-system Discard XFS / EXT4 / BRTFS / JFS fstrim periodic discard SWAP understands discard F2FS for Android / IoT / Embedded /etc/fstab options discard /etc/fstab options discard Confirm working sudo lsblk -o MOUNTPOINT,DISC-MAX,FSTYPE

Passthru Edit /etc/lvm/lvm.conf issue_discards = 1 Previous file-system tips apply

dmcrypt / Luks Edit /etc/crypttab luks-blah-blah-blah UUID=blahblah-blah none luks,discard Recreate boot disks dracut force Encryption Reference http://blog.christophersmart.com/201 3/06/05/trim-on-lvm-on-luks-on-ssd

Thin Creating a thin pool on VG myvg [root@t440s ~]# lvcreate -T -L 80G myvg/lv_thin Logical volume "lv_thin" created. New VM Disk Image [root@t440s ~]# lvcreate -V40G -T myvg/lv_thin -n New_VM Logical volume "New_VM" created. Virtual Disk Encryption

Trim + libvirt Check your machine type > 2.1 <type arch='x86_64' machine='pc-i440fx-2.4'>hvm</type> Add discard to your hard disks <driver name='qemu' type='raw' discard='unmap'/> Encryption Add scsi controller model virtio-scsi <controller type='scsi' index='0' model='virtio-scsi'>

Trim in a VM Treat like a physical environment Same rules apply for fstrim vs discard lvm.conf Luks Virtual Disk Encryption

Don t.. Just Don t.. Encryption + Trim in a VM Luks Virtual Disk Please please... DO NOT DO IT. Encryption

Are you Trim? Boot and test your VM [root@testvm ~]# lsblk -o MOUNTPOINT,DISC-MAX,FSTYPE MOUNTPOINT DISC-MAX FSTYPE /boot 1G xfs [SWAP] 1G swap / 1G xfs Run fstrim in your VM [root@testvm ~]# fstrim -v / /: 10.4 GiB (11197124608 bytes) trimmed Virtual Disk Encryption

Fat -> Thin Virtual Disk Image Thin Virtual Disk Encryption Physical Host

Fat -> Thin kpartx + fstrim Virtual Disk Image Painfully via kpartx + fstrim # kpartx -a /dev/myvg/myvmdisk # cd /mnt; mkdir volume # mount /dev/mapper/myvg-myvmdisk_base1 /mnt/volume/ # fstrim -v volume boot: 356.5 MiB (373850112 bytes) trimmed # umount volume/ Thin Virtual Disk Encryption Physical Host

Fat -> Thin kpartx + fstrim Virtual Disk Image Repeat for other filesystems mount /dev/guestvg/root /mnt/volume/ # fstrim -v./volume./volume: 9.8 GiB (10481520640 bytes) trimmed # umount volume Thin Virtual Disk Encryption Physical Host

Fat -> Thin kpartx + fstrim Virtual Disk Image Clean up VGs and kpartx /dev/mapper entries # vgchange -a n guestvg 0 logical volume(s) in volume group "guestvg" now active # kpartx -d /dev/mapper/myvg-myvmdisk_base Thin Virtual Disk Encryption Physical Host

Fat -> Thin virt-sparsify Virtual Disk Image Existing FAT # dd if=myvmdisk.img of=/dev/myvg/myvmdisk # virt-sparsify --in-place /dev/myvg/myvmdisk Thin Virtual Disk Encryption Fat image ->Thin # virt-sparsify myvmdisk.img /dev/myvg/myvmdisk # lvs /dev/myvg/myvmdisk Physical Host

Thin -> Thin Thin Virtual Disk Thin Virtual Disk Painful Sparse With Compression (Encryption) (Encryption) Host A Host B

Thin -> Thin Thin Virtual Disk Thin Virtual Disk Painful (Encryption) dd via ssh or nc Results in a Fat LV Use kpartx/fstrim or virt-sparsify at destination (Encryption) Host A Host B

Thin -> Thin Thin Virtual Disk Thin Virtual Disk (Encryption) Host A Sparse [root@hostb]# nc -l 11900 \ dd of=/dev/hostbvg/guestvg bs=16m conv=sparse [root@hosta]# dd if=/dev/hostavg/guestvg \ bs=16m nc hostb 11900 [root@hostb]# virt-sparsify in-place \ /dev/hostbvg/guestvg (Encryption) Host B

Thin -> Thin Thin Virtual Disk Thin Virtual Disk (Encryption) Host B Sparse + lzop [root@hostb]# nc -l 11900 lzop -d -c - \ dd of=/dev/hostbvg/guestvg bs=16m conv=sparse [root@hosta]# dd if=/dev/hostavg/guestvg \ bs=16m lzop --fast - nc hostb 11900 [root@hostb]# virt-sparsify in-place \ /dev/hostbvg/guestvg (Encryption) Host B

Nesting Turtles? CC by NC Christa Burns https://www.flickr.com/photos/christajoy42/5562852057/

Nesting /etc/modprobe.d/kvm-intel.conf Virtual Disk (Encryption) Physical Host options kvm-intel nested=1 Virtual Disk options kvm-intel enable_shadow_vmcs=1 Nested options kvm-intel enable_apicv=1 options kvm-intel ept=1 OR /etc/modprobe.d/kvm-amd.conf options kvm-amd nested=1 () (Encryption) Virtual Disk Virtual Host

But I like (q)cows?

Trim a qcow2 VM Same rules as we covered and Machine type / unmap / virtio-scsi Inside the VM fstrim vs discard lvm.conf virt-sparsify virt-sparsify disk.raw --convert qcow2 disk.qcow2 qcow2 image () (Encryption)

Raid and Trim? Two key software raid technologies mdadm lvm raid md0 raid1 mdadm raid1 partition partition

mdadm raid1 Linux software raid (mdadm) mdadm raid1 Subject to your kernel version / distro Initialisation may write to all blocks md0 Discard is passed-thru correctly Potentially impacting performance

raid1 based raid 1 Discard is passed-thru correctly raid1 partition partition Less initialisation overhead compared with mdadm

Tips 1) Trim / discard with libvirt + 2) Using virt-sparsify 3) Nesting with 4) Enable serial Console

Tips 1) Trim / discard with libvirt + 2) Using virt-sparsify 3) Nesting with 4) Enable serial Console (including Grub)

serial console Need to modify /etc/default/grub GRUB_TERMINAL="serial console GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no stop=1" GRUB_CMDLINE_LINUX remove rhgb quiet Add console=tty0 console=ttys0,38400n8 Rebuild grub2 config grub2-mkconfig -o /boot/grub2/grub.cfg

serial console + Ansible Example playbook https://github.com/steven-ellis/ansible-playpen Currently RHEL/Centos/Fedora centric grub_console.yaml Demo Pull requests welcomed

Questions? http://people.redhat.com/sellis

Open?