Contents

Linux-Virtualization Cheat Sheet

Amazon AWS

Docker

OpenNebula

OpenVZ

KVM

LXC

Vagrant

VirtualBox

Xen

Xen Server

Misc

Detect VM

Detect if you are in a virtual machine
virt-what

Test for HW virtualisation

egrep --color "svm|vmx" /proc/cpuinfo

# svm flag for AMD V
# vmx flag for Intel VT

Image Building Solutions

Optimize VM for SAN I/O

echo noop > /sys/block/<disk>/queue/scheduler

# Set a proper max queue length, readahead and max sectors
echo 1024 > /sys/block/<disk>/queue/nr_requests
echo 4096 > /sys/block/<disk>/queue/read_ahead_kb
echo 8192 > /sys/block/<disk>/queue/max_sectors_kb

# Disable I/O merges
echo 1 > /sys/block/<disk>/queue/nomerges

# Disable huge pages
echo never> /sys/kernel/mm/transparent_hugepage/enabled

# For single-process workloads
echo 0 > /sys/block/<disk>/queue/rq_affinity