vSphere 5.0 Backup and Restore

List of what should be backed up

There is some overlap between components listed below – some are within the vCenter database, but should still be exported separately (such as vDS’s). Other components can be disregarded if you have VM-level backups that can perform file-level restores. This is not a complete list, but it might be helpful for some items that are commonly overlooked (like the Inventory Service database).

  1. vCenter (KB 1023985 – Backing Up & Restoring vCenter):
    1. vCenter Database
    2. vCenter SSL certificates
      • Windows 2003: %ALLUSERSPROFILE%\Application Data\VMware\VMware VirtualCenter
      • Windows Vista and 2008 Server: %ALLUSERSPROFILE%\VMware\VMware VirtualCenter
    3. vpxd.cfg
      • vpxd.cfg stores things like:
        • If you increased the default timeout value for tasks that get sent through vCenter (KB 1017253)
        • Created Custom Attributes (migrate these to vCenter Tags if possible)
      • File paths for vpxd.cfg:
        • Windows 2003: C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\vpxd.cfg
        • Windows 2008: C:\ProgramData\VMware\VMware VirtualCenter\vpxd.cfg
    4. Permissions structure
      • You can export and import the vCenter permissions hierarchy using Powershell functions. See the reference material below:
        • VMware vSphere PowerCLI Reference: Automating vSphere Administration (Kindle Location 832).
  2. vCenter Inventory Service Database
    1. Inventory Service performs searches/index functions within the VI/Web Client. In 5.0, this service/database is packaged with the vCenter base installation. In 5.1+, this can be broken out into its own VM (not recommended based on the current best practices for version 5.5)
    2. The Inventory Service is a service, but also uses a database. This flat-file database contains:
      • vCenter tags (version 5.1+ only)
      • Storage Profiles
      • Storage Capabilities
      • Index of which VMs have which Storage Profile assigned
    3. Location of Inventory Service database: <install volume>\Program Files\VMware\Infrastructure\Inventory Service\
  3. ESXi hosts & VMs
  4. DRS configuration
  5. Web Client
  6. VMware Update Manager
  7. Syslog collector
  8. Misc add-ons/plugins
  9. Configure Syslog to capture at least 24 hours worth of logs
  10. Documentation
    1. Location of backed up data and retention info
    2. Non-standard installation paths
    3. Service account usernames and passwords:
      • 64 bit ODBC for vCenter
      • 32 bit ODBC for VUM
      • Account for registering/running VUM
      • Account for running vCenter services
      • Account for running SQL services
      • Account for connecting Web Client to vCenter
      • Root password(s) for ESXi hosts
      • Password for “vi-admin” on vMA appliance
      • Other misc usernames/passwords (Prosphere, Veeam/TSM/Commvault/BE, VSI Plugin, etc)

BACKUP – Inventory Service Database

  • You can take a file-level backup of the entire Inventory Service folder (path below), but it’s unclear what affect this will have on vCenter if a restore is performed using this method. The recommended way to get a backup of this is to use the built-in scripts designed to take a backup of the inventory service database. This can be done with Windows Task Scheduler
  • Task scheduler configuration settings:
    • Action: Start a program
    • Program/script: backup.bat
    • Add arguments: -file <install volume>\<custom subfolder>\inventorydb-backup
    • Start in: <install volume>\Program Files\VMware\Infrastructure\Inventory Service\scripts\
  • Once you verify that the script runs, right click on the task and select Export. This will create an XML file
  • After the scheduled task runs, you can have the backup team come by and pick up the “inventorydb-backup” and the exported Task Scheduler XML files

