Automating Backup of Virtual Machines

From SEPsesam
Jump to: navigation, search
Other languages:
Deutsch • ‎English

Copyright © SEP AG 1999-2017. All rights reserved.

Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3 Tigon. For previous documentation version(s), check VMware archive.


Overview

SEP sesam lets you back up data that resides in VMware VMs. Until now, you had to create a separate backup task for each VM to perform backup. But as the number of virtual servers increases – in the dynamic environment new VMs are created and deleted every day – a manual backup task configuration becomes quite tedious and time consuming.

With SEP sesam 4.4.3 Tigon, you can automate backup of VMs by including VMs to task groups according to the selection filter and automating operation of creating backup tasks for VMs. Use this option whenever a new vCenter or ESXi host is added and there are a lot of new VMs present that need to be backed up.

New option Create VM tasks scans through vCenter Server host for available virtual machines and allows the administrator to create a task group based on selected filters. SEP sesam provides a script with functions that handle task creation and execution for VMs. A script execution can be configured to delete tasks assigned to non-existing VMs or remove the group-related tasks before creating a new one. Depending on the selection in GUI, only VMs without task(s) can be backed up or the previously assigned tasks get deleted before new are created.

Prerequisites

Prior to performing a backup, make sure you have completed the required steps to prepare the VMware environment for backing up:

Steps

When a new vCenter or ESXi host is added, you can automate backup of new VMs by creating a task group and generating a task for grouped VMs.

Creating a task group

  1. From Main Selection -> Tasks -> By Groups, click New task group. The New task group window opens.
  2. Enter the Group name, e.g., VM_01, and click OK.
  3. Task group VM.png


Your next steps will depend on the SEP sesam version you are using (Tigon v. 1 or 2). For details on SEP sesam versions, see SEP sesam Release Versions.

Selecting VMs for a task group in 4.4.3 Tigon v.2

  1. From Main Selection -> Tasks -> By Clients, right-click the vCenter client and select Manage VM tasks. A new window opens.
  2. Right-click-manage VM tasks.png

  3. From the Task Group drop-down list, select previously created task group. In the content pane, expand or collapse the following options to see all matching VMs displayed: VMs without task, VMs with task, VM tasks without existing VM. The list below the selection shows VMs and their attributes, e.g., operating system, client, hostsystem, datacenter, etc.
  4. Manage VM tasks window.png

  5. Backup as image: By default, this option is enabled and performs a FULL raw backup of VMDK without CBT. However, CBT is applied for subsequent differential and incremental backups. If Backup as Image is deselected, CBT is fully utilized. For details on how this affects the size of your backed up data, check VMware single file restore & instant recovery support matrix.
  6. Filter: Once you have selected the task group and backup type (as image or not), you can filter VMs to show only matches based on the following categories:
    • VM name contains and VM name does not contain: In both cases enter a part of the name you want to be included or excluded from your filter.
    • Datacenter: If you have multiple data centers, you can filter VMs accordingly.
    • Power State: Use the drop-down list to filter the VMs according to their current state: on (indicates that the virtual machine is active and functional) or off (the VM is shut down).
    • Operating System: Choose one or more guest operating system(s) by selecting the check box(es) before the OS and clicking OK to confirm.
    • Folder: Filter by specific folders.
    • Virtual App: Filter by vApps and the virtual machines they contain.
  7. Optionally, use Attributes to narrow the scope of displayed VMs. Use the Name drop-down list and/or Value.
  8. In the content pane, expand or collapse the following options to see all matching VMs displayed: VMs without task, VMs with task, VM tasks without existing VM.
    Information sign.png Note
    Each task group can hold multiple VMs that may be included in more groups and may have different tasks assigned to them. If the option VMs with tasks is selected while creating VM tasks, the group assignments for the respective tasks and the tasks themselves are deleted.
    Select or clear the check box before the option (or an individual VM) to include or exclude VMs for which the tasks will be created within the task group.
  9. Click Create command to generate the command, which will be used to preload a script for VM tasks generation. Select the generated command and copy it, then click Edit config file in the Create command dialog. In the new Edit Pre Task Group Interface window, select the line starting with # sm_cmd "dir", delete it and paste the generated command in the same line. For details on command description and its options, see the preloaded script for VM tasks generation below.
  10. Create command.png

  11. Click Apply to save your selection and add VMs to the task group. A message notifies you that the process of adding tasks was successful. Click OK.

