Tips For A Virtual Development Environment

27
eBooks by

Transcript of Tips For A Virtual Development Environment

Page 1: Tips For A Virtual Development Environment

eBooks by

Tips for a Virtual

Development Environment

Page 2: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 1

Table of Contents

1. Introduction .................................................................................................................... 2

2. Key Benefits ................................................................................................................... 5

3. Risks .............................................................................................................................. 7

4. Hardware Requirements ................................................................................................ 9

5. The Process ................................................................................................................. 11

6. Just a Starting Point ..................................................................................................... 18

7. Return on Investment ................................................................................................... 20

8. Summary (TL;DR) ........................................................................................................ 22

9. Want to try it out? ......................................................................................................... 24

Page 3: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 2

Introduction

Page 4: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 3

How long does it take for a new developer in your organization to get theirenvironment set up?

I’ve seen it take anywhere from a couple days to a week depending on theenvironment.

A few years ago, I joined a project that had an interesting requirement: They wouldNOT be supplying development workstations for us to use… we must supply our own.

This requirement caused us to go down the path of running our developmentenvironments in a virtual machine. Well, I had heard horror stories of companiestrying to do this using VMWare locally and Citrix server solutions, but two things weredifferent now… Memory and Solid State Drives. It was no longer unreasonable topurchase a machine with excessive (16 GB+) memory and an SSD.

Page 5: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 4

So, we embarked on the path of virtual development environments and found it to besuccessful.

Clarification note: I will be discussing localized virtual machines in this article. I’m notan advocate of “cloud­based” development environments (yet). If possible, I prefer tobe able to code without requiring a network connection.

Page 6: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 5

Key Benefits

Page 7: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 6

You may ask why? What value does setting up a virtual development environmentprovide?

Fast Setup for New Developers: On my project, we had a new developer up andcoding in a couple hours. ~1 hour to get logged in, install the VM software, and download the image. ~1 hour to pull down the source code, run the initial build and walk through the environment configuration steps.

Environment Consistency: No more choices about where to install software or whatversions were being used. You can sit down with any developer and things are wherethey should be. (…for the most part)

Fast Recovery: As developers, we like to play with stuff. New tools, versions,configurations, etc. With a virtualized environment, there is no risk anymore. You cantry out things and easily revert back to a good state, or start with the latest imageagain.

Page 8: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 7

Risks

Page 9: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 8

Since we had minimal investment in our virtual development environment approach(described below), the primary risk was performance.

And yes, the native performance was always faster than the virtualized developmentenvironment on the same physical machine. But when adequate hardware was used,the difference was not significant enough to cause concern.

Page 10: Tips For A Virtual Development Environment

Hardware

Requirements

www.intertech.com + 800.866.9884 @intertech.com 9

Page 11: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 10

Memory Is King!When you are firing up a “guest” virtual machine instance, you will assign it a certainamount of memory. If you’re talking about development tools, it will likely need to besomewhere around 8 GB. Therefore, the host operating system will need at least 8 +4 GB to run its own stuff. Thus, 12 GB gets you off the ground, but doesn’t give youmuch room to move… so max it out. Relative to a developer’s time, memory is cheap,and putting 32 GB in a dev box is not unreasonable.

Windows Swap File Note: You should read this Microsoft Knowledge Base article onswap/page file settings if you want to adjust your swap file size.

SSD

One of the biggest performance improvements that you can give to a developer is asolid state drive (SSD). These are now affordable and should be the default choice forany new development box. You can often couple it with a secondary hard drive ifadditional storage is needed.

Page 12: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 11

The Process

Page 13: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 12

For the project I was on, we used VMWare Workstation/Player, but the experience issimilar with VirtualBox or Hyper­V.

Startup

Install and setup your preferred virtual machine tool. Wikipedia has a comparison ofdifferent tools.Configure your VM and start with a base operating system image. Be sure to run anysystem updates.Create a wiki page or some document to track the changes and installation steps.

Publish The Base Image

Make a copy/archive of this base image so it can be used if you need to start over, orconfigure a new environment. With VMWare and Hyper­V, you can simply copy thevirtual machine directory with the configuration and virtual disk. With VirtualBox, youshould use the import/export functionality.

Page 14: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 13

Install Initial Software

Go through the process of installing all of the initial software on the VM.

This should include any development tools such as the IDE, plugins, source control,local app servers, database servers, browsers, etc.

