You are previewing How to Cheat at Configuring VmWare ESX Server.
O'Reilly logo
How to Cheat at Configuring VmWare ESX Server

Book Description

A virtual evolution in IT shops large and small has begun. VMware's ESX Server is the enterprise tool to free your infrastructure from its physical limitations providing the great transformation into a virtual environment--this book shows you how. Use Syngress' proven "How to Cheat" methodology to configure and build VMware's ESX Server version 3. This clear, concise guide provides all the information you need to become a virtual whiz!
This book will detail the default and custom installation of VMware's ESX server as well as basic and advanced virtual machine configurations. It will then walk the reader through post installation configurations including installation and configuration of VirtualCenter. From here, readers will learn to efficiently create and deploy virtual machine templates. Best practices for securing and backing up your virtual environment are also provided. The book concludes with a series of handy, time-saving command and configuration for: bash shell keystrokes, Linux commands, configuration files, common/proc files, VMware ESX commands, and troubleshooting.

. Reap the Benefits of Server Virtualization
Realize improved ROI, ensure efficient mergers and acquisitions, and reduce compliance risk exposure through server virtualization and consolidation.
. Build a Virtual Machine
Create a Gold Master and use your VMlibrary to leverage the power and flexibility of VMware.
. Manage Your Virtual Infrastructure
Use VMware tools to partition physical servers and manage virtual machines.
. Set Up Scripted Installation
See how a scripted installation method can be a fast and efficient way to provision ESX hosts.
. Master ESX Native Tools
Use tools like Esxtop to diagnose performance issues and vmkfstools to import and export
. Install and Use VMware Scripting APIs
Develop programs to help automate and ease administration-even with a limited background in scripting or programming.
. Learn the Fundamentals of a VM Backup
VMware ESX ships with three scripts that work together to create a backup and restore system: vmsnap.pl, vmsnap_all.pl, and vmres.pl.
. Extend a Cloned Windows VM's Root Partition
Use Microsoft's Sysprep utility to extend a newly deployed virtual machine's root partition from the original clone size to a larger size.