Selecting VMs for a task group in 4.4.3 Tigon v.1

  1. From Main Selection -> Tasks -> By Clients, right-click the vCenter client and select Create VM tasks. A new window opens.
  2. Right-click-create VM tasks.png

  3. From the Task Group drop-down list, select previously created task group. Then select among the following options:
    • Backup as image: By default, this option is enabled and performs a FULL raw backup of VMDK without CBT. However, CBT is applied for subsequent differential and incremental backups. If Backup as Image is deselected, CBT is fully utilized. For details on how this affects the size of your backed up data, check VMware single file restore & instant recovery support matrix.
    • Search: Once you have selected the task group and backup type (as image or not), you can use the case-sensitive search to filter the VMs.
    • Optionally, use the Power State drop-down list to filter the VMs according to their current state. From the drop-down list, select On (indicates that the virtual machine is active and functional) or off (the VM is shut down).
    • From the Operating system drop-down list, choose one or more guest operating system(s) by selecting the check box(es) before the OS and clicking OK to confirm.

    Create VM tasks 02.png

  4. In the content pane, expand or collapse the following options to see all matching VMs displayed: VMs without task, VMs with task, VM tasks without existing VM.
    Information sign.png Note
    Each task group can hold multiple VMs that may be included in more groups and may have different tasks assigned to them. If the option VMs with tasks is selected while creating VM tasks, the group assignments for the respective tasks and the tasks themselves are deleted.
    Select or clear the check box before the option (or an individual VM) to include or exclude VMs for which the tasks will be created within the task group.
  5. Click Apply to save your selection and add VMs to the task group. A message notifies you that the process of adding tasks was successful. Click OK.

Generating VM tasks

This step is not required if you used Manage VM tasks option with Tigon v.2 and you have already copied the command to the Edit Pre Task Interface window.

  1. Switch back to the Tasks by Groups tab (Tasks -> By Groups) and select previously created task group. The included VMs are displayed below the task group. Right-click the task group and select Properties.
  2. In the properties window, two lists of tasks are shown. The list on the left is the list of all available tasks and the list on the right shows your newly created group of tasks. Click the Customize Task List button above the lists.
  3. Information sign.png Note
    Use the Customize Task List option whenever new VMs are created after the last backup was run. Uncommenting and saving the script triggers the tasks generation according to the specified parameters.

    VM task group properties.png

  4. In the Edit Pre-Task-Group Interface of client ... window, remove the # at the start of the line before the script sm_cmd "dir" in order to uncomment it.
  5. Pre-task-group interface.png
    The preloaded script for VM tasks generation is as follows:

    sm_cmd "dir" -F JSON "vsphere" -k 'Backup required=yes' /<vCenter_name>| sm_cmd add vspheretask "vsphere_{{client}}_{{source}}_{{count}}"  -t "VMWare vSphere" -O "remove_all" -G $1 -a refresh=true -T _IMG -o -f -
    

    where

    • <vCenter_name> is the case-sensitive name of the vCenter as defined in the SEP sesam environment
    • "vsphere_{{client}}_{{source}}_{{count}}" describes the name of the VM task, composed of the task type "vpshere_", followed by {{client}}_ which is the name of the vCenter, then {{source}}_which is the name of the VM (without special characters), then {{count}} which is used to define a unique task name if more than 50 characters for task are used and any other VM might have the same name
    • the following options specify the type of VMware backup: "-T _CONFIG" defines VM configuration backup, "-T _IMG" is the same as the GUI option Backup as image and is used by default, and "-T NONE" defines CBT FULL backup.
    • the following options can be set:
    • -G <group name>             #primary group
      -g group1[,group2]          #additional groups to add tasks into
      -k                          #search in the view of all VMs and utilize a quick sort based on attributes Backup required=yes
      -O remove_non_existing      #delete all tasks for VMs not existing anymore
      -O remove_all               #delete all tasks belonging to task group before creating new ones
      -O add_non_exiting          #create a task even if the VM does not exist
      -O remove_only              #delete all tasks for VMs not existing anymore, but do not add new tasks
      -a refresh=true
      
  6. Save any changes you made.

When a backup job for the group is started, tasks are performed concurrently on the drives if possible. Other tasks are dynamically assigned to the backup devices by SEP sesam. You can view the status of the whole task group by selecting Last backup state in the Main selection window. The backup status overview provides detailed information on the last run of backup jobs, including the task name, start and stop time of the last backup, backup type, data size, throughput, assigned media pool, etc.

See also

VMware BackupChanged Block Tracking (CBT)VMware requirements & restrictionsVMware single file restore & instant recovery support matrix