Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PC = Personal Cloud (or how to use your development machine with Vagrant and Virtual Box for good)

516 views

Published on

by Andrey Adamovich - 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.

Published in: Technology
  • Be the first to comment

PC = Personal Cloud (or how to use your development machine with Vagrant and Virtual Box for good)

  1. 1. 01
  2. 2. License Creative Commons 3.0 (BY­NC­SA) 02
  3. 3. About me 03
  4. 4. Andrey Adamovich Bio: 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
  5. 5. Hardware progress 05
  6. 6. CPU DB: Recording Microprocessor History 06
  7. 7. Multi­core processors Most 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
  8. 8. My laptop 4 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
  9. 9. Other examples 09
  10. 10. Paralella 10
  11. 11. Raspberry Pi cluster 11
  12. 12. OK 12
  13. 13. Let's talk about clouds 13
  14. 14. What is cloud? 14
  15. 15. Definition: Cloud A 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
  16. 16. Definition: Cloud computing I Cloud 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
  17. 17. Definition: Cloud computing II Cloud 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
  18. 18. Definition: Cloud computing III Cloud computing, or in simpler shorthand just "the cloud", also focuses on maximizing the effectiveness of the shared resources. Source: Wikipedia “ 18
  19. 19. X­as­a­Service Software­as­a­Service (users) Platform­as­a­Service (devs) Infrastructure­as­a­Service (devs + ops) ••• 19
  20. 20. IaaS If you know how to work with your servers, then on top of IaaS you can build other XaaS. 20
  21. 21. Components of effective IaaS Virtualized Computing + Storage services Networking + Security services OS image library service Rich API •••• 21
  22. 22. IaaS components servers disks ip addresses firewall settings (optional) images (starting point) snapshots (backups) •••••• 22
  23. 23. IaaS examples AWS EC2 Google Compute Engine Microsoft Azure ••• 23
  24. 24. IaaS vs. private cloud 24
  25. 25. In­house virtualization Comercial: VMWare, Oracle*, Parallels Open­source: VirtualBox, KVM, Qemu, Xen, Docker, OpenStack •• 25
  26. 26. VirtualBox 26
  27. 27. VirtualBox Powerful 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
  28. 28. A bit of history Created by innotek GmbH Open­sourced in 2007 innotek was acquired by Sun in 2008 Sun was acquired by Oracle in 2010 •••• 28
  29. 29. VirtualBox is local IaaS? 29
  30. 30. Computing services Well, it's a virtualization software Suports x86 and AMD64/Intel64 Supports many operating systems (Windows, Linux, Solaris, MacOS) ••• 30
  31. 31. Storage services Well, it's limited only by physical disk size The faster the better (SSD?) •• 31
  32. 32. Disk file formats VDI (VirtualBox) VMDK (VMWare) VHD (Windows) HDD (Parallels) •••• 32
  33. 33. Disk types Fixed­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 • • • ••• 33
  34. 34. Networking services 34
  35. 35. VirtualBox networking NAT with port forwarding Bridged networking Internal networking Host­only netwokring •••• 35
  36. 36. IP address pool 192.168.*.* = 65536K addresses 127.0.0.* = 256 addresses •• 36
  37. 37. Hosts On *nix in /etc/hosts On Windows in C:WindowsSystem32driversetchosts •• 37
  38. 38. 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. 38
  39. 39. The cheapest DNS ever! 39
  40. 40. Display Built­in viewer RDP/VNC Headless mode ••• 40
  41. 41. Snapshots VM settings Virtual disk state (differencing) Memory ••• 41
  42. 42. Image library Let's wait with this one a bit... 42
  43. 43. API = VBoxManage 43
  44. 44. VirtualBox commands 44
  45. 45. Vagrant 45
  46. 46. Vagrant features Simplified VirtualBox management (networking, security, shared drives, etc.) Easy to read and share configuration Package virtual machines as reusable boxes • •• 46
  47. 47. As simple as... vagrant init ubuntu/trusty64 vagrant up vagrant ssh 01. 02. 03. 47
  48. 48. Demo I 48
  49. 49. Image library 49
  50. 50. Vagrant cloud 50
  51. 51. What if there is no suitable box there? 51
  52. 52. Create your own! 52
  53. 53. Packer 53
  54. 54. How to make an image Download 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. 54
  55. 55. Packer command packer build ‐force 01. solaris11.json 55
  56. 56. How to use the image vagrant box add my/solaris11 solaris11.box ‐‐force vagrant init my/solaris11 vagrant up 1. 2. 3. 56
  57. 57. Demo II 57
  58. 58. Disk re­sizing I First resize the file inside VirtualBox Then resize partition in the guest OS Choose maximum size carefully ••• 58
  59. 59. Disk re­sizing II VBoxManage modifyhd <absolute path to file> ‐‐resize <size in MB> 01. 02. 59
  60. 60. Imaginary setup 60
  61. 61. Demo III 61
  62. 62. VirtualBox­only solution 62
  63. 63. VirtualBox + Docker 63
  64. 64. Summary 64
  65. 65. Formula VirtualBox + Vagrant(Cloud) + Packer = Personal Cloud 65
  66. 66. Recap: Components of effective IaaS Virtualized Computing + Storage services Networking + Security services OS image library service Rich API •••• 66
  67. 67. Personal cloud components Multi­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 •••••• • 67
  68. 68. Documentation & links https://www.virtualbox.org/manual/UserManual.html https://docs.vagrantup.com/v2/ https://www.packer.io/docs https://vagrantcloud.com/ •••• 68
  69. 69. Technologies to follow Automation: 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 •••••• 69
  70. 70. Questions? 70
  71. 71. Grazie! 71
  72. 72. Slides + code https://github.com/aestasit/talks2014­codemotion­milan­pc­personal­cloud­slides https://github.com/aestasit/talks2014­codemotion­milan­pc­personal­cloud­setup • • 72

×