RESTORE – Inventory Service Database

  • If you need to roll back to a previous backup of the inventory database, you will lose any changes/additions/deletions to the following:
    • vCenter tags (version 5.1+ only)
    • Storage Profiles
    • Storage Capabilities
    • Index of which VMs have which Storage Profile assigned
  • The following steps are taken from KB 2017370:
    • Stop the vCenter Inventory Service (which also stops the VMware vSphere Profile-Driven Storage service)
    • Open a command prompt and CD to <install volume>\Program Files\VMware\Infrastructure\Inventory Service\scripts
    • Type restore -backup <path to backup file>\<backup filename>
    • Start the vCenter Inventory Service & VMware vSphere Profile-Driven Storage service

BACKUP – ESXi Host

  • Source link
  • A partial list of what gets backed up:
    • Virtual Standard Switches
    • DNS & Routing
    • Services & Firewall
    • NTP
    • iSCSI Software Adapter
    • Advanced Settings
  • A partial list of what does NOT get backed up:
    • Datastore names
    • Virtual machine names within the inventory list
  • Open PowerCLI and connect to the vCenter server managing the host(s)
  • Single Host Backup: Get-VMhostFirmware -VMHost  esxi1.qa.local -BackupConfiguration -DestinationPath D:\VMware_DR
  • All Hosts Backup: Get-VMHost | Get-VMhostFirmware -BackupConfiguration -DestinationPath D:\VMware_DR
  • Once complete, it will create the file “configBundle-esxi1.qa.local.tgz” in the case of a single host backup operation

RESTORE – ESXi Host

  • Place the host in maintenance mode
  • Open PowerCLI and connect to the vCenter server managing the host
  • Set-VMHostFirmware -VMHost esxi1.qa.local -Restore -SourcePath <source path of where you backed up the ESXi host configuration>
  • Enter root credentials for the ESXi host
  • After a period of delay, the ESXi host will become disconnected and then reconnect automatically. Ideally you would rebuild the host, but if you need to get a host back up and running quickly this is a good option

BACKUP – vCenter Database

  • There are multiple ways to backup the vCenter database, depending on what type of database you use. Refer to the specific software vendors documentation for more information

RESTORE – vCenter Database

  • Stop services:
    • vCenter Inventory Service
    • VMware vCenter Orchestrator Configuration
    • VMware VirtualCenter Management Webservices
    • VMware VirtualCenter Server
    • VMware vSphere-Profile-Driven Storage Service
    • VMwareVCMSDS
  • Restore a known-good copy of the vCenter database
  • Start services listed above
  • Note: virtual machine inventory names & vSS port group settings (among others) are not stored within the vCenter database – they are local to the ESXi host, so they will be unaffected by the restore

BACKUP – Web Client

  • Take a file-level backup of <install volume>\Program Files\VMware\Infrastructure\vSphere Web Client

RESTORE – Web Client

  • Stop the vSphere Web Client service if the application is still installed
  • Restore a known-good copy of the “vSphere Web Client” folder
  • Restart the server / start the vSphere Web Client service. You may not need to restart

BACKUP – vCenter Update Manager (VUM)

  • There are multiple ways to backup the VUM database, depending on what type of database you use. Refer to the specific software vendors documentation for more information
  • Take note of any non-standard settings, in addition to:
    • Baselines / Baseline Groups
    • All settings within the Configuration section (Download settings/schedule, etc)

RESTORE – vCenter Update Manager (VUM)

  • Stop the VMware vSphere Update Manager service
  • Restore a known-good copy of the VUM database
  • Start the VMware vSphere Update Manager service
  • Reconfigure VUM using the documented configuration settings

BACKUP – VMware Syslog Collector

  • Backup everything within C:\ProgramData\VMware\VMware Syslog Collector on the server that has Syslog Collector installed. The syslog data path does not change regardless whether it is a standalone or vCenter integrated installation

RESTORE – VMware Syslog Collector

  • There is no database, so you can restore the missing syslog data from a file-level backup
  • The reinstallation is straightforward, so just dump the syslog data back into C:\ProgramData\VMware\VMware Syslog Collector. There may be additional steps if a custom certificate is used

BACKUP/RESTORE – vCenter DRS Rules

  • Run the two scripts located here
Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: