Build a VMware Virtual Machine

VMware is the current standard for server virtualization in the enterprise datacenter. The following instructions will guide you through creating a VMware-based virtual machine suitable for hosting Drupal on Ubuntu Server 10.04 LTS.

Before You Begin

Creating a Linux virtual machine in VMware is fairly straight forward. Here are a few best practices to keep in mind:

  • Upload the operating system ISO file to a datastore on the host OS so you can map it to the virtual machine.
  • Best practices (PDF) suggest using a single CPU for guest operating systems until performance becomes an issue.
  • Apache and MySQL should be able to take advantage of multiple CPUs. Further monitoring will help you determine if this is the case.
  • The VMXNET network adapter supports jumbo frames and is optimized for performance, however you will need to install VMware Tools to use it. This VMware Knowledge Base article provides guidance on choosing the right network adapter.
  • The hard disk mode defines how snapshots affect the disk. Independent and Persistent can be set for disks that do not require snapshots.
  • We have yet to determine whether it is desireable to store "/var" on a separate hard disk or map it to the standard storage along with everything else. In the test environment for this guide, we are currently mapping everything to an 80GB drive on an iSCSI-based SAN array.

Instructions

The following steps assume that you are familiar with VMware Server. Consult the VMware Server User's Guide (PDF) for detailed instructions. The exact settings you use for your virtual machine (e.g. memory, disk space, etc.) will be determined by your available resources and use case requirements. Use the following as a guideline only.

  1. File > New Virtual Machine
  2. Wizard Type: Custom
  3. Name and Location: Web Server - Ubuntu 10.4
  4. Select a datastore
  5. Guest operating system: Ubuntu Linux (64-bit)
  6. Number of CPUs: 1 (one)
  7. Memory: 4,096MB
  8. Network:
    1. Number of NICs: 2
    2. Network(LAN), Adapter(E1000), connected at power on
    3. Network(LAN), Adapter(enhanced vmxnet), connected at power on
  9. I/O Adapters: LSI Logic
  10. Select a Disk: Create a new virtual disk
  11. Disk Capacity: 80GB, store with virtual machine
  12. Advanced Options: Virtual device node (scsi (0:0))
  13. Ready to Complete: Select "Edit VM settings before submitting"
  14. Hardware Tab > CD/DVD drive > Select Datastore ISO file and "Connect at power on"

You may now fire up your new virtual machine.

VMware Guest Optimization

There are a few additional steps you should consider to optimize the performance of your VMware guest OS. Check out this excellent article on the VMware knowledge base to improve the performance of your virtual machine.

Find an error? Know a better way? Please leave a comment and help improve this cookbook.