1 ESX Server 3.0 and VirtualCenter 2.0
2 Revision: Item: VI-ENG-Q You can find the most up-to-date technical documentation at: The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: 2006 VMware, Inc. All rights reserved. Protected by one or more of U.S. Patent Nos. 6,397,242, 6,496,847, 6,704,925, 6,711,672, 6,725,289, 6,735,601, 6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,961,941, 6,961,806 and 6,944,699; patents pending. VMware, the VMware boxes logo and design, Virtual SMP and VMotion are registered trademarks or trademarks of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. VMware, Inc Porter Drive Palo Alto, CA ii VMware, Inc.
3 Contents Preface vii About This Book viii Intended Audience viii Document Feedback viii VMware Infrastructure Documentation viii Conventions and Abbreviations ix Technical Support and Education Resources ix Self Service Support ix Online and Telephone Support x Support Offerings x VMware Education Services x Chapter 1 Introduction Concepts What to Back Up Virtual Machine Contents Virtual Machine Disks Raw Device Mappings Accessing and Managing Virtual Disk Files Backup Components and Approaches Backup Approaches Using Traditional Backup Methods Traditional Backup Considerations Backing Up the Service Console Backing Up Virtual Machines Backup Client in a Virtual Machine Backup Client in the Service Console SAN Backups NFS Backups Using VMware Consolidated Backup VMware Consolidated Backup Advantages VMware, Inc. iii
4 Chapter 2 VMware Consolidated Backup Overview How Consolidated Backup Works Integration with Third Party Backup Software Requirements VMware Virtual Machine Snapshot Technology Considerations When Creating Snapshots File Level Backups Full Virtual Machine Backups Setting Up Consolidated Backup VMware ESX Server and VirtualCenter Configuration SAN Configuration Configuring the Third Party Software Changing Backup Policies after ESX Server Upgrades VCB Proxy Configuration Hardware Requirements Prerequisites Configuring Windows on the VCB Proxy Disabling Automatic Drive Letter Assignment Configuring the Consolidated Backup Framework Installing a Backup Software Interoperability Module Configuring Virtual Machines for Consolidated Backup Consolidated Backup Restrictions Using Consolidated Backup Aliases Configuring Backup Jobs First Time Backup Advanced Configurations Running Custom Quiescing Scripts Canceling a Backup Job Chapter 3 Restoration and Disaster Recovery Restoring Your Files Using Consolidated Backup Restore Centralized Restore Per Group Restore Self Service Backup Restoring Files Using the vcbrestore Utility iv VMware, Inc.
5 Contents Data Recovery Troubleshooting Chapter 4 Backup Scenarios Backup Usage Scenarios A Typical Consolidated Backup Usage Scenario Appendix A Using Service Console to Back Up and Restore Virtual Machines General Configuration Settings for Consolidated Backup Utilities Configuration File Settings Backing Up Virtual Machines Performing Backups Identifying Virtual Machines Identifying Virtual Machines by DNS Name or IP Address Identifying Virtual Machines by BIOS UUID Identifying Virtual Machines by MoRef Identifying Groups of Virtual Machines Specifying Backup Destinations Backing Up to a Local Directory Backing Up to a Remote Server Restoring Virtual Machines Restoring Virtual Machines to Original Locations Restoring Virtual Machines to Alternative Locations Copying a Catalog File Editing a Catalog File Restoring Virtual Machines Using an Alternate Catalog Non interactive Use of the vcbrestore Utility Appendix B Restoring Virtual Machines from ESX Server 2.5.x to ESX Server Setting Configuration Parameters Restoring ESX 2.5.x Server Virtual Machines Index VMware, Inc. v
6 vi VMware, Inc.
7 Preface This preface describes the contents of the Virtual Machine Backup Guide and provides pointers to technical and educational resources. This preface contains the following topics:! About This Book on page viii! Intended Audience on page viii! Document Feedback on page viii! VMware Infrastructure Documentation on page viii! Conventions and Abbreviations on page ix! Technical Support and Education Resources on page ix VMware, Inc. vii
8 About This Book This manual, the Virtual Machine Backup Guide, provides information on different methods you can use to perform backup and restore tasks. It also describes how to use VMware Consolidated Backup, a new backup solution offered by ESX Server 3 and recommended to perform daily backups for virtual machines residing on a SAN. Intended Audience The information presented in this manual is written for system administrators who are experienced Windows or Linux system administrators and who are familiar with virtual machine technology and datacenter operations. Document Feedback If you have comments about this documentation, submit your feedback to: VMware Infrastructure Documentation The VMware Infrastructure documentation consists of the combined VirtualCenter and ESX Server documentation set. You can access the books in the VMware Infrastructure document set at: viii VMware, Inc.
9 Preface Conventions and Abbreviations This manual uses the style conventions listed in Table P 1. Table P-1. Type Conventions Style Purpose Monospace Used for commands, filenames, directories, paths. Monospace bold Apply to indicate user input. Bold Use for these terms: Interface objects, keys, buttons Items of highlighted interest Glossary terms Italic Used for book titles. < name > Angle brackets indicate variable and parameter names. Technical Support and Education Resources The following sections describe the technical support resources available to you:! Self Service Support! Online and Telephone Support! Support Offerings! VMware Education Services Self-Service Support Use the VMware Technology Network for self help tools and technical information:! Product Information Technology Information Documentation Knowledge Base Discussion Forums User Groups For more information about the VMware Technology Network, go to VMware, Inc. ix
10 Online and Telephone Support Use online support to submit technical support requests, view your product and contract information, and register your products. Go to support. For customers with appropriate support contracts, use telephone support for the fastest response on priority 1 issues. Go to phone_support.html. Support Offerings Find out how VMwareʹs support offerings can help you meet your business needs. Go to VMware Education Services VMware courses offer extensive hands on labs, case study examples, and course materials designed to be used as on the job reference tools. For more information about VMware Education Services, go to x VMware, Inc.
11 CHAPTER 1 Introduction Backup, restoration, and disaster recovery are among the most critical processes of datacenter management. VMware ESX Server and VMware Infrastructure provide many different solutions, each suitable for a specific environment, to perform backup and restore tasks. This introduction describes which resources should be backed up on an ESX Server system and explains options available for that backup. This chapter includes the following sections:! Concepts on page 2! What to Back Up on page 2! Backup Components and Approaches on page 5! Using Traditional Backup Methods on page 6! Using VMware Consolidated Backup on page 12 VMware, Inc. 1
12 Concepts The following concepts are essential for your understanding of backup procedures:! Quiescing A process of bringing the on disk data of a physical or virtual computer into a state suitable for backups. This process might include such operations such as flushing dirty buffers from the operating systemʹs in memory cache to disk, or other higher level application specific tasks.! Volume level (image level) backup A type of backup that backs up an entire storage volume.! File level backup A type of backup that is defined at the level of files and folders.! Full backup Backs up all selected files.! Full virtual machine backup Backs up all files that comprise entire virtual machine. These files include disk images,.vmx files, and so on.! Differential backup Backs up only those files that have changed since the last full backup.! Incremental backup Backs up only those files that have changed since the last backup, whether it is a full or incremental backup.! VCB proxy A physical machine running Microsoft Windows 2003, Consolidated Backup, and third party backup software. Used to perform off loaded file level and full virtual machine backups. What to Back Up Within the ESX Server environment, you need to back up the following major items regularly:! Virtual machine contents Because virtual machines are used frequently, critical information stored in their disk files constantly changes. As with physical machines, virtual machine data needs to be backed up periodically to prevent its corruption and loss due to human or technical errors. The virtual machine data you back up includes virtual disks, Raw Device Mappings (RDM), configuration files, and so on. For more information, see Virtual Machine Contents on page 3. 2 VMware, Inc.
13 Chapter 1 Introduction! ESX Server service console The service console, a customized version of Linux, is the ESX Server command line management interface. It provides the ESX Server management tools and a command prompt for more direct management of ESX Server. It also keeps track of all the virtual machines on the server and their configurations. NOTE In earlier releases, the service console was the main interface to the ESX Server host. With ESX Server 3 and later, the VI Client has priority, although you still might use the service console to perform some advanced administration operations. During its lifetime, the service console doesn t experience any major changes other than periodic upgrades. In addition, in case of a failure, you can easily recover the state of your service console by reinstalling ESX Server. Therefore, although you might consider backing up the service console, it doesn t need to be backed up as frequently as the virtual machines and their data. Virtual Machine Contents ESX Server uses VMware File System (VMFS) for its storage needs. VMFS is a simple, high performance file system on physical SCSI disks and partitions. VMFS is used for storing large files, such as the virtual disk images for ESX Server virtual machines and the memory images of suspended virtual machines. ESX Server 3 supports VMFS 3. A VMFS 3 volume can span multiple disk partitions, also called extents. Virtual Machine Disks In ESX Server 3, VMFS supports directories. Typically, there is one directory for each virtual machine on VMFS. This directory contains all the files that comprise the virtual machine, such as disk images, virtual machine configuration.vmx files, log files, and so on. The disk files are in a special format and generally use the.vmdk file extension. NOTE All the information normally backed up in the enterprise infrastructure, including the operating system, applications, and data, is included in the virtual disks. VMware, Inc. 3
14 Raw Device Mappings Raw Device Mappings (RDM) lets you use all the features of VMware Virtual Infrastructure in conjunction with raw SAN LUNs. The mapping file is the file that is used to connect the raw LUN to the virtual machine and is referenced in the virtual machine s configuration. Two modes exist for RDM: virtual compatibility and physical compatibility. Virtual Compatibility Mode Virtual compatibility mode allows a mapping to act exactly as a virtual disk file does, including virtual machine snapshots. In virtual compatibility mode, an RDM file in a VMFS volume manages metadata for its mapped device. There is a one to one mapping between mapping files and mapped devices. The mapping file is presented to the VMware service console as an ordinary disk file, available for file system operations, and can have redo logs. To the virtual machine, the ESX Server presents the mapped device as a locally attached SCSI device. Physical Compatibility Mode Physical compatibility mode allows direct SCSI access to the device being mapped for those applications that need lower level disk access and control. In both cases, data is stored on the LUN or SCSI device, not on the disk file. In physical compatibility mode, RDM provides minimal SCSI virtualization of the mapped device. In this mode, the VMkernel passes all SCSI commands to the device with one exception: the Report LUNs command is virtualized so that the VMkernel can isolate the LUN for the virtual machine that owns it. Otherwise, all physical characteristics of the underlying hardware are exposed. Physical mode is useful when you need to run SAN management agents or other SCSI target based software in the virtual machine. Physical mode is also used for virtual to physical clustering for costeffective high availability. Accessing and Managing Virtual Disk Files Typically, you use Virtual Infrastructure (VI) Client to perform a variety of operations on your virtual machines. Direct manipulation of your virtual disk files on VMFS is possible through ESX Server service console and VMware SDKs, although using the VI Client is the preferred method. From the service console, you can view and manipulate files in the /vmfs/volumes directory in mounted VMFS volumes with ordinary file commands, such as ls and cp. Although mounted VMFS volumes might appear similar to any other file system, such 4 VMware, Inc.
15 Chapter 1 Introduction as ext3, VMFS is primarily intended to store large files, such as disk images with the size of up to 2 TB. You can use ftp, scp, and cp commands for copying files to and from a VMFS volume as long as the host file system supports these large files. NOTE In Linux, importing a large disk from a Common Internet File System (CIFS) mount hangs the ESX Server, which must then be rebooted. If Consolidated Backup is not used, large files need to be moved from the service console to tape backup. To do this effectively, use supported programs with no reported known issues. As a workaround, use smbclient to copy the large file onto a local directory on the service console and then import from there. Additional file operations are enabled through the vmkfstools command. This command supports the creation of a VMFS on a SCSI disk and is used for the following:! Creating, extending, and deleting disk images! Importing, exporting, and renaming disk images! Setting and querying properties of disk images! Creating and extending a VMFS file system For more information on the vmkfstools command, see the Server Configuration Guide. Backup Components and Approaches When you perform a backup, the following three components of backup software are generally involved in the process:! Backup Client (Backup Agent) A program that scans virtual machine file systems and transfers data to be backed up to a backup server. During restore operations, the backup client writes the data into the file systems.! Backup Server A program that writes the data, pushed by the backup client, to a backup medium, such as a robotic tape library. During restore operation, the backup server reads the data from the backup medium and pushes it to the backup client.! Scheduler A program that allows you to schedule regular automatic backup jobs and coordinate their execution. Backups can be scheduled at periodic intervals, or individual files can be automatically backed up immediately after they have been updated. VMware, Inc. 5
16 Backup Approaches Each of the backup software components can be run in a virtual machine, on the service console, or on a physical machine, or a VCB proxy, running Microsoft Windows While the location of the scheduler isn t important, the locations of the backup server and backup client are important. Depending on where you want to run each component, you choose one of the following approaches:! Use traditional backup approach. With this approach, you deploy a backup client to every system that requires backup services. You can then regularly perform backups in an automated way. With this approach, several methodologies exist. You can choose a specific method that better suites your needs and requirements. For more information, see Using Traditional Backup Methods on page 6.! Use VMware Consolidated Backup, which enables offloaded and impact free backup for virtual machines running on ESX Server. This approach lets you use the virtual machine snapshot technology and SAN based data transfer in conjunction with traditional file based backup software. When running Consolidated Backup, you can back up virtual machine contents from a centralized Microsoft Windows 2003 proxy server rather than directly from the ESX Server system. Utilizing a proxy server reduces the load on ESX Server allowing it to run more virtual machines. For more information on Consolidated Backup, see VMware Consolidated Backup on page 13. For more information on the snapshot technology that Consolidated Backup employs, see VMware Virtual Machine Snapshot Technology on page 16. Using Traditional Backup Methods With the traditional backup methods, you deploy a backup agent on each host whose data needs to be secured. Backups are then conducted on a regular basis in an automated way. The backup agent scans the file system for changes during periods of low system utilization and sends the changed information across the network to a backup server that writes the data to a backup medium, such as a robotic tape library. 6 VMware, Inc.
17 Chapter 1 Introduction Using traditional methods, you can back up your service console and virtual machines. For more information, see:! Backing Up the Service Console on page 7! Backing Up Virtual Machines on page 8 Traditional Backup Considerations When using traditional methods to back up your system, keep in mind the following:! To be able to capture the data in its consistent state, perform backups at the times of the lowest activity on the network and when your computer resources are mostly idle. While performing backups, you might need to take critical applications off line.! Make sure that network bandwidth between the server you are backing up and the backup server is sufficient.! With a large number of servers, both physical and virtual, allocate enough resources to manage backup software on each host. Remember that managing agents in every virtual machine is very time consuming. Backing Up the Service Console Because the service console doesn t experience any major changes during its lifetime and its state is easily recoverable in case of a failure, you might decide against backing it up. However, if you choose to back up the service console, you don t need to do it frequently. Use the following methods when backing up service console:! File Based The service console can be treated as a physical machine with a deployed backup agent. To restore the service console, first reinstall it, then reinstall the agent, and then restore the files that you backed up. This approach makes sense if management agents that are hard to set up have been deployed in the service console. Otherwise, this approach provides no advantage over not backing up the service console.! Image Based Use third party software to create a backup image that you can restore quickly. Use your boot CD or whatever the backup software created to restore the service console. VMware, Inc. 7
18 Backing Up Virtual Machines Depending on your requirements, you might choose one of the traditional methods for backing up your virtual machines. Traditional backup methods do not use Consolidated Backup. Use the following table to compare available traditional methods. Table 1-1. Recommended Traditional Backup Methods (No Consolidated Backup) Backup Client Virtual Machine Backup Server Physical Machine Virtual Machine Method 1 Method 2 Service Console Method 3 Method 4 NOTE Running the backup server in the service console is not supported. Traditional backup methods offer the following options:! You can run backup clients from within a virtual machine performing file level or system level backups. As long as you are backing up over the network, no compatibility guide is needed.! You can run backup clients from the ESX Server Service Console, backing up virtual machines in their entirety as.dsk and/or.vmdk files residing in the ESX Server host VMFS file system.! You can back up virtual machine data by running a backup server within a virtual machine that is connected to a tape drive or other SCSI based backup media attached to the physical system. Backup Client in a Virtual Machine Method 1 and method 2 assume that you deploy your backup client in a virtual machine. Method 1: Backup Server in a Virtual Machine With this method, you deploy your backup client in one virtual machine while the backup server is in another virtual machine. Both virtual machines run on the same ESX Server system. Data between the two virtual machines moves through the virtual ethernet that connects these virtual machines. NOTE Method 1 is not recommended in ESX Server except in a branch office scenario where no separate hardware for a VCB proxy or backup server is available. 8 VMware, Inc.
19 Chapter 1 Introduction When you use method 1, the backup agent performs quiescing of a virtual machine being backed up. Method 1 is generally used for file level backups of the data stored within the virtual machine s disk image. Backup Server in a Virtual Machine Recommended: File level restore: Full virtual machine restore: Quiescing: Load on ESX Server: LAN free backup: Backup Impact: Manageability: No Very easy No Excellent Extremely high No No Very poor Method 2: Backup Server in a Physical Machine With this method, you deploy the backup client in a virtual machine while the backup server runs on a physical machine. NOTE Instead of method 2, consider using Consolidated Backup. Method 2 is used for file level backups of the data stored within the virtual machine s disk image. Backup Server in a Physical Machine Recommended: File level restore: Full virtual machine restore: Quiescing: Load on ESX Server: LAN free backup: Backup Impact: Manageability: Yes Very Easy No Excellent High No No Very poor VMware, Inc. 9
20 Backup Client in the Service Console Method 3 and method 4 assume that you deeply your backup client in the service console. Method 3: Backup Server in a Virtual Machine With this method, you deploy the backup client in the service console while the backup server runs in the virtual machine. NOTE Method 3 is not recommended in ESX Server except in a branch office scenario where no separate hardware for a VCB proxy or backup server is available. Method 3 is used to perform image level backups, or backups of entire virtual machines. Backup Server in a Virtual Machine Recommended: File level restore: Full virtual machine restore: Quiescing: Load on ESX Server: LAN free backup: Backup Impact: Manageability: No No Very easy Excellent Extremely high No No Very poor Method 4: Backup Server in a Physical Machine With this method, you deploy the backup client in the service console while the backup server runs on a physical machine. NOTE Instead of method 4 consider using Consolidated Backup. 10 VMware, Inc.
21 Chapter 1 Introduction Method 4 is used to perform image level backups. Backup Server in a Physical Machine Recommended: File level restore: Full virtual machine restore: Quiescing: Load on ESX Server: LAN free backup: Backup Impact: Manageability/Scalability: Yes No Very Easy Excellent High No No Very poor SAN Backups If your virtual disk files are stored on a SAN, you can use features supplied by your SAN vendor to create a copy of your production LUN, containing all virtual disks. These copies can then be sent to your backup media. With this method, you do not have to use virtual machine snapshotting functionality during the backup process because the SAN snapshot guarantees consistency. If you decide to use SAN snapshots to back up your data, you must consider the following points:! Some vendors support snapshots for both VMFS and RDMs. If both are supported, you can make either a snapshot of the whole virtual machine filesystem for a host, or snapshots for the individual virtual machines (one per disk).! Some vendors support snapshots only for a setup using RDM. If only RDM is supported, you can make snapshots of individual virtual machines. See your storage vendor s documentation for additional information. For more information on SAN, see the SAN Configuration Guide. NFS Backups If your virtual machines are stored on external network attached storage (NAS) systems using the network file system (NFS) protocol, you can perform image level backups of the virtual machines. See your storage vendor s documentation for additional information. VMware, Inc. 11
22 Using VMware Consolidated Backup In a modern datacenter environment, it has become increasingly difficult to apply the traditional approach to your backup processes. Using it might cause considerable overhead and a number of problems, some of which are described in Traditional Backup Considerations on page 7. To avoid many of the problems and issues, consider using VMware Consolidated Backup. VMware Consolidated Backup Advantages VMware Consolidated Backup addresses most of the problems you encounter when performing traditional backups. Consolidated Backup helps you to:! Reduce the load on your ESX Server systems by moving the backup tasks to one or more dedicated backup proxies.! Avoid congesting and overloading the data center network infrastructure by enabling LAN free backup.! Eliminate the need for a backup window by moving to a snapshot based backup approach.! Simplify backup administration by making optional the deployment of backup agents in each virtual machine you back up.! Back up virtual machines that are powered off. 12 VMware, Inc.