The Developer's Guide to Virtual Machines

The Developer's Guide to Virtual Machines

The Developer’s Guide to Virtual Machines an Developer eBook The Developer's Guide to Virtual Machines n a world of multiple operating systems, each with various versions, no developer has the luxury of building appli- cations for only one target configuration. Every developer needs to ensure that his or her applications will function I correctly on all the OS configurations used by today's heterogeneous IT environments. Because dedicating physi- cal test systems for each target environment is out of most development teams' budgets, virtual machines (VMs) are the right solution at the right time. Virtualization solutions enable you to run multiple VMs on one physical computer. Each VM behaves as an isolated physi- cal PC or server with its own configuration – a very useful testing and development environment that's much cheaper than the real thing. Java developers know the benefits of the VM concept well. The promise of enabling developers to "write once, run anywhere" was a key factor in the broad adoption of Java, which itself runs on the Java Virtual Machine. As the market for virtualization grows, the ways in which developers use virtualization itself are expanding. The tradition- al development and testing uses of virtual machines as local disposable sandboxes and solutions for application isola- tion are broadening. Sharing development tasks across large teams in disparate locations appears to be the next step. Proper Virtual Machine Uses in Development and Testing Virtual machines can cut time and money from the software development and testing process, but they aren't the best choice in every scenario. When should you use virtual machines for developing and testing software, and when should you use a more traditional setup with physical machines? Software development typically involves developing and testing for different target environments, but dedicating a physical computer to each environment can be expensive. Not only do you have to consider the initial purchase cost, but physical computers also take up space, use power, and require maintenance. Virtual machines can reduce this cost by providing a way to run multiple development and test environments on one physical computer. Another problem with dedicating a physical computer to each environment is that setting up your target environ- ments can be quite time-consuming. In this situation, virtual machines can save you time. If you need to duplicate a particular environment, you can create a library of virtual hard disks that are pre-loaded with specific sets of soft- ware. You and other members of your develop- Figure 1 ment and test team can clone the disks that you need and quickly replicate a particular environment in a virtual machine. This type of setup can save lots of time when you need to start over with a clean installation, or duplicate the same environ- ment in several virtual machines This type of setup can save lots of time when you need to start over with a clean installa- tion, or duplicate the same environment in several virtual machines (See Figure 1). The figure shows Microsoft's Virtual Server with three virtual machines running the same build of BizTalk Server on three different operating systems. You could click one of 1 The Developer’s Guide to Virtual Machines, an Internet.com Developer eBook. Copyright 2006, Jupitermedia Corp. The Developer's Guide to Virtual Machines the thumbnails to access the virtual machine or use a Remote Desktop connection. (Note that licensing for software running in virtual machines is pretty much the same as in physical According to Rich Lechner, VP of Virtualization technol- machines, so make sure you have the proper licenses for all ogy for IBM, “Anywhere from 40 to 50 percent of the of your running software.) clients out there either have implemented or plan to implement virtualization over the next one to two You can also attach virtual machines to physical networks just as if they were physical, or you can create a virtual network years. We are seeing very broad-based adoption. for testing different scenarios, while isolating virtual machine Certainly much broader than, in my experience, the network traffic to the host computer. This is useful for patch- early days of Java and Linux." ing virtual machines, providing general network access to them, and validating different network scenarios that might be The trend has not been lost on chipmakers such as relevant in your software testing. Intel and AMD, who are tweaking the underlying sili- con of the x86 platform to enable VM software makers to optimize their products. Development and Testing Uses for Virtual Machines Let's examine exactly how virtualization works. The following sections describe the different ways that you An operating system running on a physical computer can use virtual machines for development and testing. controls the computer's hardware, including memory, CPU, network adapters, hard disks, and peripherals. Create a Library of Virtual Hard Disks Because only one operating system can control the hardware at any given time, you usually can't run As previously mentioned, you can create a library of virtual more than one operating system on the same comput- hard disk (.vhd) files that you and your colleagues can use to er at the same time. "instantly" recreate a particular environment. Using Microsoft's Virtual Server and Virtual PC, you can do this by creating a virtual machine, installing the requisite software on it, and then Virtual machine technology uses an agent to allocate cloning the .vhd file. You can attach the .vhd file to a new vir- physical hardware resources to the host operating tual machine, boot it up, and voila: your environment is run- system and the running virtual machines as needed. ning on the new virtual machine. The host still controls the physical hardware, but each virtual machine emulates its own set of hardware and If you want to run more than one virtual machine with the "borrows" physical resources from the host to run it. same .vhd on the same network, you must sysprep the virtual The virtualization agent (called the virtual machine machine to prevent network conflicts. monitor in Microsoft's Virtual Server and Virtual PC Create a Standardized IDE products) allocates the resources to each virtual machine's emulated hardware. This allows the hard- With your IDE deployed in a virtual machine, you can quickly ware of the physical computer to serve the host oper- set up a development environment that meets your compa- ating system and a number of virtual machines simul- ny's standards and even share it with colleagues in your .vhd taneously. library. If you work at home, you can install a virtual machine on your personal computer with the corporate "standard" As you might guess, you need enough hardware environment so you can connect to the corporate network. resources to run the various operating systems and applications, which is at the root of the main limitation You can also sandbox the virtual machine, isolating it from of virtual machines: you may need to beef up your your personal computer, to satisfy corporate security require- ments. We'll go into sandboxing in more detail later. hardware if it doesn't have enough resources for the virtual machines you want to run. 2 The Developer’s Guide to Virtual Machines, an Internet.com Developer eBook. Copyright 2006, Jupitermedia Corp. The Developer's Guide to Virtual Machines Test New Development and Test Tools You can try out new tools for software development and testing on a virtual machine without jeopardizing your pri- mary workstation setup. You can set up a .vhd file that has your basic environment installed, copy it, attach it to a new virtual machine, and boot it up. You can then install the new tools and see how they work in your environment. Perform Functionality Tests Use the following tips to make it quicker and easier to perform software functionality tests with virtual machines: • Deploy a variety of destination environments for functionality testing using minimal hardware (as previously mentioned). • Set up a library of test environments in virtual machines for rapid deployment (also previously mentioned). Just copy the .vhd file, attach it to a virtual machine, and boot up. • Run tests and then quickly roll your virtual machines back to a clean state. You can do this with Microsoft's Virtual PC and Virtual Server thanks to a cool feature called "undo disks." It can be used to reinstall builds of software that are under development at Microsoft. To get back to a clean base where you can install the latest build, do the following: • Install all of the prerequisites for the software. • Enable undo disks. • Install the software. When you want to go back to a clean base, turn off the virtual machine and discard undo disks. • Test complex network scenarios without setting up a physical network. Thanks to the flexible virtual network- ing in Virtual Server, you can create a complete network setup on your test computer and keep all of the net- work traffic isolated to the physical box. You can even set up a domain. What Not to Expect from Virtual Machines While their benefits all sound ideal, virtual machines do have two main drawbacks: they share physical resources with the host and any other running virtual machines, and they carry some processing overhead. So you can't expect the same performance from a virtual machine as you do from a physical one. Because they contend for resources in this way, the following are not good uses of virtual machines: • Performance and stress testing. Your results may not be accurate because the amount of resources available for a given operation can fluctuate.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    21 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us