A Guide to Test Boxes and Virtualization
Hayden Smith sketches out the benefits of creating a test box for your server and explains where to start…
When running a VPS, one of the best investments in time you can make is getting to know your server setup, but what do you do when you want to try some changes that carry the risk of causing potential downtime?
This is when a test box comes in handy. The ultimate test box would be an identical server running identical hardware with a mirrored operating system installation. In the real world though that’s a fairly unlikely thing to achieve, unless you have plenty of money to invest. Smaller businesses or single owners need to look at alternative solutions. This is where visualization can come in very handy.
Visualization has come a long way in recent years and there are plenty of free options to allow you to make a visualized model of your server. Here are the main ones for a beginners…
VirtualBox
This is a free desktop-aimed visualization tool from Oracle. It also includes some extra features subject to a “Personal use only” license. In this case, VirtualBox installs as any other application would. You double click the icon, and when it opens, it gives you the option of creating virtual computers to which you can install an operating system and then run. The virtual machines appear as a Window showing the output that would normally be fed to a monitor. This allows you to see what the computer would be doing and control it with your mouse and keyboard. The downside of this approach is that running the virtual machine on your laptop or desktop would mean only firing up your visualized test server when you need it.
VMware ESXi
This software is somewhat different to VirtualBox. You can only install it to a host PC, in a similar way to other operating systems such as Windows or Linux. However, it’s managed remotely by a tool that will feel similar enough to Virtualbox to not cause confusion. ESXi is free to install and use, though more features are available if it is licensed and yet more when used in conjunction with VMware’s other tools. If you have the luxury of a spare computer to test things on then VMware ESXi gives the opportunity to make many copies of your live server to poke, break, destroy and rebuild without the need to worry about keeping your virtual test server with you.
VMware Player
Player is VMware’s answer to VirtualBox. Using virtual disks from an ESXi host you can run them on your desktop PC and vice versa.
Once you’ve made your choice of visualization platform and installed it, the job of making your virtual server comes next. You’ll need to specify disk, an amount of RAM to use and an amount of processor to use. Choices made, you should then be able to select either a real optical drive on your computer for the virtual machine to share or use a virtual drive with a disk image loaded to it, such as a downloaded .iso of a Linux installer. At this point in time you don’t need to try to mirror the resources available to your main server on the basis that your test server shouldn’t be seeing the load profiles that your real one will, but you should allow enough resources so that the virtual server doesn’t run with lag. Once configured, add a disk image or a CD/DVD of the operating system you are using and run through the install process on to the server’s virtual disk.
After the install completes your virtual server should boot into the operating system you have installed ready for you to poke about and play with. Something you can do now is make a copy or clone of your virtual server. This means that, if the changes you make break the operating system, you don’t need to repeat the process of installing the operating system. I’d recommend creating a clone whenever you reach a stable software configuration that mirrors your main server, and then removing the older clones that are no longer required.
So what advantages does this bring? Well, if you decide to change the software you are using for any reason, such as moving from the Apache webserver to say Lighttpd or nginx then you can make a number of dry-runs at the change, converting configuration and looking for bugs or issues that may arise from making the transition prior to making the changes in earnest on a live system. This can save a lot of time and stress that would be suffered from attempting this on a live system. Once you get the hang of doing it, it will become second nature to go straight to your virtual server to try out a new software configuration or planned change to be sure that what you aim to do won’t break your live environment, or to be aware of the pitfalls that may approach you.