Saturday, April 14, 2018

Backup and Restore Virtual Machines

 Backup and Restore Virtual Machines


**ITEMS IN BOLD ARE TOPICS PULLED FROM THE BLUEPRINT**

Knowledge

  • Identify snapshot requirements
    • A snapshot is essentially a point-in-time image of a virtual machine.  I won’t get deep into how they are implemented within vSphere because it can be a bit complex if this is your first time looking at them.  You can either take a crash-consistent snapshot or an application consistent snapshot.  Taking a snapshot and Quiescing the state will create an application consistent snapshot
    • There are different types of requirements when talking about snapshots, business requirements and hard requirements as defined by vSphere.  Business requirements are more the business use/use case for them in your environment
    • Some use cases or business requirements for snapshots
      • Change management
      • Patching
      • Software upgrades
    • vSphere Requirements for Snapshots
      • Raw disks, physical Raw Device Mapping (RDM) disks or guest operating systems utilizing iSCSI software initiators are not supported
      • PCI Direct Path I/O devices are not supported
      • VMs with independent disks are only supported for snapshots when turned off
      • Snapshots are not supported on VMs that are configured for bus sharing

  • Create/Delete/Consolidate virtual machine snapshots
    • Create a Snapshot
      1. Log in to vCenter using the VI Client
      2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters) or navigate to the VMs and Templates view (View > Inventory > VMs and Templates)
      3. Right-click on the virtual machine you want to snapshot > select the Snapshot menu and click Take Snapshot…
      4. The Snapshot window will come up, enter in a Name for the snapshot – make it meaningful
      5. Enter in a Description for the snapshot
      6. Select whether or not to Snapshot the virtual machine’s memory, this checked by default
      7. Select whether you want to Quiesce guest file system, which requires VMware tools, by checking the checkbox
      8. Click OK and the snapshot will be created

    • Delete/Consolidate a Snapshot – deleting is consolidating
      1. Log in to vCenter using the VI Client
      2. Navigate to the Host and Clusters view (View > Inventory > Hosts and Clusters) or navigate to the VMs and Templates view (View > Inventory > VMs and Templates)
      3. Right-click on the virtual machine you that has a snapshot you want to delete/consolidate > select the Snapshot menu and click Snapshot Manager…
      4. Select the snapshot you want to delete
      5. Click Delete
      6. You can also click Delete All if you want to delete/consolidate all of the snapshots for that virtual machine
      7. Click Yes to confirm deleting/consolidating the snapshot
      8. Click Close to close the snapshot manager