Perform any standard configuration of the tools. Remember, the goal is to minimizewhat a developer has to do to get their environment up and running.

Carefully document all of the software installed and the steps used to install andconfigure it. This will come in handy if you want to automate the installation later orneed to start the process over.

Page 15: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 14

Cleanup

Before “finalizing” the image, document and run through a set of standard “cleanup”operations. These operations should be run every time you update the image andmay be refined as the image is modified.

­ Run any operating system updates ­ Update the browser(s) and clear the cache ­ Update other tools (e.g.: Flash Player, Adobe Reader, text editors) that require periodic updates ­ Empty the “trash” folder ­ Delete the files from the Temp directory ­ Delete any downloaded files not needed

Publish

Once the image is ready, save a copy of the image and label it with a date or version. Then upload the image to your network or portable disk for distribution.

Page 16: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 15

Load The Image

Find a developer willing to try it out, load the image onto the machine, and start it up.(This might be yourself.)

Go through the process of configuring the virtual development environment to thepoint where you can perform typical development and testing.

While going through this process, document the steps taken to make it easier for thenext developer.

Also, make notes about ways that you could improve the image and set these up asto­do’s for the next revision of the image.

Page 17: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 16

Revise The Image And Republish

Once you have enough items to stamp a new image, load up the original image, andwork through your to­do list. Don’t forget to run your cleanup scripts when complete.

While you are updating the image, be sure to document the steps so that anyone withan older version of the image can bring theirs up­to­date without having to switch tothe new image.

Page 18: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 17

Tips

Document, Document, Document! Keeping a clear record of what you did to yourimage will help you and other developers down the road. This is especially usefulwhen you have to uninstall/reinstall or reconfigure tools in a later version of the image.

Snapshots in VMWare and Virtualbox allow you to set a “known good state” whichyou can revert back to if something fails. Hyper­V offers the ability to use differencingdisks, which allows you to isolate changes after you’ve built your golden image, androll those changes back at any time.

For Windows VMs, you should consult with your Microsoft representative tounderstand your licensing entitlements. You may need to use tools like sysprep orslmgr to reset/update the activation key. Also, Hyper­V may be a better choice to helpease some of this pain.slmgr

sysprep

disks

Page 19: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 18

Just a Starting Point

Page 20: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 19

I’ll be the first to admit, this is not “ideal”. In a perfect world I would use tools likeVagrant or Docker to build images and Chef or Puppet to script the entire virtualdevelopment environment configuration, but sometimes you need a starting point.

If this is your first foray into virtualizing your development environment, it can be verydaunting when you look at all the tools out there. The process above can help you getstarted using simple tools and processes that you are already familiar with and thenyou can evolve over time.

Page 21: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 20

Return on Investment

Page 22: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 21

The Return on Investment calculation is very simple. Here is an example.

Without Virtualized Environment

Dev environment setup time (e.g. 3 days = 24h)* hourly cost (e.g. * $75 = $1800)+ troubleshooting time from current staff (~$200)= $2000 / Developer and 3 days of lost productivity

Initial Time to configure VM (e.g. 5 days = 40h)* hourly cost (e.g. * $75 = $3000)Reduced Dev environment setup time (e.g. 4h)* hourly cost (e.g. * $75 = $300 / Developer)+ 32GB of Memory (~$200 / Developer)= $3000 initially + $500 / Developer

With Virtualized Environment

This doesn’t take into account maintenance time, but it would effectively wash with theextra time performed in the manual setup for each developer.

Page 23: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 22

Summary (TL;DR)

Page 24: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 23

The quick takeaway is:

Virtualizing your dev environments can save you time and money… significant timeand money over a large team and long term projects.

Spend money on memory, virtualization will fail without it. The SSD is not essential,but greatly improves the experience.

Start simple with a manual process. Don’t get bogged down in automatingeverything initially. If it works and catches on, you can grow it from there.

Page 25: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 24

Want to try it out?

Page 26: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 25

Download and install VirtualBox (it’s free).

Then download your favorite Linux ISO file or the Windows 10 VM Image

Configure a VM, associate the ISO disk image to the Optical Disk, and start the VM.

You are now on your way… Enjoy!

VirtualBox

Linux ISO Windows 10 VM

Page 27: Tips For A Virtual Development Environment

www.intertech.com + 800.866.9884 @intertech.com 26

Need help with a developmentproject? Speak with a ConsultingRepresentative today.

651.288.7001

See our list of Consulting Solutions.