pc = personal cloud for codemotion (milan)

Post on 04-Jul-2015

274 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Have you ever wished to run production clone on your laptop to find that annoying bug? With decreasing hardware costs and growing hardware performance characteristics it becomes possible. Virtualization tools like VirtualBox come very handy at simulating real OS with real setup. Tools like Vagrant (VirtualBox wrapper) make it even easier. This presentation gives several hands-on demonstrations of Vagrant capabilities and the simplicity of integrating that into your normal development cycle.

TRANSCRIPT

01

LicenseCreative Commons 3.0 (BY­NC­SA)

02

About me03

Andrey AdamovichBio: Developer, coach, speaker, author, father

Company: Aestas/IT (http://aestasit.com)

E­mail: andrey@aestasit.com

Linkedin: http://www.linkedin.com/in/andreyadamovich

Lanyrd: http://lanyrd.com/profile/andrey­adamovich

GitHub: https://github.com/aadamovich

SO: http://stackoverflow.com/users/162792/andrey­adamovich

Twitter: @aestasit

••••••••

04

Hardwareprogress

05

CPU DB: Recording MicroprocessorHistory

06

Multi­core processorsMost of modern processors are multi­core

Many of them use advanced techniques to support better parallelism

and resource utilisation (hyper­threading, caching etc.)

Many of them are optimized for virtualization

••

07

My laptop4 cores, 2.9GHz each, 16GB of RAM, 250GB SSD + 250GB HD

During coding, answering e­mails etc. hardly half of the cores is used

My mobile phone has as many cores as my laptop

My game console (Wii) is way less powerful than my phone

••••

08

Otherexamples

09

Paralella

10

Raspberry Pi cluster

11

OK12

Let's talkabout clouds

13

What iscloud?

14

Definition: CloudA cloud is a visible mass of liquid droplets or frozen crystals made of

water or various chemicals suspended in the atmosphere above the

surface of a planetary body.

Source: Wikipedia“15

Definition: Cloud computing ICloud computing is computing in which large groups of remote servers

are networked to allow centralized data storage and online access to

computer services or resources.

Source: Wikipedia“16

Definition: Cloud computing IICloud computing relies on sharing of resources to achieve coherence

and economies of scale, similar to a utility (like the electricity grid) over

a network.

Source: Wikipedia“17

Definition: Cloud computing IIICloud computing, or in simpler shorthand just "the cloud", also focuses

on maximizing the effectiveness of the shared resources.

Source: Wikipedia“18

X­as­a­ServiceSoftware­as­a­Service (users)

Platform­as­a­Service (devs)

Infrastructure­as­a­Service (devs + ops)

•••

19

IaaSIf you know how to work with your servers, then on top of IaaS you can

build other XaaS.

20

Components of effective IaaSVirtualized Computing + Storage services

Networking + Security services

OS image library service

Rich API

••••

21

IaaS componentsservers

disks

ip addresses

firewall settings (optional)

images (starting point)

snapshots (backups)

••••••

22

IaaS examplesAWS EC2

Google Compute Engine

Microsoft Azure

Digital Ocean

••••

23

IaaS vs.private cloud

24

In­house virtualizationComercial: VMWare, Oracle*, Parallels

Open­source: VirtualBox, KVM, Qemu, Xen, Docker, OpenStack••

25

VirtualBox

26

VirtualBoxPowerful virtualization product for enterprise as well as home use

It has nice GUI and command line tools with tons of parameters

It is open­source and free for personal use

•••

27

A bit of historyCreated by innotek GmbH

Open­sourced in 2007

innotek was acquired by Sun in 2008

Sun was acquired by Oracle in 2010

••••

28

VirtualBox islocal IaaS?29

Computingservices

30

Computing servicesWell, it's a virtualization software

Suports x86 and AMD64/Intel64

Supports many operating systems (Windows, Linux, Solaris, MacOS)

•••

31

Storageservices

32

Storage servicesWell, it's limited only by physical disk size

The faster the better (SSD?)••

33

Disk file formatsVDI (VirtualBox)

VMDK (VMWare)

VHD (Windows)

HDD (Parallels)

••••

34

Disk typesFixed­size disk file

Slower creation time, faster writes

Dynamically allocated storage file

Faster creation time, slower writes

File size is growing when more disk sectors are written

Defragmenting disk inside guest OS will reduce file size

••

••••

35

Networkingservices

36

VirtualBox networkingNAT with port forwarding

Bridged networking

Internal networking

Host­only netwokring

••••

37

IP address pool192.168.*.*  = 65'536 addresses

127.0.0.*  = 256 addresses••

38

HostsOn *nix in  /etc/hosts

On Windows in  C:\Windows\System32\drivers\etc\hosts••

39

Hosts file example   192.168.33.15  local.solaris.messagebroker.net

   192.168.48.112 local.ubuntu.app.it

   127.0.0.212    local.active.directory.com

01.

02.

03.

40

The cheapestDNS ever!

41

DisplayBuilt­in viewer

RDP/VNC

Headless mode

•••

42

SnapshotsVM settings

Virtual disk state (differencing)

Memory

•••

43

Image libraryLet's wait with this one a bit...

44

API =VBoxManage

45

VirtualBox commands

46

Vagrant

47

Vagrant featuresSimplified VirtualBox management (networking, security, shared

drives, etc.)

Easy to read and share configuration

Package virtual machines as reusable boxes

••

48

As simple as...   vagrant init ubuntu/trusty64

   vagrant up

   vagrant ssh

01.

02.

03.

49

Demo I50

Image library51

Vagrant cloud

52

What if thereis no suitablebox there?53

Create yourown!

54

Packer55

How to make an imageDownload ISO file with your (favorite) OS

Download VirtualBox guest additions ISO to match VirtualBox

version

Free up local disk space (2x used virtual disk size + ISO size)

Set­up environment variables

Create Packer's JSON configuration

Start Packer build

Go somewhere for 30­40 minutes

1.

2.

3.

4.

5.

6.

7.

56

Packer command    packer build ‐force solaris11.json 01.

57

How to use the imagevagrant box add my/solaris11 solaris11.box ‐‐force

vagrant init my/solaris11

vagrant up

1.

2.

3.

58

Demo II59

Disk re­sizing IFirst resize the file inside VirtualBox

Then resize partition in the guest OS

Choose maximum size carefully

•••

60

Disk re­sizing II    VBoxManage modifyhd <absolute path to file> \

                        ‐‐resize <size in MB>

01.

02.

61

Imaginary setup

62

Demo III63

VirtualBox­only solution

64

VirtualBox + Docker

65

Summary66

FormulaVirtualBox + Vagrant(Cloud) + Packer = Personal Cloud

67

Recap: Components of effective IaaSVirtualized Computing + Storage services

Networking + Security services

OS image library service

Rich API

••••

68

Personal cloud componentsMulti­core laptop or desktop computer

VirtualBox (or VMWare) + Vagrant for virtualization

Packer (and patience) for image creation

VagrantCloud or external USB drive for image library

/etc/hosts, NAT, tunnelling for DNS and other network magic

Provisioning tools (Puppet, Chef, Ansible etc.) to fully setup your cloud

machines

Version control to keep track of your machine definitions

••••••

•69

Documentation & linkshttps://www.virtualbox.org/manual/UserManual.html

https://docs.vagrantup.com/v2/

https://www.packer.io/docs

https://vagrantcloud.com/

••••

70

Technologies to followAutomation: Vagrant, Packer and other tools form HashiCorp

Virtualization: VirtualBox, VMWare, Parallels, Hyper­V, Xen etc.

Containers: Docker ecosystem

Build your own IaaS with OpenStack

PaaS offerings: OpenShift, CloudFoundry etc.

Cloud providers: AWS, Azure, GCE

••••••

71

Questions?72

Grazie!73

Slides + codehttps://github.com/aestasit/talks2014­codemotion­milan­pc­personal­

cloud­slides

https://github.com/aestasit/talks2014­codemotion­milan­pc­personal­

cloud­setup

74

top related