Successfully reported this slideshow.

Building your own Desktop Cloud Environment

8

Share

Upcoming SlideShare
Vagrant
Vagrant
Loading in …3
×
1 of 54
1 of 54

Building your own Desktop Cloud Environment

8

Share

As developers we have seen these problems:

Our development environments accumulate lots of applications and libraries over a period of months.

We are usually in the habit of installing everything in one machine.

We fear that we may screw up our development environment and that means unproductive man-hours.

We forget that a multi-machine deployment is different from a single machine deployment.

How about virtualization in the desktop?

In this demo, I will take you through the steps to create a multi-VM development environment.

This demo will make use of QEMU, KVM and Virt Manager and show you how you can create a VM image, and then start servers with a set of commands, deploy your app, test everything and tear down the environment once you are happy - all this in the cosy comforts of your laptop or desktop.

The Jnaapti development environment is based on this setup.

As developers we have seen these problems:

Our development environments accumulate lots of applications and libraries over a period of months.

We are usually in the habit of installing everything in one machine.

We fear that we may screw up our development environment and that means unproductive man-hours.

We forget that a multi-machine deployment is different from a single machine deployment.

How about virtualization in the desktop?

In this demo, I will take you through the steps to create a multi-VM development environment.

This demo will make use of QEMU, KVM and Virt Manager and show you how you can create a VM image, and then start servers with a set of commands, deploy your app, test everything and tear down the environment once you are happy - all this in the cosy comforts of your laptop or desktop.