Table of Contents

  1. Copyright
  2. Lead Author
  3. Contributing Authors
  4. 1. Installing VMware ESX Server 3
    1. Introduction
    2. Prerequisites
      1. ESX Server 3 Requirements
      2. Downloading the latest Installation Media
      3. ESX Installation
    3. Summary
    4. Solutions Fast Track
      1. Pre-Installation
      2. Installation
    5. Frequently Asked Questions
  5. 2. Installing Virtual Center
    1. Introduction
    2. VirtualCenter Overview
    3. Installing Virtual Center
    4. VirtualCenter Configuration
    5. Adding Hosts to VirtualCenter
    6. Configuring ESX Server Networking in VirtualCenter
    7. Frequently Asked Questions
  6. 3. Creating Virtual Machines and Gold Images
    1. Creating Virtual Machine Templates
    2. Deploying Virtual Machines from templates
    3. Frequently Asked Questions
  7. 4. Physical to Virtual Migrations (P2V)
    1. Introduction
    2. Installing VMware Converter
    3. Using VMware Converter
    4. Summary
    5. Frequently Asked Questions
  8. II. Scripting VMware
    1. 5. Scripted Installation
      1. Introduction
      2. Setting Up the Scripted Installation
        1. Creating the Script
        2. Remote Network Installation
      3. Summary
    2. 6. An Introduction to ESX Native Tools and How to Use Them
      1. Introduction
      2. Esxtop
        1. Esxtop Overview
          1. The Virtual Machine World
          2. System World
          3. The Service Console World
        2. Some Other Helpful Esxtop Metrics
          1. %USED
          2. %Ready
          3. %EUSED
          4. %MEM
        3. vmkfstools
          1. Viewing Contents VMFS Partition
          2. Import/Export Files
          3. Adding a New Virtual Disk, Blank Virtual Disk, and Extending Existing Virtual Disks
          4. vmware-cmd
        4. vmkusage
      3. Summary
    3. 7. Scripting and Programming for the Virtual Infrastructure
      1. Introduction
      2. VMware Scripting APIs
        1. What Are the VMware Scripting APIs?
        2. Installing the VMware Scripting APIs
        3. Putting the VMware Scripting APIs to Work for You
          1. Working with the VmCOM API
            1. VmConnectParams
            2. VmCollection
            3. VmServerCtl
            4. VmCtl
            5. Managing Guests with User-Defined Variables
          2. Working with the VmPerl API
            1. VMware::VmPerl::ConnectParams
            2. VMware::VmPerl::Server
            3. VMware::VmPerl::VM
            4. VMware::VmPerl::Question
          3. Putting It All Together
            1. Example 1: Disconnecting Devices from Every Registered VM
            2. Example 2: Simple GUI to List All Virtual Machines
            3. Example 3: Test Automation with VMware
      3. VMware Virtual Infrastructure SDK
        1. What Is the VMware Virtual Infrastructure SDK?
          1. The VI SDK Architecture
          2. Overview of the VMware Virtual Infrastructure Web Service
            1. What Are Web Services?
            2. VMware VI SDK Conformance and Web Service Standards
          3. Operations Available Using the Virtual Infrastructure SDK
            1. Operations for Basic Web Service Client Interaction
            2. Operations for Element Management
            3. Operations for Virtual Computing
        2. Developing with the Virtual Infrastructure SDK 1.1
          1. Preparing the Virtual Infrastructure Web Service
          2. Working with the VMware WSDL
          3. Virtual Infrastructure SDK 1.1 Concepts and Terminology
            1. Path Hierarchy
            2. Terminology
            3. Programming Logic for the SDK
            4. Data Models and Datatypes
          4. Developing Your Management Application
            1. The Connection Process
            2. Handling SSL Certificates
            3. Obtaining with Object Handles
            4. Retrieving Items and Performing Operations
            5. Updating Interior Nodes
        3. Developing with the Virtual Infrastructure SDK 2.0
          1. Features Added to Virtual Infrastructure 2.0
          2. Preparing the Virtual Infrastructure 2.0 Web Service
          3. Working with the VMware VI SDK 2.0 WSDLs
          4. Virtual Infrastructure SDK 2.0 Concepts and Terminology
            1. Data and Managed Objects
            2. Managed Entity Inventory
            3. Host Agent versus VirtualCenter Feature Set
            4. Data Models and Data Types
            5. Programming Logic for the VI SDK 2.0
          5. Developing Your Management Application
            1. Managed Object Browser and Other Tools
            2. The Connection Process
            3. Handling SSL Certificates
            4. Retrieving Property Information
            5. Other Retrieval Mechanisms
        4. Performing Advanced Operations
          1. Power Operations
          2. Virtual Machine Migration
          3. Working with Snapshots
          4. Working with Scheduled Tasks
      4. Other VMware SDKs
        1. VMware Guest SDK
        2. VMware CIM SDK
      5. Summary
    4. 8. Building a VM
      1. Introduction
      2. Creation of Virtual Machines Utilizing Command-Line Tools
        1. Creation of a Virtual Machine Configuration File
          1. Creating Your Virtual Machine Configuration File
        2. Creation of a Virtual Machine Disk File
        3. Registering Virtual Machines with ESX Server
      3. Scripting Creation of Virtual Machines in ESX Shell
      4. Scripting Creation of Virtual Machines in Perl Scripts
        1. Modifying Scripted VM Creation with Perl
        2. Perl Script Components
          1. VmPerl Commands
      5. Cloning Virtual Machines Utilizing ESX Shell Scripts
      6. Cloning Virtual Machines Utilizing VmPerl Scripts
      7. Summary
    5. 9. Modifying VMs
      1. Introduction
      2. The Virtual Machine VMDK File
        1. VMDK Components
          1. Version=1
          2. CID=2af6d34d
          3. parentCID=ffffffff
          4. file.createType=“twoGbMaxExtentSparse”
          5. The Size in Sectors Value
          6. The Disk Data Base Command
        2. The Virtual Machine Configuration vmx File
          1. vmx File Components
            1. config.version = “”
            2. Scsi0:0.present = “”
            3. Scsi0:0.name = “”
            4. Scsi0:0.mode = “”
            5. scsi0.present = “”
            6. scsi0.virtualDev = “”
            7. ethernet0.present = “”
            8. ethernet0.connectionType = “”
            9. ethernet0.devName = “”
            10. ethernet0.networkName = “”
            11. Ethernet0.addressType = “vpx”
            12. Ethernet0.generatedAddress = “”
            13. Ethernet0.virtualDev = “vlance” or “vmxnet” or “e1000”
          2. Floppy Drives and CD-ROMs for Virtual Machines
          3. Graphics Emulation, Unique Identifiers
          4. Priority, VMware Tools Settings, and Suspend
            1. isolation.tools.dnd.disable = “True” or “False”
            2. suspend.Directory = “/vmfs/vmhba1:0:83:1”
          5. Autostart, Autostop, and Time Sync Options
            1. The tools.syncTime Option
      3. Virtual Machine Conversion from IDE to SCSI
        1. ddb.adapterType = “buslogic”
        2. ddb.adapterType = “lsilogic”
        3. Scripted Disconnect of IDE Devices
      4. Dynamic Creation of Virtual Machines
      5. Summary
    6. 10. Instant Disk: How to P2V for Free
      1. Introduction
      2. What Is a P2V?
      3. P2V Techniques
        1. VMware P2V Tool
        2. Platespin PowerConvert
        3. Barts/Ghost
      4. The “Big Secret” of P2V
      5. Instant Disk Overview
      6. The Bad News
      7. Prepping the ESX Host: Setting Up FTP on ESX Host
      8. Prepping the Source Machine: Install the SCSI Driver
        1. Installing the SCSI Driver in Windows 2000/2003
        2. Installing the SCSI Driver in Windows NT
      9. Continue Prepping the Source Machine: Validate
      10. The Linux Rescue CD
        1. Booting the Rescue CD
      11. At the Command Prompt
      12. Finding the Hard Drives and Storage
        1. Linux and Hardware
      13. Virtual Disk Files on the VMFS
      14. Starting the FTP Process
      15. Creating a New Virtual Machine and Pointing It to a New VMDK File
        1. Windows VMs
          1. Post-P2V
      16. Summary
    7. 11. Scripting Hot Backups and Recovery for Virtual Machines
      1. Introduction
      2. Anatomy of a VM Backup
        1. Limitations
        2. Layered REDO Logs
      3. Hot VM Backup Sample Script
      4. Choosing the Target for VM Backups
        1. NFS
          1. Attributes of NFS for VM Backups
            1. Pros
            2. Cons
        2. CIFS
          1. Attributes of CIFS for VM Backups
            1. Pros
            2. Cons
        3. FTP
          1. Attributes of FTP for VM Backups
            1. Pros
            2. Cons
        4. VMFS
          1. Attributes of Copies to VMFS for VM Backups
            1. Pros
            2. Cons
      5. Existing VM Backup Tools
        1. vmsnap.pl, vmsnap_all, and vmres.pl
        2. vmbk.pl
        3. Commercial Options
      6. VMX File Backups
      7. Incorporating Hot VM Backups into Your Recovery Plan
        1. Crash Consistent State
        2. Replication
        3. Hot VM Backups as Part of the Recovery Plan
          1. 1st Step: Take an Inventory of Your Virtual Machines
          2. 2nd Step: Determine the Recovery Point Objective for Each VM
          3. 3rd Step: Determine the Recovery Time Objective for Each VM
          4. 4th Step: Apply the Right Backup Job to the Need
          5. 5th Step: Document Your Results
        4. Hybrid Backup Strategy
      8. Summary