custom live media spinning

23
Custom Live Media Spinning Jon Cowie, Etsy.com [email protected] @jonlives Thursday, 11 July 13

Upload: jonlives

Post on 12-Nov-2014

1.203 views

Category:

Technology


1 download

DESCRIPTION

This is the talk I gave at the 2013 CentOS Dojo in Aldershot on spinning custom CentOS live CDs

TRANSCRIPT

Page 1: Custom Live Media Spinning

Custom Live Media Spinning

Jon Cowie, [email protected]

@jonlives

Thursday, 11 July 13

Page 2: Custom Live Media Spinning

Thursday, 11 July 13

Page 3: Custom Live Media Spinning

1.5 billion page views$117 million of goods sold

950 thousand users

(in december ‘12)

Thursday, 11 July 13

Page 4: Custom Live Media Spinning

~800 physical hosts~300 kvm & lxc VMs

CentOS 5 & 6

Thursday, 11 July 13

Page 5: Custom Live Media Spinning

RacktablesCobbler

Chef

Thursday, 11 July 13

Page 6: Custom Live Media Spinning

Old Host Build Process

Configure StorageConfigureSwitchports

Configure DNSConfigure Cobbler

Power on HostProfit!

Rack Server Configure ILO

Thursday, 11 July 13

Page 7: Custom Live Media Spinning

New Host Build Process

Configure StorageConfigureSwitchports

Configure DNSConfigure Cobbler

Power on HostProfit!

Rack Server Configure ILO

Gabriel

Thursday, 11 July 13

Page 8: Custom Live Media Spinning

New Host Build Process

Configure StorageConfigureSwitchports

Configure DNSConfigure Cobbler

Power on HostProfit!

Rack Server Configure ILO

Sledgehammer

Thursday, 11 July 13

Page 9: Custom Live Media Spinning

Sledgehammer

Runs before OS InstallConfigures ILO

Configures RAID & GPT

Thursday, 11 July 13

Page 10: Custom Live Media Spinning

Live CD!

Memory residentNetwork bootable*Easily customisable

Thursday, 11 July 13

Page 11: Custom Live Media Spinning

Sledgehammer Live CD

Minimal installNetwork, disk tools

Ruby & GemsSledgehammer “Runner”

Thursday, 11 July 13

Page 12: Custom Live Media Spinning

Sledgehammer Runner

Mount NFSDownload config

Download payload RPMRun payload

Thursday, 11 July 13

Page 13: Custom Live Media Spinning

Sledgehammer Payload

Configure ILO Set up RAID

Configure GPT Burn-in tests

Update Racktables

Thursday, 11 July 13

Page 14: Custom Live Media Spinning

So how does it work?

Thursday, 11 July 13

Page 15: Custom Live Media Spinning

LiveCD Primer

-isolinux-initrd0.img-vmlinuz0

-LiveOS-squashfs.img-ext3fs.img

Thursday, 11 July 13

Page 16: Custom Live Media Spinning

LiveCD Primer

Load kernel and ramdiskMount ro / fs

Create rw overlayRun init

Thursday, 11 July 13

Page 17: Custom Live Media Spinning

First modification!

Overlay is fixed size.Copy entire FS to tmpfs

Mount rw / FS

Thursday, 11 July 13

Page 18: Custom Live Media Spinning

Second modification!

Custom payloadMust run automatically...

Thursday, 11 July 13

Page 19: Custom Live Media Spinning

/etc/init/start-ttys.conf

...env  ACTIVE_CONSOLES=/dev/tty[1-­‐6]...for  tty  in  $(echo  $ACTIVE_CONSOLES)  ;  do      ...      initctl  start  tty  TTY=$ttydone...

Thursday, 11 July 13

Page 20: Custom Live Media Spinning

/etc/init/start-ttys.conf...env  ACTIVE_CONSOLES=/dev/tty[1-­‐6]...for  tty  in  $(echo  $ACTIVE_CONSOLES)  ;  do      ...

if  [  \"\$tty\"  ==  \"\/dev/tty1\"  ]    then          initctl  start  centosdojo  TTY=\$tty    else          initctl  start  tty  TTY=\$tty    fidone...

Thursday, 11 July 13

Page 21: Custom Live Media Spinning

/etc/init/centosdojo.conf

stop  on  runlevel  [012456]exec  /usr/bin/openvt  -­‐c  1  -­‐w  -­‐f  -­‐-­‐  /opt/centosdojo/runner.rb

Thursday, 11 July 13

Page 22: Custom Live Media Spinning

So how do I build it?

Thursday, 11 July 13

Page 23: Custom Live Media Spinning

http://tiny.cc/dojo2013

Thursday, 11 July 13