The Jnaapti development environment is based on this setup.

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Building your own Desktop Cloud Environment

  1. 1. Building your own Desktop Cloud Environment Gautham Pai, Founder jnaapti
  2. 2. The problems we face as developers Our development environments accumulate lots of applications and libraries over a period of months. We fear that we may screw up our development environment and that means unproductive man-hours. We are usually in the habit of installing everything in one machine. We forget that a multi-machine deployment is different from a single machine deployment. http://jnaapti.com/
  3. 3. Solution? How about Desktop Virtualization? http://jnaapti.com/
  4. 4. Why Desktop Virtualization? Bringing our development environment as close to the production environment as possible. Replicable deployment - verify everything before deploying to staging or production. Containerising functionality. "Don't panic" environment for experimentation Ease of provisioning for new employees. http://jnaapti.com/
  5. 5. Virtualization or Cloud? What I am talking about is closer to virtualization than cloud computing. For example, we are not dealing with transparent scaling, spike load handling etc. http://jnaapti.com/
  6. 6. Why QEMU-KVM and not Virtualbox? KVM is part of the Linux Kernel Virtualbox is from Oracle KVM provides better performance http://jnaapti.com/
  7. 7. What we want to try out Create a development environment with functionalities partitioned over separate VMs. Ensure that setting up this environment is not more than a few hours job. Ensure that bringing up the environment does not take more than a few minutes if not seconds. Ensure that the environment can run in a laptop with standard configuration. http://jnaapti.com/
  8. 8. System Requirements A laptop/desktop with a processor that supports virtulization technology to use KVM a Debian Linux environment atleast 2GB of free RAM atleast 10G of free disk space This will help us run as many as 5 VM images in parallel http://jnaapti.com/
  9. 9. Demo http://jnaapti.com/
  10. 10. The Approach In this demo, I will take you through the steps to create a multi-VM development environment In addition to our dev environment (dev-server), we will have a separate code-server, a web-server and a db-server setup. We then run it end-to-end – write some code, check it in, pull it into the web server, deploy the code and then test the new version of the app. http://jnaapti.com/
  11. 11. First, a look at a few terminologies QEMU is a generic and open source machine emulator and virtualizer. KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware. The Virtual Machine Manager application (virt- manager for short package name) is a desktop user interface for managing virtual machines. http://jnaapti.com/
  12. 12. Demo http://jnaapti.com/
  13. 13. The Approach We first create a base VM and install the OS in it, using the standard Ubuntu 10.04.2 Server ISO image We then install a SSH server and setup passwordless SSH access We then clone this system to as many systems as we need and setup various servers (code/caching/web/etc) on them http://jnaapti.com/
  14. 14. Installing Pre-requisites $ sudo apt-get install virt-manager qemu-kvm http://jnaapti.com/
  15. 15. Starting Virt Manager $ sudo virt-manager http://jnaapti.com/
  16. 16. Networking Requirements Every VM should have its own IP address. Every VM should be accessible from every other VM and that includes host. Every VM must be able to connect to the Internet. Solution? Bridged Networking. http://jnaapti.com/
  17. 17. Setting up the Bridge Network http://jnaapti.com/
  18. 18. Name your Virtual Network http://jnaapti.com/
  19. 19. Choose an IPv4 Address Space http://jnaapti.com/
  20. 20. Select DHCP Range http://jnaapti.com/
  21. 21. Setup NAT forwarding http://jnaapti.com/
  22. 22. Review and finish the wizard http://jnaapti.com/
  23. 23. Create the Base VM http://jnaapti.com/
  24. 24. Choose the Distribution to Install http://jnaapti.com/
  25. 25. Set RAM and CPUs http://jnaapti.com/
  26. 26. Set the Disk Space http://jnaapti.com/
  27. 27. Finalize the VM Creation http://jnaapti.com/
  28. 28. Install the OS in the Base VM http://jnaapti.com/
  29. 29. Select Hostname http://jnaapti.com/
  30. 30. Select Disk http://jnaapti.com/
  31. 31. Confirm Disk Format http://jnaapti.com/
  32. 32. Installation Progress http://jnaapti.com/
  33. 33. Installation Progress http://jnaapti.com/
  34. 34. Create User http://jnaapti.com/
  35. 35. Set Username http://jnaapti.com/
  36. 36. Configure APT http://jnaapti.com/
  37. 37. Set Automatic Upgrades http://jnaapti.com/
  38. 38. Install Additional Software http://jnaapti.com/
  39. 39. Install Pre-defined Collections http://jnaapti.com/
  40. 40. Installation Progress http://jnaapti.com/
  41. 41. Install GRUB http://jnaapti.com/
  42. 42. Install GRUB http://jnaapti.com/
  43. 43. Installation Complete http://jnaapti.com/
  44. 44. Installation Complete http://jnaapti.com/
  45. 45. Verifying the Base VM Installation Login to the Base VM Install the latest updates Make sure you can connect to the host from guest and vice-versa Setup password-less SSH access (Update interface identifier) http://jnaapti.com/
  46. 46. Cloning the Base VM Add the DNS server that we use for guest IP allocation to resolv.conf, so that you can address VMs using their hostnames Use virt-clone to clone the base VM Start the new VM Change the hostname of the new VM Reboot the new VM http://jnaapti.com/
  47. 47. Starting and Stopping the VMs $ #Start the domains $ virsh start webserver && virsh start dbserver && virsh start codeserver $ #Destroy the domains $ virsh destroy webserver && virsh destroy dbserver && virsh destroy codeserver http://jnaapti.com/
  48. 48. Where to go from here? Setting up package mirrors Snapshot creation on the fly You can mimic things like S3, EBS etc http://jnaapti.com/
  49. 49. Resources More detailed notes here Code is over at Github KVM Virtual Machine Manager KVM Networking QEMU Networking QEMU Images http://jnaapti.com/
  50. 50. Courtesy Server image from OpenClipArt CD image from pr0gr4mm3r.com Thanks to Pradeep Kumar, Ananth M, Kiran S, Ananda M, Madhukar Pai and Shrinivas S Kulkarni for reviewing the slides and providing valuable feedback http://jnaapti.com/
  51. 51. The Jnaapti development environment is based on this setup http://jnaapti.com/
  52. 52. This talk was first delivered in the “PHP Cloud” event organized by HasGeek http://jnaapti.com/
  53. 53. Thank you! Email: gautham@jnaapti.com http://jnaapti.com/
  54. 54. Happy Hacking http://jnaapti.com/

×