Keep in mind that the longer you have been running on the snapshot(s) you are deleting, the longer it will take to consolidate them into the base vmdk
  • Install and Configure VMware Data Recovery
    • Before we go over installing VMware Data Recovery lets discuss a few requirements
      • Only 100 VMs can be backed up per data recovery virtual appliance
      • 10 data recovery appliances per vCenter instance
      • 8 virtual machines can be backed up simultaneously
      • Depending upon the number of virtual disks being backed up you may have to add additional SCSI controllers to the data recovery appliance in order to hot-add more hard drives
      • The appliance connects to vCenter over port 902
      • The File Level Restore (FLR) client uses port 22024
    • There are a lot more requirements than the list above, see pages 13-17 of the VMware Data Recovery Administration Guide to view a complete list
    • Install VMware Data Recovery – Client Plug-in; install on the machine you want to manage Data Recovery from
      1. From the installation media run “VMwareDataRecoveryPlugin.msi” (this is the name at the time of this posting)
      2. Click Next three times
      3. Choose I Agree to the EULA and click Next
      4. Click Next to begin the install
      5. Click Close when the installation is complete
    • Install VMware Data Recovery – Backup Appliance
      1. Extract the OVF from the installation media for the backup appliance if you have not done so already
      2. Log in to vCenter using the VI Client
      3. Click the File menu and select Deploy OVF Template…
      4. Browse and select the OVF file you extracted from the installation media > click Next
      5. You will see the details of the OVF > click Next
      6. Accept the EULA and click Next
      7. Select a name for the backup appliance
      8. Select an Inventory location for the backup appliance > click Next
      9. Select the cluster you want to deploy the appliance to > click Next
      10. Choose a datastore cluster or datastore you want to store the appliance on – if you choose a datastore cluster you have the option of disabling SDRS > click Next
      11. Select your disk format > click Next
      12. Map out your source and destination networks for the two networks > click Next
      13. Select a time zone setting from the dropdown > click Next
      14. Optionally check Power on after deployment and click Finish
      15. Now you can add additional hard disks to the backup appliance if you want to use that space to store backups instead of using SMB or NFS
      16. Power on the backup appliance
    • Configure VMware Data Recovery
      1. Log in to vCenter using the VI Client
      2. Open the console (right-click appliance and select Open Console) for the backup appliance you just deployed
      3. Select Configure Network from the menu > press Enter
      4. Follow the steps to configure the IP settings for the appliance, IPv4 or IPv6
      5. Alternatively you can configure the network settings through a web browser if the appliance received an IP address via DHCP, check the console and go to the URL displayed (default login is root/vmw@re)
      6. Log in to vCenter using the VI Client (if you aren’t already)
      7. Select the View menu > select Solutions and Applications > VMware Data Recovery – this won’t be in the list of items if you haven’t installed the plug-in
      8. Provide a name or IP of the data recovery backup appliance > click Connect
      9. Enter in the password for the username displayed > click OK
      10. The Getting Started Wizard will display and auto-fill with the credentials you just provided > click Next
      11. You need to add a backup destination
        1. Virtual Disk attached to the Backup Appliance
          • If you added a disk during the install, it will be displayed in the list.  Select it and click the Format hyperlink to format the volume.  Once complete the volume will be mounted
        2. Network Share
          • Click the Add Network Share hyperlink
          • Click Continue to the warning displayed which basically states don’t use a network share greater than 500GB
          • Enter in the URLUsername and Password > click Add
          • Click Close
      12. Choose which backup destination you want to use > click Next
      13. The Create a new Backup Job after completion is checked by default; leave checked or uncheck it > click Close

  • Create a backup job with VMware Data Recovery
    • Alright, lets create a backup job with our newly installed Data Recovery Appliance
    • Create a Backup Job with VMware Data Recovery
      1. Log in to vCenter using the VI Client (if you aren’t already)
      2. Select the View menu > select Solutions and Applications > VMware Data Recovery
      3. There are a few different ways you can create a new backup job, you can right-click on a vDatacenter, a cluster, a virtual machine or a template > select Add to Backup Job > New Backup Job…
      4. (this is the method I’ll use) You can also click on the Backup tab in the right-pane > right-click anywhere in the windows > select New
      5. The Backup Job Wizard opens > enter in a name for the backup job in the Name field – make this descriptive and meaningful > click Next
      6. Select which objects you want to backup by placing a checkbox next to it.  You can backup:
        1. All objects under vCenter
        2. All objects under a vDatacenter
        3. All objects under a Cluster
        4. Individual virtual machines with all associated virtual disks
        5. Individual virtual disks from a virtual machine
      7. After making your selection(s) click Next
      8. Select the destination location for the backup > click Next
      9. Set your backup window, this should be self-explanatory > click Next
      10. Select the Retention Policy you want to use (few, more, many or custom), setting any of the first three has pre-canned settings
        1. Few – retain 7 recent backups, retain 4 weekly backups, retain 3 monthly backups and retain 0 quarterly and yearly backups
        2. More – retain 7 recent backups, retain 8 weekly backups, retain 6 monthly backups, 4 quarterly backups  and 1 yearly backup
        3. More – retain 15 recent backups, retain 8 weekly backups, retain 3 monthly backups, 8 quarterly backups  and 3 yearly backup
        4. Custom – set your own
      11. Click Next > click Finish

  • Perform a test and live full/file-level restore with VMware Data Recovery
    • Perform a Test of a Full Restore with VMware Data Recovery
      1. Log in to vCenter using the VI Client
      2. Select the View menu > select Solutions and Applications > VMware Data Recovery
      3. Right-click on the virtual machine you want to test a full restore on > click Restore Rehearsal from Last Backup
      4. Ensure the virtual machine and virtual disks you want to test a full restore on > click Next
      5. If you need to provide alternate credentials click the Restore Credentials… hyperlink and enter in a different username and password
      6. You can change some options for the restore
        1. Datastore – select the datastore to use for the Virtual machine and select one for the virtual disk(s)
        2. Virtual Disk Node – specify the SCSI Bus you want to use
        3. Restore Configuration – select Yes or No
        4. Reconnect NIC – select Yes or No
        5. Power On – select Yes or No
      7. Click Next
      8. Click Restore
      9. Once complete a new VM is spawned and powered-on (hopefully you did not answer Yes to Reconnect NIC) and you can log in and check it out
      10. For some very strange reason, there is no “Done with Restore Rehearsal” option and you have to manually clean it up.  Once you are done testing, power off the rehearsal VM and delete it
    • Perform a Full Restore with VMware Data Recovery
      1. Log in to vCenter using the VI Client
      2. Select the View menu > select Solutions and Applications > VMware Data Recovery
      3. Click on the Restore tab in the right pane
      4. Click the Restore hyperlink
      5. Select the virtual machine you want to restore and select which backup you want to restore from
      6. Select the virtual disk(s) you want to restore > click Next
      7. If you need to provide alternate credentials click the Restore Credentials… hyperlink and enter in a different username and password
      8. The Datastore option will default to the datastore the disk was on before
      9. You can choose whether or not to power on the virtual machine by selecting Yes or No from the Power On column
      10. You can select the Virtual Disk Node for the disk(s) you are restoring
      11. Click Next
      12. Click Restore
    • Perform a File Level Restore with VMware Data Recovery (Windows VM)
      1. Log in to the virtual machine that requires the File Level Restore (FLR)
      2. Run the FLR client, VMwareRestoreClient.exe (as of this posting)
      3. Enter in the IP address or Name for the Data Recovery Appliance
      4. Click Login
      5. Select the virtual disk you want to restore from using the list of restore points
      6. Click the Mount button at the top left
      7. Once mounted click the Browse button
      8. This will open an explorer Window.  From here browse to the file(s) you want to restore and copy them back to the virtual machine
      9. Once complete unmount the restore point by clicking Unmount and close the FLR client
For instructions how to perform a FLR on a Linux VM take a look at pages 36-37 of the VMware Data Recovery Administration Guide
  • Determine appropriate backup solution for a given vSphere implementation
    • Every implementation is different and you can’t always do a cookie-cutter solution, especially when it comes to backups.  Right now VMware Data Recovery will backup individual virtual machines and files.
      • Data Recovery is not application aware and therefore some applications, such as Sharepoint and MS Exchange you may want a more granular level of backup, specific to those applications
      • If your vSphere implementation includes branch offices where some hosts/VMs traverse a WAN, you may not want to use data recovery
    • Bottom line is know your environment, know what your requirements and constraints are and know the capabilities of VMware Data Recovery to determine if it is a fit for your vSphere implementation

No comments:

Post a Comment