• No results found

The Developer s Guide to Virtual Machines. Developer ebook

N/A
N/A
Protected

Academic year: 2021

Share "The Developer s Guide to Virtual Machines. Developer ebook"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

The Developer’s

Guide to

(2)

I

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 appliappli-cations will function 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 virtutradition-al machines as loctradition-al disposable sandboxes and solutions for application isola-tion are broadening. Sharing development tasks across large teams in disparate locaisola-tions 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

sit-uation, virtual machines can save you time. If you need to duplicate a particular environ-ment, you can create a library of virtual hard disks that are pre-loaded with specific sets of software. You and other members of your development 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).

Figure 1

(3)

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 the thumb-nails 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 machines, so make sure you have the proper licenses for all of your run-ning software.)

You can also attach virtual machines to physical networks just as if they were physical, or you can create a virtual network for testing different scenarios, while isolating virtual machine network traffic to the host computer. This is useful for patch-ing virtual machines, providpatch-ing general network access to them, and validating different network scenarios that might be relevant in your software testing.

Development and Testing

Uses for Virtual Machines

The following sections describe the different ways that you can use virtual machines for development and testing.

Create a Library of Virtual Hard Disks

As previously mentioned, you can create a library of virtual hard disk (.vhd) files that you and your colleagues can use to "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 cloning the .vhd file. You can attach the .vhd file to a new vir-tual machine, boot it up, and voila: your environment is run-ning on the new virtual machine.

If you want to run more than one virtual machine with the same .vhd on the same network, you must sysprep the virtual machine to prevent network conflicts.

Create a Standardized IDE

With your IDE deployed in a virtual machine, you can quickly set up a development environment that meets your compa-ny's standards and even share it with colleagues in your .vhd library. If you work at home, you can install a virtual machine on your personal computer with the corporate "standard" environment so you can connect to the corporate network.

According to Rich Lechner, VP of Virtualization technol-ogy for IBM, “Anywhere from 40 to 50 percent of the clients out there either have implemented or plan to implement virtualization over the next one to two years. We are seeing very broad-based adoption. Certainly much broader than, in my experience, the early days of Java and Linux."

The trend has not been lost on chipmakers such as Intel and AMD, who are tweaking the underlying sili-con of the x86 platform to enable VM software makers to optimize their products.

Let's examine exactly how virtualization works. An operating system running on a physical computer controls the computer's hardware, including memory, CPU, network adapters, hard disks, and peripherals. Because only one operating system can control the hardware at any given time, you usually can't run more than one operating system on the same comput-er at the same time.

Virtual machine technology uses an agent to allocate physical hardware resources to the host operating sys-tem and the running virtual machines as needed. The host still controls the physical hardware, but each virtu-al machine emulates its own set of hardware and "bor-rows" physical resources from the host to run it. The virtualization agent (called the virtual machine monitor in Microsoft's Virtual Server and Virtual PC products) allocates the resources to each virtual machine's emu-lated hardware. This allows the hardware of the physi-cal computer to serve the host operating system and a number of virtual machines simultaneously.

As you might guess, you need enough hardware resources to run the various operating systems and applications, which is at the root of the main limitation of virtual machines: you may need to beef up your hardware if it doesn't have enough resources for the virtual machines you want to run.

(4)

You can also sandbox the virtual machine, isolating it from your personal computer, to satisfy corporate security requirements. We'll go into sandboxing in more detail later.

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.

• Running multiple resource-intensive virtual environments on the same physical computer. Performance will be sub-optimal unless your computer is sized adequately. Your host computer must have the sum of all of the physical resources required by the running virtual machines, plus what the host system needs, plus about another 10 percent for overhead. You'll have other considerations as well, such as disk I/O requirements.

(5)

What does this mean to you? If you're a developer, limit the number of resource-intensive programs you run on a single computer. If you're a tester, you shouldn't try to use virtual machines for stress or performance testing. You should use physical computers for these purposes.

The Pros and Cons of Virtualization in the

Datacenter

Let's discuss the pros and cons of virtual machine technology for helping you determine whether the cost of imple-menting virtual machine technology is worthwhile. Should the VM benefits outweigh the drawbacks in your multi-server datacenter, virtual machine technology can provide more reliability, easier manageability, and lower overall cost for your organization.

This content was adapted from the Special Report “Virtual Machines Usher in a New Era” on DevX.com. Contributors: Glen Kunene, Megan Davis, Wellie Chao, Martin Heller, Edmon Begoli, John Paul Cook, and Todd Hudson.

Copyright 2006 Jupitermedia Corp.

References

Related documents

 Focus on applications, workloads running on virtual machines  Manage, monitor virtual machines just like physical machines  Microsoft System Center Virtual Machine Manager

The NSX firewall is a logical firewall that allows you to attach network and security services to the virtual machines, and the Service Composer allows you to group virtual

Now that your copy of Parallels Desktop is activated, you can create virtual machines, install operating systems in them, and work with the virtual machines' applications side by

• Office Open XML is a standard set of XML schemas adopted by Microsoft Office as its default file format. • different schemas for Word,

In addition to using these virtual machines as sources for virtual machine desktop pools, you can use virtual machines to host the server components of View including View

Hosting virtual nodes of a WSFC on a Single Host 7 Clustering Virtual Machines Across Physical Hosts 8 Clustering Physical Machines with Virtual Machines 9 Hardware and

To create additional nodes in a cluster of virtual machines across physical hosts, you create a template of the first virtual machine and use it to deploy additional virtual

To create additional nodes in a cluster of virtual machines across physical hosts, you create a template of the first virtual machine and use it to deploy additional virtual