How To

This section contains quick start guides on how to perform complex scenarios with Veeam Backup & Replication REST API.

Mass Deployment

You can perform mass deployment of your backup infrastructure by using the Automation section of the REST API. The section includes methods that allow you to import and export resources in the JSON format. For example, you can use these methods to set up your backup infrastructure from a JSON specification or to migrate your infrastructure from one backup server to another.

The Automation section includes dedicated methods for individual resources, so you can export and import each resource type separately.

Exporting Resources

Exported resources do not include IDs. All credentials are exported with empty passwords, passphrases and private keys. Before you export resources that contain sensitive data, you can mark them by using tag parameters.

Importing Resources

As soon as you can import an entire collection of resources with one HTTP request, you may need to check the progress of the import operation. In response to your request, you receive a session. Within this session, Veeam Backup & Replication adds the specified objects to the backup infrastructure. To check the import progress, you can track the session state. For more information, see Tracking Import Operation.

To set up backup infrastructure using the automation methods, you must import resources in the following order:

  1. Credentials and encryption passwords
  2. Managed servers
  3. Backup repositories
  4. Backup proxies
  5. Backup jobs

Example

In this example, you will migrate the backup infrastructure from one backup server to another. You have a backup server backupserver01 on which a VMware vSphere infrastructure is deployed. It includes managed Microsoft Windows and Linux servers, backup repositories and backup proxies, and configured backup jobs. You need to migrate the infrastructure to another backup server backupserver02.

To migrate backup infrastructure from backupserver01 to backupserver02, take the following steps:

  1. To log in to backupserver01 and backupserver02, send the HTTP POST requests to the /api/oauth2/token paths. In response, you receive access and refresh tokens.
    For more information, see User Authorization.

  2. Export credentials records from backupserver01 with the Export Credentials request.
    In response, you receive an array of credential records. Each record contains empty values of sensitive parameters: passwords, passphrases and private keys.

  3. Import the credentials to backupserver02 with the Import Credentials request. In the request body, specify the imported credentials. Manually fill in passwords, passphrases and private keys.

  4. Export servers managed by backupserver01 with the Export Servers request.
    In response, you receive an array of servers. The array does not include backupserver01 itself — the server where Veeam Backup & Replication is installed.

  5. Import managed servers to backupserver02 with the Import Servers request. In the request body, specify the array of servers exported from backupserver01.
    In response, you receive an automation session. Within the session, the specified servers are added to the backupserver02 infrastructure. For more information on tracking the session state, see Tracking Import Operation.

  6. Export backup repositories from backupserver01 with the Export Repositories request. In response, you receive an array of backup repositories.

  7. Import backup repositories to backupserver02 with the Import Repositories request. In the request body, specify the repositories exported from backupserver01.
    In response, you receive an automation session. Within the session, the specified backup repositories are added to the backupserver02 infrastructure. For more information on tracking the session state, see Tracking Import Operation.

  8. If you use backup proxies and encryption keys in your backup jobs, migrate them similarly.

  9. Export backup jobs from backupserver01 with the Export Jobs request. In response, you receive an array of jobs.

  10. Import backup jobs to backupserver02 with the Import Jobs request. In the request body, specify the jobs imported from backupserver01.
    In response, you receive an automation session. Within the session, the specified backup jobs are created on backupserver02. For more information on tracking the session state, see Tracking Import Operation.

Tracking Import Operation

When you perform an import operation, you send the POST HTTP request. In response, you receive a session of the Automation type. Within this session, Veeam Backup & Replication adds new objects (for example, credentials, managed servers or backup jobs) to the infrastructure of the backup server. To check the import progress, track the session state. If the import fails, you can view debug logs for detailed information on each object.

For example, you import credentials records. In response, you receive an automation session. To track the session state, run the Get Automation Session request.

If some credential records are not imported, you can view debug logs for detailed information on each record. To do this, send the Get Automation Session Logs request.

Object Storage Repositories

With Veeam Backup & Replication REST API, you can add the following types of object storage repositories:

  • Microsoft Azure Blob storage, Microsoft Azure Archive storage, and Microsoft Azure Data Box storage
  • Amazon S3 storage, Amazon S3 Glacier storage, and AWS Snowball Edge storage
  • Google Cloud storage
  • S3 compatible storage
  • IBM Cloud storage
  • Wasabi Cloud storage
  • Veeam Data Cloud Vault (revision 1.3-rev0 and later)

To add an object storage repository, take the following steps:

  1. Add a cloud credentials record required for connection to the object storage repository. For details, see Add Cloud Credentials Record.
    In response, you receive a model of the created cloud credential record with its ID. Save the ID, you will require it later.
  2. Choose a location (cloud container and folder) that you want to map to a new object storage repository. Save folder names and container names.
    • To browse existing folders, send the Get Cloud Hierarchy request.
    • To create a new folder, send the Create New Cloud Storage Folder request. Note Veeam Backup & Replication REST API does not create new containers, you can create a folder inside an existing container only.
  3. Add a new object storage repository with the Add Repository requests.
    In the request body among other parameters, specify the following parameters obtained in the previous steps:
    • Cloud credentials required to connect to the object storage repository.
    • Cloud location you want to map to the object storage repository.

External Repositories

The REST API allows you to add external repositories to the backup infrastructure and manage them. An external repository is a read-only repository that stores backups created by Veeam Backup for AWS, Veeam Backup for Microsoft Azure and Veeam Backup for Google Cloud, including backups stored in Veeam Data Cloud Vault.

You can add the following types of external repositories:

Repository Type Description
AmazonS3External Amazon S3 storage
AmazonS3GlacierExternal Amazon S3 Glacier storage
AzureStorageExternal Microsoft Azure Blob storage
AzureArchiveStorageExternal Microsoft Azure Archive storage
GoogleCloudStorageExternal Google Cloud Storage
GoogleArchiveStorageExternal Google Cloud Archive storage
VeeamDataCloudVaultAwsExternal Veeam Data Cloud Vault for AWS
VeeamDataCloudVaultAzureExternal Veeam Data Cloud Vault for Microsoft Azure

When you add an external repository, the backup appliance (Veeam Backup for AWS, Microsoft Azure or Google Cloud) that you specify creates the repository in the cloud storage, and then Veeam Backup & Replication adds the repository to the backup server.

Adding External Repositories

To add an external repository, take the following steps:

  1. Get the access settings of the cloud storage:

    • [For Amazon S3, Microsoft Azure and Google Cloud repositories] To get the ID of the cloud credentials record used to access the object storage, run the Get All Cloud Credentials request. To add a new cloud credentials record, use the Add Cloud Credentials Record request.
    • [For Veeam Data Cloud Vault repositories] To get the vault ID, run the Get Cloud Hierarchy request for the VeeamDataCloudVault service type and save the vaultId value. Veeam Backup & Replication takes the storage settings from the vault and creates the credentials for the vault.
  2. [Optional] Choose the folder for the repository:

    • To get the folders that already contain Veeam Backup for AWS, Microsoft Azure or Google Cloud repository data, run the Get External Repository Folders request. In the request body, specify the credentials ID, the serviceType property with the AmazonS3, AzureBlob or GoogleCloud value, and the bucket or container. In response, you receive the folders array with the owner (owner) and the encryption (encryption) detected on each folder.
    • To create a folder, run the Create New External Repository Folder request. In the request body, specify the credentials ID, the service type, the bucket or container and the folder name (newFolderName). For an archive repository, specify the repository type in repositoryType. You can create a folder only in an existing bucket or container.

    If owner.isThisServer is false and owner.ownerType is VBR, another backup server owns the repository. To take over the repository, set the overwriteOwner query parameter to true when you add the repository.

  3. [Optional] To add another external repository on the same backup appliance, run the Get All External Repositories request and save the account.backupApplianceId value of a repository hosted on this appliance.

  4. To add the external repository, run the Add External Repository request. In the request body, specify the following settings:

    • Repository type (type) and name (name).
    • Account settings (account):
      • For Amazon S3, Microsoft Azure and Google Cloud repositories: the cloud credentials ID (credentialsId), the backup appliance ID (backupApplianceId) and the ID of the cloud account registered on the backup appliance (serviceAccountId). For Amazon S3 repositories, also specify the AWS region type (regionType). For Google Cloud repositories, also specify the Google Cloud project ID (projectId).
      • For Veeam Data Cloud Vault repositories: the vault ID (vaultId) and the backup appliance ID (backupApplianceId).
      • [Optional] Gateway server ID (gatewayServerId). If you do not specify the gateway server, Veeam Backup & Replication uses the backup server.
      • [For a backup appliance in full private mode] ID of the Amazon S3 VPC endpoint (s3VpcEndpointId).
    • Location of the repository: bucket for Amazon S3 and Google Cloud repositories, container for Microsoft Azure repositories, with the region ID, the bucket or container name and the folder name. For Veeam Data Cloud Vault repositories, specify only the folder name in folder.folderName. For Microsoft Azure repositories, to import backups that the backup appliance finds in a non-empty folder, set container.importIfFolderHasBackup to true.
    • [Optional] Encryption settings (encryption). To decrypt encrypted backups, set isEnabled to true and specify one of the following:
      • For backups encrypted with a password, the ID of the encryption password (encryptionPasswordId). To get the ID, run the Get All Encryption Passwords request.
      • For Amazon S3 backups encrypted with an AWS KMS key, the key ARN (kmsKeyId).
      • For Microsoft Azure backups encrypted with an Azure Key Vault key, set useKeyVaultEncryption to true and specify azureSubscriptionId, keyVaultId and keyVaultKeyUri.
    • [Optional] Mount server settings (mountServer).

    Veeam Backup & Replication detects whether immutability is enabled for the bucket or container and ignores the immutabilityEnabled values. In response, you receive a session. To track the session, use the Get Session request.

NOTE

The overwriteOwner query parameter is not supported when you add a Microsoft Azure or Google Cloud repository.

Managing External Repositories

You can perform the following operations with external repositories:

  • To get external repositories, run the Get All External Repositories or Get External Repository request.
  • To get the used space and status of external repositories, run the Get All External Repository States request. The status property contains one of the following values: Healthy, Unavailable, OutOfDate or Unknown.
  • To edit an external repository, get the repository with the Get External Repository request, change the settings and send them with the Edit External Repository request. The type property must match the type of the repository. You cannot change the location of the repository: the region, bucket, container, folder and vault. Veeam Backup & Replication ignores the settings that apply only when you add a repository, for example, backupApplianceId and serviceAccountId. In response, you receive a session. To track the session, use the Get Session request.
  • To synchronize the repository with the object storage and fetch newly created restore points, run the Rescan External Repository request. You cannot rescan an external repository of the archive tier. In response, you receive a session. To track the session, use the Get Session request.
  • If the repository status is OutOfDate, run the Upgrade External Repository request. Veeam Backup & Replication upgrades the components on the host, mount servers and gateway servers of the repository. In response, you receive a session. To track the session, use the Get Session request.
  • To remove an external repository from the backup infrastructure, run the Remove External Repository request. You cannot remove the repository while its backups are used by backup copy jobs or Instant Recovery sessions. In response, you receive a session. To track the session, use the Get Session request. If four-eyes authorization is enabled, Veeam Backup & Replication creates an approval request instead.

Storage Integration

The REST API allows you to add storage systems to the backup infrastructure, work with volumes and snapshots of the storage systems, and copy backups between deduplicating storage repositories.

Veeam Backup & Replication works with storage systems through storage plug-ins. A storage system added to the backup infrastructure is a storage host. During the rescan of a storage host, Veeam Backup & Replication discovers volumes and snapshots of the storage system.

NOTE

The REST API supports only storage systems that work through storage plug-ins built with the Universal Storage API framework and that have the ViBackup role enabled. Requests to storage hosts, volumes and snapshots of other storage systems fail, and these objects are not returned in the response.

Adding Storage Systems

To add a storage system, take the following steps:

  1. To get the ID of the storage plug-in, run the Get All Storage Plug-ins request. The response contains the storage plug-ins installed on the backup server.

  2. To get the ID of the credentials record used to connect to the storage system, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.

  3. [Optional] To get the volumes of the storage system before you add it, run the Get Infrastructure Volumes by Connection Settings request. In the query parameters, specify the storage plug-in ID (storagePluginId), the DNS name or IP address of the storage system (connectionPoint), the credentials ID (credentialsId) and the port (port). You can use the internalId, storageInternalId and name values of the returned volumes to include volumes in rescan or exclude them from rescan.

  4. [Optional] To get the IDs of mount servers and backup proxies, run the Get All Servers and Get All Proxies requests.

  5. To add the storage system, run the Add Storage Host request. In the request body, specify the following settings:

    • Storage plug-in ID (storagePluginId), DNS name or IP address of the storage system (connectionPoint) and credentials ID (credentialsId).
    • [Optional] TCP port (port). If you do not specify the port, Veeam Backup & Replication uses the default port of the storage plug-in.
    • Roles of the storage host (roles). The array must contain ViBackup. The supported roles depend on the storage plug-in.
    • Settings of the ViBackup role (viBackup):
      • protocols — storage protocols used for VMware vSphere backup. Specify at least one protocol.
      • [Optional] mountServers — mount servers used to access storage snapshots. You can specify one Microsoft Windows and one Linux mount server. To use the default mount servers, specify an empty array.
      • [Optional] proxyServers — IDs of backup proxies. To select backup proxies automatically, specify an empty array.
      • [Optional] volumesRescanMode — volume rescan mode. For details, see the table below.
      • [Optional] createNfsExportRulesAutomatically — if true, Veeam Backup & Replication creates NFS export rules automatically. The setting applies only if protocols contains Nfs and the storage plug-in supports it.

    In response, you receive a session. To track the session, use the Get Session request.

  6. To get the ID of the added storage host, run the Get All Storage Hosts request.

In the viBackup.volumesRescanMode property, specify one of the following volume rescan modes:

Volume Rescan Mode Description
Everything Veeam Backup & Replication rescans all volumes of the storage host. Do not specify includedVolumes and excludedVolumes.
IncludedOnly Veeam Backup & Replication rescans only the volumes specified in the includedVolumes array.
ExceptExcluded Veeam Backup & Replication rescans all volumes except the volumes specified in the excludedVolumes array.

Each entry of the includedVolumes and excludedVolumes arrays has one of the following types:

  • Volume — a volume of the storage system. Specify the volume ID (internalId) and, for hosts with multiple storage systems, the storage system ID (storageInternalId).
  • Wildcard — a name pattern. Specify the pattern in name. To substitute one or more characters, use the asterisk (*) character.

Managing Storage Hosts

You can perform the following operations with storage hosts:

  • To get storage hosts, run the Get All Storage Hosts or Get Storage Host request. To get storage hosts that use specific storage plug-ins, use the storagePluginIdFilter parameter. For child hosts, the response contains the ID of the parent host (parentId).
  • To edit a storage host, get the storage host with the Get Storage Host request, change the settings and send them with the Edit Storage Host request. You cannot change the id, storagePluginId and connectionPoint properties. Specify credentialsId in every request. If you omit description, port, roles or viBackup, these properties keep their current values. In response, you receive a session. To track the session, use the Get Session request.
  • To refresh the volumes and snapshots of a storage host, run the Rescan Storage Host request. In response, you receive a session. To track the session, use the Get Session request.
  • To remove a storage host from the backup infrastructure, run the Remove Storage Host request. To delete objects that Veeam Backup & Replication created on the storage system during backup and restore operations, set the cleanupHost query parameter to true. You cannot remove a child host. In response, you receive a session. To track the session, use the Get Session request.

Managing Volumes

You can perform the following operations with volumes discovered on storage hosts:

  • To get volumes, run the Get All Storage Volumes request. To get volumes of specific storage hosts, use the hostIdFilter parameter. The response contains the capacity of each volume (sizeBytes), the number of its snapshots (snapshotCount) and the date and time of the latest snapshot (lastSnapshotAt).
  • To rescan a specific volume instead of the whole storage host, run the Rescan Storage Volume request. In response, you receive a session. To track the session, use the Get Session request.

Managing Snapshots

A storage snapshot has one of the following types:

Snapshot Type Description
Regular Snapshot stored on the storage system.
Archived Snapshot moved to cold storage.
Unarchived Archived snapshot returned to the storage system.

You can perform the following operations with storage snapshots:

  • To get snapshots, run the Get All Storage Snapshots request. To get snapshots of specific volumes or types, use the volumeIdFilter and typeFilter parameters.
  • To get VMs contained in a snapshot, run the Get Storage Snapshot VMs request. For each VM, the response contains the ID of the restore point that represents the VM in the snapshot (restorePointId).
  • To create a snapshot of a volume, run the Create Storage Snapshot request. In the request body, specify the volume ID (volumeId). If you do not specify the snapshot name (name), Veeam Backup & Replication uses a name in the {volumeName}_SS_{N+1} format.
  • To delete a snapshot of any type, run the Delete Storage Snapshot request. To delete several snapshots of a volume, run the Delete Storage Snapshots request. In the request body, specify the snapshot IDs (snapshotIds). All snapshots must belong to the volume specified in the path.
  • To access the data of an archived snapshot, run the Unarchive Storage Snapshot request. Veeam Backup & Replication creates a copy of the snapshot on the storage system from which the snapshot was archived and keeps the copy until you delete it.
  • To refresh the metadata of a snapshot, run the Rescan Storage Snapshot request.

The requests that create, delete, unarchive and rescan snapshots return a session. To track the session, use the Get Session request.

Creating Storage Copy Jobs

A storage copy job copies backups from source deduplicating storage repositories to target deduplicating storage repositories. To create a storage copy job, take the following steps:

  1. To get the IDs of the source and target repositories, run the Get All Repositories request.
  2. To create the job, run the Create Job request. In the request body, specify the StorageCopy job type and the following settings:
    • Repository mappings (storageMappings). For each mapping, specify the source repository ID (sourceRepositoryId) and the target repository ID (targetRepositoryId). The mappings must meet the following requirements:
      • The source and target repositories are different repositories of the same type: both HPE StoreOnce or both Dell Data Domain.
      • A target scale-out backup repository uses the DataLocality placement policy.
      • The mappings do not duplicate each other or mappings of other storage copy jobs.
      • The mappings do not create circular references and do not write copies of the same backups to the same target repository.
    • [Optional] Maintenance settings (maintenance): health check of the most recent restore point (healthCheckEnabled) and retention of deleted source restore points in the target repository (keepSecondaryCopiesEnabled and keepSecondaryCopiesForDays).
    • [Optional] Schedule (schedule). If isEnabled is false, the job copies data continuously. If isEnabled is true, the job runs only within the backup window specified in backupWindow.
    • [Optional] Notification settings (notifications) and job scripts (scripts).
  3. [Optional] To start the job manually, run the Start Job request. The job must be enabled. To enable the job, use the Enable Job request. A storage copy job starts worker jobs and has no session of its own: in the response, the id property is set to 00000000-0000-0000-0000-000000000000. To track the run, use the jobIdFilter parameter of the Get All Sessions request.

To edit a storage copy job, get the job with the Get Job request, change the settings and send them with the Edit Job request. To get the states of storage copy jobs, run the Get All Job States request.

VMware vSphere Support

The REST API allows you to back up, replicate and restore VMware vSphere VMs, fail over to VMware vSphere replicas and fail back from them. For continuous data protection of VMware vSphere VMs, see Continuous Data Protection.

The REST API also supports VMware Cloud Director and VMware Cloud Foundation Automation servers. To add them, use the Add Server request with the CloudDirectorHost or VcfAutomation server type. To get the vCenter Servers that these servers use, run the Get vCenter Servers Attached to Cloud Director Server or Get vCenter Servers Managed by VCF Automation Server request. To back up VMware Cloud Director VMs, create a job of the CloudDirectorBackup type. To restore them, run the Restore Entire VMware Cloud Director VM request. To restore a VMware vSphere VM to a VCF Automation namespace, specify the namespace in the targetNamespace property of the Restore Entire VMware vSphere VM request.

Adding VMware vSphere Infrastructure

Adding Servers

You can add a vCenter Server or a standalone ESXi host. Both servers have the ViHost type.

To add a VMware vSphere server, take the following steps:

  1. To get the ID of the credentials record used to connect to the server, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request and specify the Standard credentials type.

  2. To get the TLS certificate of the server, run the Request TLS Certificate or SSH Fingerprint request. In the request body, specify the ViHost server type and the server name in serverName. If the certificate.isTrusted property is false, save the certificate.thumbprint value.

  3. To add the server, run the Add Server request. In the request body, specify the following settings:

    • Server type (type): ViHost.
    • DNS name or IP address of the server (name), description (description) and credentials ID (credentialsId).
    • [Optional] Port (port) and the thumbprint of the untrusted certificate saved in the previous step (certificateThumbprint).

    In response, you receive a session. To track the session, use the Get Session request.

Adding Backup Proxies

To add a VMware backup proxy, take the following steps:

  1. To get the ID of the Microsoft Windows or Linux server that you want to use as a backup proxy, run the Get All Servers request. To add a new server, use the Add Server request with the WindowsHost or LinuxHost server type.

  2. To add the backup proxy, run the Add Proxy request. In the request body, specify the following settings:

    • Proxy type (type): ViProxy.
    • Description (description) and server ID (server.hostId).
    • [Optional] Transport mode (server.transportMode): Auto, DirectAccess, VirtualAppliance or Network.
    • [Optional] Datastores that the backup proxy can access (server.connectedDatastores) and the maximum number of concurrent tasks (server.maxTaskCount).

    In response, you receive a session. To track the session, use the Get Session request.

Creating Backup Jobs

To create a VMware vSphere backup job, take the following steps:

  1. To get the server name, run the Get All VMware vSphere Servers request. Save the name value of the server.
  2. To get the objects that you want to back up, run the Get VMware vSphere Server Objects request. In the path, specify the server name. To get objects of a specific type or hierarchy, use the typeFilter and hierarchyTypeFilter query parameters. To search the infrastructure of all VMware vSphere servers, run the Get All Virtual Inventory request with the VSphere platform.
  3. [Optional] To back up only VMs that have all of the specified VMware vSphere tags, run the Construct VMware vSphere Tag Combination (Multitag) request. In the request body, specify the tags. All tags must belong to the same VMware vSphere server. In response, you receive an object of the Multitag type that you can add to the job.
  4. To get the ID of the target backup repository, run the Get All Repositories or Get All Scale-Out Backup Repositories request.
  5. To create the job, run the Create Job request. In the request body, specify the following settings:
    • Job type (type): VSphereBackup.
    • Job name (name) and description (description).
    • VMs and VM containers to back up (virtualMachines.includes) and, optionally, VMs, disks and templates to exclude (virtualMachines.excludes). Specify the objects as the inventory requests return them.
    • Backup repository ID (storage.backupRepositoryId), backup proxies (storage.backupProxies) and retention policy (storage.retentionPolicy).
    • [Optional] GFS retention policy (storage.gfsPolicy) and advanced job settings (storage.advancedSettings).
    • [Optional] Guest processing settings (guestProcessing) and job schedule (schedule).
  6. To start the job, run the Start Job request. In response, you receive a session. To track the session, use the Get Session request.

To edit the job, use the Edit Job request. To enable or disable the job, use the Enable Job or Disable Job request.

To create an incremental backup of a VM outside the job schedule, run the Start Quick Backup for VMware vSphere or VMware Cloud Director VM request. In the request body, specify the VM as the inventory requests return it. The VM must have a full restore point.

Creating Replication Jobs

To create a VMware vSphere replication job, take the following steps:

  1. To get the VMs that you want to replicate, run the Get VMware vSphere Server Objects request for the source server.
  2. To get the target host or cluster, resource pool, folder, datastore and networks, run the Get VMware vSphere Server Objects request for the target server.
  3. To get the ID of the backup repository that stores replica metadata, run the Get All Repositories request.
  4. To create the job, run the Create Job request. In the request body, specify the following settings:
    • Job type (type): VSphereReplica.
    • Job name (name) and description (description).
    • VMs and VM containers to replicate (virtualMachines.includes) and, optionally, objects to exclude (virtualMachines.excludes). To replicate VMs from backups, specify the BackupFiles source type and the repository IDs in virtualMachines.sourceRepositories.
    • Target host or cluster (destination.host) and, optionally, resource pool (destination.resourcePool), folder (destination.folder) and datastore (destination.datastore).
    • Metadata repository ID (jobSettings.metadataRepositoryId), replica name suffix (jobSettings.replicaNameSuffix) and number of restore points to keep (jobSettings.restorePointsToKeep).
    • Source and target backup proxies (dataTransfer.sourceProxies and dataTransfer.targetProxies).
    • [Optional] Network mapping rules (network), re-IP rules (reIp), replica seeding settings (seeding), guest processing settings (guestProcessing) and job schedule (schedule).
  5. To start the job, run the Start Job request. In response, you receive a session. To track the session, use the Get Session request.

You can perform the following operations with replicas:

  • To get replicas and their states, run the Get All Replicas or Get Replica request.
  • To get restore points of a replica, run the Get All Replica Restore Points request.
  • To rescan replicas, run the Rescan Replicas request.
  • To delete a replica, run the Delete Replica request. To keep the replica VM on the target infrastructure and remove only its record from the configuration database, set fromDB to true. You cannot delete a replica in the Failover or Failback state or while the replication job is running.

Restoring VMware vSphere Data

Restoring Entire VMs

You can perform the following types of entire VM restore:

Restore Type Description
OriginalLocation Veeam Backup & Replication restores the VM to its original location with initial VM settings.
Customized Veeam Backup & Replication restores the VM to a new location or to the original location with new settings.

To restore an entire VM, take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request. To get restore points of VMware vSphere VMs, set the platformNameFilter query parameter to VMware.

  2. [Customized restore] To get the target host, resource pool, folder, datastore and networks, run the Get VMware vSphere Server Objects request.

  3. To restore the VM, run the Restore Entire VMware vSphere VM request. In the request body, specify the restore type (type) and the restore point ID (restorePointId). To power on the VM after restore, set powerUp to true. For customized restore, also specify the target host (destinationHost) and, optionally, resource pool (resourcePool), datastore (datastore), folder (folder) and network (network) settings.

    In response, you receive a session. To track the session, use the Get Session request.

Performing Instant Recovery

You can perform the following types of Instant Recovery to VMware vSphere:

Restore Type Description
OriginalLocation Veeam Backup & Replication recovers the VM to its original location with initial VM settings.
Customized Veeam Backup & Replication recovers the VM to a new location or to the original location with new settings.
OtherPlatform Veeam Backup & Replication recovers a machine from a backup of another platform, such as a Veeam Agent backup or a backup of another hypervisor.

To perform Instant Recovery, take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request.

  2. [Customized and other platform recovery] To get the target host, resource pool, folder and datastore, run the Get VMware vSphere Server Objects request.

  3. To start Instant Recovery, run the Start Instant Recovery to VMware vSphere request. In the request body, specify the restore type (type), the restore point ID (restorePointId) and secure restore settings (secureRestore). For customized and other platform recovery, also specify the target location (destination) and datastore (datastore).

    In response, you receive a session. To track the session, use the Get Session request.

  4. To get the mount point ID, run the Get All Mount Points for Instant Recovery to VMware vSphere request. To get a single mount point, run the Get Mount Point for Instant Recovery to VMware vSphere request.

  5. Finalize Instant Recovery:

Performing Instant FCD Recovery

To recover VM disks and register them as first class disks (FCDs), take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request.

  2. To get the target cluster, run the Get VMware vSphere Server Objects request.

  3. To start Instant FCD Recovery, run the Start Instant FCD Recovery request. In the request body, specify the restore point ID (restorePointId), the target cluster (destinationCluster) and the disks to recover (disksMapping). For each disk, specify the disk name in the backup (nameInBackup), the name of the mounted VMDK file (mountedDiskName) and the FCD name (registeredFcdName).

    In response, you receive a session. To track the session, use the Get Session request.

  4. To get the mount point ID, run the Get All FCD Mount Points request. To get a single mount point, run the Get FCD Mount Point request.

  5. Finalize Instant FCD Recovery:

    • To move the disks to the production datastore, run the Start FCD Migration request. In the request body, specify the target datastore (targetDatastore) and, optionally, the disks (mountedDiskNames) and the storage policy (storagePolicy).
    • To remove the recovered disks, run the Stop FCD Publishing request.

Restoring Files and Folders

To restore guest OS files and folders from backups of VMware vSphere VMs, see File Restore.

Failing Over to Replicas

You can perform the following types of failover:

Request Description
Start Failover Veeam Backup & Replication fails over to the specified replica restore points.
Start Planned Failover Veeam Backup & Replication synchronizes the latest changes from the source VMs before switching over.

To fail over to replicas, take the following steps:

  1. To get the IDs of replicas, run the Get All Replicas request. Snapshot replicas have the Snapshot type. The replica must not be in the Failover, PermanentFailover, Failback or ReadyToSwitch state, and the replication job must not be running.

  2. To get the IDs of the replica restore points, run the Get All Replica Restore Points request.

  3. To start failover, run the Start Failover or Start Planned Failover request. In the request body, specify the replica restore point IDs (replicaPointIds).

    In response, you receive an array of sessions. To track a session, use the Get Session request. After failover, the replica is in the Failover state.

  4. Finalize failover:

Failing Back from Replicas

You can fail back from replicas that are in the Failover state.

To fail back from replicas, take the following steps:

  1. [For failback to a different location] To get the target VM, host, resource pool, folder, datastores and networks, run the Get VMware vSphere Server Objects request.

  2. To start failback, run the Start Failback request. In the restorePointFailbackItems array of the request body, specify the replica restore point ID (replicaPointId) and the failback settings (settings) for each replica. In settings.type, specify one of the following failback types:

    Failback Type Description
    OriginalLocation Failback to the original VM that resides in the original location.
    OriginalVM Failback to the original VM that was restored to a different location. Specify the VM in destinationVM.
    Customized Failback to a custom location. Specify the location settings, such as the target host (destinationHost), resource pool (resourcePool) and datastore (datastore).

    In settings.failbackMode, specify how to switch over to production: Auto, Scheduled or Manual. To specify backup proxies and other general failback settings, use generalSettings. In response, you receive an array of sessions. To track a session, use the Get Session request.

  3. [For the Scheduled and Manual failback modes] Manage switchover to production. The replica must be in the ReadyToSwitch state.

    • To get the switchover settings of a replica, run the Get Replica Switchover Settings request.
    • To change the switchover time, run the Change Switchover Time request. In the request body, specify the replica restore point IDs (replicaPointIds) and the switchover mode (failbackMode): Scheduled with the switchover time in scheduledTime, or Manual.
    • To switch over to production manually, run the Switch over to Production request.
  4. Finalize failback:

    • If production VMs work as expected, run the Commit Failback request. The replica must be in the Failback state.
    • If production VMs do not work as expected, run the Undo Failback request. The replica must be in the ReadyToSwitch or Failback state.

Microsoft Hyper-V Support

The REST API allows you to back up and restore Microsoft Hyper-V VMs. The REST API does not support replication of Microsoft Hyper-V VMs.

Adding Microsoft Hyper-V Infrastructure

Adding Microsoft Hyper-V Servers

You can add the following types of Microsoft Hyper-V servers:

Type Description
HvServer Microsoft Hyper-V standalone server
HvCluster Microsoft Hyper-V cluster
SCVMM Microsoft SCVMM server
SmbV3StandaloneHost Microsoft SMB3 standalone server
SmbV3Cluster Microsoft SMB3 cluster

To add a Microsoft Hyper-V server, take the following steps:

  1. To get the ID of the credentials record used to connect to the server, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.

  2. To add the server, run the Add Server request. In the request body, specify the server type (type), the DNS name or IP address of the server (name), the description (description) and the credentials ID (credentialsId).

    In response, you receive a session. To track the session, use the Get Session request.

To add a Microsoft Hyper-V cluster with specific Microsoft Hyper-V hosts, take the following steps:

  1. To get the ID of the credentials record used to connect to the cluster, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.
  2. To get the hosts of the cluster, run the Get Microsoft Hyper-V Servers Managed by Microsoft Hyper-V Cluster or SCVMM Server request. In the request body, specify the credentials ID (credentialsId) and the cluster name (hvClusterName).
  3. To add the cluster, run the Add Server request. In the request body, specify the HvCluster server type and the hosts that you want to add (hvServers). If you do not specify hvServers, Veeam Backup & Replication adds all hosts of the cluster.

To add an SCVMM server with specific Microsoft Hyper-V hosts, take the following steps:

  1. To get the ID of the credentials record used to connect to the SCVMM server, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.
  2. To add the SCVMM server without hosts, run the Add Server request. In the request body, specify the SCVMM server type and set addAllServers to false.
  3. To get the hosts managed by the SCVMM server, run the Get Microsoft Hyper-V Servers Managed by Microsoft Hyper-V Cluster or SCVMM Server request. In the request body, specify the credentials ID (credentialsId) and the SCVMM server ID (scvmmHostId).
  4. To add the hosts, run the Edit Server request for the SCVMM server.

To manage volume settings of a Microsoft Hyper-V standalone server, run the Get Volumes for Microsoft Hyper-V Standalone Server and Edit Volumes on Microsoft Hyper-V Standalone Server requests. You can turn changed block tracking (changedBlockTracking) on or off and specify volume snapshot settings.

Adding Off-Host Backup Proxies

An off-host backup proxy processes backup data instead of the production Microsoft Hyper-V host. To add an off-host backup proxy, take the following steps:

  1. To get the ID of the Microsoft Windows server that you want to use as an off-host backup proxy, run the Get All Servers request.

  2. To add the backup proxy, run the Add Proxy request. In the request body, specify the HvProxy proxy type, the description (description), the server ID (server.hostId) and, optionally, the maximum number of concurrent tasks (server.maxTaskCount).

    In response, you receive a session. To track the session, use the Get Session request.

Creating Backup Jobs

To create a Microsoft Hyper-V backup job, take the following steps:

  1. To get the server name, run the Get All Servers request. Save the hostName value of the server.
  2. To get the objects that you want to back up, run the Get Inventory Objects request. In the path, specify the hostName value of the server. To get objects of a specific hierarchy, specify hierarchyType in the request body: HostsAndVms, HostsAndVolumes, Groups, Tags or Network.
  3. To get the ID of the target backup repository, run the Get All Repositories or Get All Scale-Out Backup Repositories request.
  4. To create the job, run the Create Job request. In the request body, specify the following settings:
    • Job type (type): HyperVBackup.
    • Job name (name) and description (description).
    • VMs and VM containers to back up (virtualMachines.includes) and, optionally, objects to exclude (virtualMachines.excludes). Specify the objects as the Get Inventory Objects request returns them.
    • Backup repository ID (storage.backupRepositoryId), backup proxies (storage.backupProxies) and retention policy (storage.retentionPolicy).
    • [Optional] Guest processing settings (guestProcessing) and job schedule (schedule).
  5. To start the job, run the Start Job request. In response, you receive a session. To track the session, use the Get Session request.

To edit the job, use the Edit Job request. To enable or disable the job, use the Enable Job or Disable Job request.

To create an incremental backup of a VM outside the job schedule, run the Start Quick Backup for Hyper-V VM request. In the request body, specify the VM as the Get Inventory Objects request returns it. The VM must have a full restore point.

Recovering Microsoft Hyper-V Data

Restoring Entire VMs

You can perform the following types of entire VM restore:

Restore Type Description
OriginalLocation Veeam Backup & Replication restores the VM to its original location with initial VM settings.
Customized Veeam Backup & Replication restores the VM to a new location or to the original location with new settings.

To restore an entire VM, take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request. To get restore points of Microsoft Hyper-V VMs, set the platformNameFilter query parameter to HyperV.

  2. [Customized restore] To get the target host and networks, run the Get Inventory Objects request.

  3. To restore the VM, run the Restore Entire Microsoft Hyper-V VM request. In the request body, specify the restore type (type) and the restore point ID (restorePointId). To power on the VM after restore, set powerUp to true. For customized restore, also specify the target host (destinationHost) and, optionally, datastore (datastore), network (network) and VM name (target) settings.

    In response, you receive a session. To track the session, use the Get Session request.

Performing Instant Recovery

You can perform the following types of Instant Recovery to Microsoft Hyper-V:

Restore Type Description
OriginalLocation Veeam Backup & Replication recovers the VM to its original location with initial VM settings.
Customized Veeam Backup & Replication recovers the VM to a new location or to the original location with new settings.
OtherPlatform Veeam Backup & Replication recovers a machine from a backup of another platform, such as a Veeam Agent backup or a backup of another hypervisor.

To perform Instant Recovery, take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request.

  2. [Customized and other platform recovery] To get the target host, run the Get Inventory Objects request.

  3. To start Instant Recovery, run the Start Instant Recovery to Microsoft Hyper-V request. In the request body, specify the restore type (type) and the restore point ID (restorePointId). For customized and other platform recovery, also specify the target host (destinationHost) and, optionally, datastore (datastore), network (network) and VM name (target) settings.

    In response, you receive a session. To track the session, use the Get Session request.

  4. To get the mount point ID, run the Get All Mount Points for Instant Recovery to Microsoft Hyper-V request. To get a single mount point, run the Get Mount Point for Instant Recovery to Microsoft Hyper-V request.

  5. Finalize Instant Recovery:

Restoring Files and Folders

To restore guest OS files and folders from backups of Microsoft Hyper-V VMs, see File Restore.

Red Hat OpenStack and Virtuozzo Support

The REST API allows you to add Red Hat OpenStack and Virtuozzo servers to the backup infrastructure, back up VMs and restore entire VMs.

Both platforms use the same requests. In the request body, specify the type of the platform:

Object Red Hat OpenStack Virtuozzo
Server (type) RedHatOpenStackServer VirtuozzoServer
Worker (type) RedHatOpenStack Virtuozzo
Inventory object (platform) RedHatOpenStack Virtuozzo
Backup job (type) RedHatOpenStackBackupJob VirtuozzoBackupJob
Restore point (platformNameFilter) RedHatOpenStack Virtuozzo
Restore (type) RedHatOpenStackOriginalLocation, RedHatOpenStackCustomized VirtuozzoOriginalLocation, VirtuozzoCustomized

Adding Servers

To add a Red Hat OpenStack or Virtuozzo server, take the following steps:

  1. To get the ID of the credentials record used to connect to the server, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request and specify the Standard credentials type.

  2. To get the TLS certificate of the Keystone endpoint, run the Request TLS Certificate or SSH Fingerprint request. In the request body, specify the server type, the Keystone endpoint URL in serverName and the credentials ID in credentialsId. Do not specify port: specify the port in the Keystone endpoint URL. If the certificate.isTrusted property is false, save the certificate.thumbprint value.

  3. To get the TLS certificates of the regional service endpoints, run the Request Regional Service Endpoint Certificates request. In the request body, specify the server type, the Keystone endpoint URL in name, the credentials ID in credentialsId and, for an untrusted Keystone certificate, the Keystone certificate thumbprint in certificateThumbprint. In response, you receive the certificates array with the certificates of the Keystone endpoint and the regional endpoints. Save the thumbprint values of the certificates whose isTrusted property is false.

    NOTE

    If the Keystone certificate is not trusted and you do not specify its thumbprint, the request fails and Veeam Backup & Replication does not send the credentials.

  4. To add the server, run the Add Server request. In the request body, specify the following settings:

    • Server type (type): RedHatOpenStackServer or VirtuozzoServer.
    • Keystone endpoint URL (name), description (description) and credentials ID (credentialsId).
    • Thumbprints of the untrusted certificates saved in the previous steps, including the Keystone certificate (certificateThumbprints).

    In response, you receive a session. To track the session, use the Get Session request.

You can perform the following operations with added servers:

  • To edit a server, get the server with the Get Server request, change the settings and send them with the Edit Server request. You can change the description and the credentials ID. You cannot change the server name.
  • To rescan a server, run the Rescan Managed Server request.

The requests return a session. To track the session, use the Get Session request.

Adding Workers

A worker is a VM that processes backup and restore operations in the Red Hat OpenStack or Virtuozzo environment. To manage workers, use the requests of the Proxies section.

To add a worker, take the following steps:

  1. To get the server ID and name, run the Get All Servers request. Save the objectId and hostName values of the server.

  2. To get the objects used to place the worker, run the Get Inventory Objects request. In the path, specify the hostName value of the server. Save the objectId values of the Region, Project, StorageContainer, Network and SecurityGroup objects and, for worker affinity, of the AvailabilityZone or Host object.

  3. To add the worker, run the Add Proxy request. In the request body, specify the following settings:

    • Worker type (type): RedHatOpenStack or Virtuozzo.
    • Worker name (worker.name) and server ID (worker.clusterId).
    • [Optional] IDs of the region, project and storage container where the worker is deployed (worker.regionId, worker.projectId and worker.storageContainerId).
    • Network settings (worker.networkSettings). For each network interface in the networks array, specify the network ID (networkId) and, optionally, the floating IP network (floatingIpNetworkId), security groups (securityGroupIds) and IP address settings.
    • [Optional] Worker resources (worker.maxConcurrentTasks, worker.cpuCount and worker.memoryGb).
    • [Optional] Worker affinity (worker.affinitySettings). Specify either the availability zone (availabilityZone) or the host ID (hostId).
    • [Optional] To deploy the worker VM right after the worker is added, set startTestSession to true.

    In response, you receive a session. To track the session, use the Get Session request.

  4. [If startTestSession is false] To deploy the worker VM, run the Test Worker request. Veeam Backup & Replication deploys the worker VM, uploads the worker image if needed, checks the connection and brings the worker online. In response, you receive a session. To track the session, use the Get Session request.

You can perform the following operations with added workers:

  • To get workers, run the Get All Proxies request. To get only workers, set the typeFilter query parameter to RedHatOpenStack or Virtuozzo. The status property shows the current worker status.
  • To edit a worker, get the worker with the Get Proxy request, change the settings and send them with the Edit Proxy request. The name property must match worker.name. If you omit floatingIpNetworkId for a network interface, Veeam Backup & Replication removes the floating IP address of the interface. In response, you receive a session.
  • To enable or disable a worker, run the Enable Proxy or Disable Proxy request.
  • To remove a worker, run the Remove Proxy request. In response, you receive a session.

Creating Backup Jobs

To create a backup job, take the following steps:

  1. To get the server name, run the Get All Servers request. Save the hostName value of the server.

  2. To get the objects that you want to back up, run the Get Inventory Objects request. In the path, specify the hostName value of the server. You can add objects of the following types to the job: OpenStack (entire server), Domain, Project, Region, Tag and VirtualMachine.

    NOTE

    Objects of the AvailabilityZone, Host, Network, StorageContainer, Flavor and SecurityGroup types cannot be added to backup jobs.

  3. To get the ID of the target backup repository, run the Get All Repositories or Get All Scale-Out Backup Repositories request.

  4. To create the job, run the Create Job request. In the request body, specify the following settings:

    • Job type (type): RedHatOpenStackBackupJob or VirtuozzoBackupJob.
    • Job name (name) and description (description).
    • Objects to back up (objects.includes) and, optionally, objects to exclude (objects.excludes). Specify the objects as the Get Inventory Objects request returns them.
    • Backup repository ID (storage.backupRepositoryId) and retention policy of the RestorePoints or Days type (storage.retentionPolicy).
    • [Optional] GFS retention policy (storage.gfsPolicy), active full and synthetic full backup settings (storage.activeFull and storage.syntheticFull) and health check settings (storage.healthCheck).
    • [Optional] Compression level and storage optimization (advancedSettings) and job schedule (schedule).
  5. To start the job, run the Start Job request. To create an active full backup, set performActiveFull to true in the request body. In response, you receive a session. To track the session, use the Get Session request.

To edit the job, use the Edit Job request. To enable or disable the job, use the Enable Job or Disable Job request.

Restoring Entire VMs

You can perform the following types of entire VM restore:

Restore Type Description
RedHatOpenStackOriginalLocation, VirtuozzoOriginalLocation Veeam Backup & Replication restores the VM to its original location with initial VM settings. The restore point must be of the same platform.
RedHatOpenStackCustomized, VirtuozzoCustomized Veeam Backup & Replication restores the VM to a new location or to the original location with new settings.

To restore an entire VM, take the following steps:

  1. To get the ID of the restore point, run the Get All Restore Points request. To get restore points of one platform, set the platformNameFilter query parameter to RedHatOpenStack or Virtuozzo.

  2. [Customized restore] To get the disks of the restore point, run the Get Restore Point Disks request. Save the uid value of each disk.

  3. [Customized restore] To get the target objects, run the Get All Servers request to get the target server, and the Get Inventory Objects request for the target server to get the Project, Region, AvailabilityZone, Flavor, StorageContainer, Network and SecurityGroup objects. The availability zone and the Network, SecurityGroup, Flavor and StorageContainer objects must belong to the target region.

  4. To restore the VM, run the Restore Entire VM to a Platform Plug-in Server request. In the request body, specify the restore type (type) and the restore point ID (restorePointId). To power on the VM after restore, set powerUp to true.
    For customized restore, also specify the following settings. Specify the objects as the Get Inventory Objects request returns them.

    • Target server (targetServer), project (project) and region (region).
    • Target storage container for each disk of the restore point (diskSettings). For each disk, specify the disk UID (diskUid) and a StorageContainer object (storageContainer).
    • [Optional] VM name (vmName) and availability zone (availabilityZone).
    • [Optional] Flavor (flavor). The flavor is required if the restore point is not of the target platform.
    • [Optional] Network mappings (network.mappings). For each network adapter, specify the MAC address of the source adapter (originalMacAddress), the target network (network) and, optionally, security groups (securityGroups) and floating IP settings (floatingIpNetwork and floatingIp). Veeam Backup & Replication does not connect source adapters that are not listed to a network.

    In response, you receive a session. To track the session, use the Get Session request.

Continuous Data Protection

The REST API allows you to create continuous data protection (CDP) policies, fail over to CDP replicas and fail back from CDP replicas.

You can create the following types of CDP policies:

CDP Policy Type Description
VSphereCdpPolicy VMware vSphere CDP policy, which replicates VMware vSphere VMs.
WindowsUniversalCdpPolicy Universal CDP policy, which replicates Microsoft Windows machines with the Veeam CDP Agent installed.
LinuxUniversalCdpPolicy Universal CDP policy, which replicates Linux machines with the Veeam CDP Agent installed.

Both VMware vSphere and Universal CDP policies create replicas on VMware vSphere hosts. Before you create a CDP policy, configure the CDP infrastructure:

Adding CDP Proxies

To add a CDP proxy, take the following steps:

  1. To get the ID of the server that will act as the CDP proxy, run the Get All Servers request. To add a new server, use the Add Server request.

  2. To add the CDP proxy, use the Add Proxy request. In the request body, specify the following settings:

    • CdpProxy proxy type (type).
    • Server ID (server.hostId).
    • [Optional] Ports that the CDP proxy uses to transfer data on the source side (server.hostTrafficPort) and on the target side (server.daemonTrafficPort). The ports must be different.
    • [Optional] Cache folder and maximum cache size (cache). If you omit cache, Veeam Backup & Replication uses the default cache settings.

    In response, you receive a session. To track the session, use the Get Session request.

  3. To get CDP proxies, run the Get All Proxies request with the typeFilter query parameter set to CdpProxy. To edit a CDP proxy, use the Edit Proxy request.

NOTE

You cannot create a Universal CDP policy if no CDP proxy is added to the backup infrastructure.

Installing CDP I/O Filters

VMware vSphere CDP policies replicate VMs that reside on VMware vSphere clusters with the CDP I/O filter installed. To install the CDP I/O filter, take the following steps:

  1. To get the ID of the vCenter Server, run the Get All Servers request.

  2. To get the CDP I/O filter status of the vCenter Server clusters, run the Get CDP I/O Filter Status for Clusters request. For each cluster, the response contains the managed object reference ID of the cluster (clusterRef), the filter status (isInstalled and isUpToDate) and the actions that you can perform on the filter (allowedActions).

  3. To install, upgrade or uninstall the filter, run the Manage CDP I/O Filters on Clusters request. In the clusters array of the request body, specify the clusterRef value of each cluster and one of the actions returned in allowedActions:

    • Install — installs the filter. If the filter is installed but out of date, the action upgrades the filter.
    • Uninstall — uninstalls the filter.
    • ClaimOwnership — upgrades the filter and transfers filter ownership to this backup server. Use this action instead of Install if another backup server manages the filter (isAnotherCoordinatorHost is true).

    In response, you receive a session. To track the session, use the Get Session request.

NOTE

If some VMs of a VMware vSphere CDP policy reside on clusters without the CDP I/O filter, you cannot create or edit the policy.

Installing Veeam CDP Agent

Universal CDP policies replicate machines discovered in protection groups with the Veeam CDP Agent installed. You can install the Veeam CDP Agent on machines of protection groups of the IndividualComputers, ADObjects and CSVFile types.

To install the Veeam CDP Agent, take the following steps:

  1. To deploy the Veeam CDP Agent to discovered computers automatically, set the options.installCDPAgent property to true when you add or edit a protection group. Use the Add Protection Group or Edit Protection Group request. To upgrade agents on discovered computers automatically, set options.updateAutomatically to true. For details on protection groups, see Veeam Agent Management.

  2. To get the IDs of discovered computers and the status of the Veeam CDP components, run the Get Discovered Entities request. The response contains the following properties:

    • cdpAgentStatus and cdpAgentVersion — status and version of the Veeam CDP Agent.
    • cdpFilterStatus and cdpFilterVersion — status and version of the Veeam CDP filter driver.
  3. To manage the Veeam CDP Agent on specific discovered computers, use the following requests. In the entityIds array of the request body, specify the IDs of discovered computers.

    In response, you receive a session. To track the session, use the Get Session request.

Creating CDP Policies

To create a VMware vSphere CDP policy, take the following steps:

  1. To get the VMs and VM containers that you want to replicate, and the target host, resource pool, folder, datastore and networks, run the Get Inventory Objects request.
  2. To get the IDs of CDP proxies, run the Get All Proxies request with the typeFilter query parameter set to CdpProxy.
  3. To create the policy, use the Create Job request. In the request body, specify the VSphereCdpPolicy job type and the following settings:
    • VMs and VM containers to replicate (virtualMachines).
    • Replica destination (destination): target host or cluster, resource pool, folder and datastore.
    • Source and target CDP proxies (policySettings.sourceProxies and policySettings.targetProxies). To let Veeam Backup & Replication select CDP proxies automatically, set autoSelectEnabled to true.
    • RPO and retention settings (schedule): how often Veeam Backup & Replication creates short-term restore points (rpoOptions), how long Veeam Backup & Replication keeps short-term restore points (shortTermRetention) and the schedule of long-term restore points (longTermRetention).
    • [Optional] Network mapping rules (network), re-IP rules (reIp) and replica seeding settings (seeding).
    • [Optional] Guest processing settings (guestProcessing). If you enable application-aware processing, the long-term retention schedule (schedule.longTermRetention.schedule) must contain at least one hour of application-consistent restore points (value 2).

To create a Universal CDP policy, take the following steps:

  1. Install the Veeam CDP Agent on the machines that you want to replicate. For details, see Installing Veeam CDP Agent.
  2. To get the protection groups and discovered computers that you want to replicate, run the Get All Protection Groups or Get Inventory Objects for Specific Protection Group request.
  3. To get the target host, resource pool, folder, datastore and networks on the VMware vSphere site, run the Get Inventory Objects request.
  4. [For network mapping of specific network adapters] To get the network adapters of a discovered computer, run the Get Discovered Computer Network Adapters request. Save the macAddress value of the adapter.
  5. To create the policy, use the Create Job request. In the request body, specify the WindowsUniversalCdpPolicy or LinuxUniversalCdpPolicy job type and the following settings:
    • Protection groups and discovered computers to replicate (machines.includes) and discovered computers to exclude (machines.excludes). The operating system of the computers must match the policy type. A computer can be protected by only one CDP policy.

    • Replica destination (destination): the VSphere destination type, target host or cluster, resource pool, folder and datastore. To specify placement settings for individual replica VMs, use destination.mappingRules.

    • [Optional] Network mapping rules (networkMapping). In each rule, specify the target network (targetNetwork) and the source networks (source):

      • DiscoveredComputer source type — all networks of the discovered computer specified in machine.
      • PhysicalAdapter source type — the network adapter with the MAC address specified in macAddress.

      A rule without source is the default rule for all source networks that do not match other rules. A policy can have only one default rule.

    • Source and target CDP proxies (policySettings), RPO and retention settings (schedule) and, optionally, re-IP rules (reIp), replica seeding settings (seeding) and guest processing settings (guestProcessing), as for VMware vSphere CDP policies.

Managing CDP Policies

You can perform the following operations with CDP policies:

  • To get CDP policies, run the Get All Jobs or Get Job request.
  • To edit a CDP policy, get the policy with the Get Job request, change the settings and send them with the Edit Job request. Note the following limitations:
    • You cannot change the type of a Universal CDP policy.
    • You cannot change the target resource pool, folder or datastore if CDP replicas or sessions that process them exist. You cannot change the target host or cluster while CDP replication processes it.
    • You cannot change replica mapping for a source after the replica is created for it.
  • To enable or disable a CDP policy, run the Enable Job or Disable Job request. To enable or disable a Universal CDP policy, use only these requests: you cannot change the isDisabled value with the Edit Job request.
  • To delete a CDP policy, disable the policy with the Disable Job request and run the Delete Job request. You cannot delete an enabled CDP policy.
  • To delete a CDP replica, run the Delete Replica request. To keep the replica VM on the target host and delete only the replica record from the configuration database, set the fromDB query parameter to true. In response, you receive a session. To track the session, use the Get Session request.

Failing Over to CDP Replicas

To fail over to CDP replicas, take the following steps:

  1. To get the IDs of CDP replicas, run the Get All Replicas request. CDP replicas have the CDP type.

  2. [For failover to a specific restore point] Choose the restore point:

  3. To start failover, run the Start CDP Replica Failover request. In the restorePoints array of the request body, specify the replica ID (replicaId) and the restore point type (type) for each replica:

    Restore Point Type Description
    LatestCrashConsistent Latest crash-consistent restore point.
    LatestAppConsistent Latest application-consistent restore point.
    Custom Restore point specified in the longTermRestorePointId or toPointInTime property. Specify only one of these properties.

    In response, you receive an array of sessions. To track a session, use the Get Session request.

  4. Finalize failover:

To start planned failover, run the Start CDP Replica Planned Failover request. In the request body, specify the replica IDs (replicaIds). Planned failover is available for VMware vSphere CDP and Universal CDP replicas. The source CDP policy must exist and be enabled, and the replica must have no more than 94 restore points. Planned failover synchronizes the latest changes from the source VMs before switching over.

Failing Back from CDP Replicas

To fail back from CDP replicas, take the following steps:

  1. [For failback to a different location] To get the target VM, host, resource pool, folder, datastores and networks, run the Get Inventory Objects request.

  2. To start failback, run the Start CDP Replica Failback request. In the cdpReplicaFailbackItems array of the request body, specify the replica ID (replicaId) and the failback settings (settings) for each replica. In settings.type, specify one of the following failback types:

    Failback Type Description
    OriginalLocation Failback to the original VM that resides in the original location.
    OriginalVM Failback to the original VM that was restored to a different location. Specify the VM in destinationVM.
    Customized Failback to a custom location. Specify the location settings, such as the target host (destinationHost), resource pool (resourcePool) and datastore (datastore).

    In settings.failbackMode, specify how to switch over to production: Auto, Scheduled or Manual. To specify backup proxies and other general failback settings, use generalSettings. In response, you receive an array of sessions. To track a session, use the Get Session request.

    NOTE

    Universal CDP replicas support only the Customized failback type. You must specify the target host in destinationHost.

  3. [For the Scheduled and Manual failback modes] Manage switchover to production:

  4. Finalize failback:

Microsoft Entra ID Support

The REST API allows you to back up and restore entire Microsoft Entra ID items (users, groups, administrative units, applications and roles) and item properties, as well as audit and sign-in logs.

Adding Microsoft Entra ID Tenant

Before you can back up Microsoft Entra ID data, you must add a Microsoft Entra ID tenant to your backup infrastructure. When adding a Microsoft Entra ID tenant, you must specify an existing Microsoft Entra ID app registration or let Veeam Backup & Replication create a new one.
If you choose to create a new app registration, you must generate a verification code and register the new application before you start adding a tenant:

  1. To generate a code, use the Get Microsoft Entra ID Verification Code request.
  2. To register the new application, use the Register Microsoft Entra ID Application request.
    To add a tenant, use the Add Microsoft Entra ID Tenant request.

Creating Backup Jobs

You can create the following types of backup jobs:

Backup Job Type Description
EntraIDTenantBackup Microsoft Entra ID tenant backup job, which backs up tenant items such as users, groups, administrative units, applications and roles.
EntraIDAuditLogBackup Microsoft Entra ID audit log backup job, which backs up Microsoft Entra ID audit and sign-in logs.

To create a backup job, use the Create Job request. In the request body, specify a job type and other job settings.
To enable backup of Conditional Access policies, add the following registry key:

New-ItemProperty -Path "HKLM:SOFTWARE\Veeam\Veeam Backup and Replication" -Name "EntraIdBackupSupportsConditionalAccessPolicyRestore" -Value "1" -PropertyType DWORD -Force

Additionally, make sure that the Microsoft Entra application used for tenant backup and restore has the required permissions. For details, see the Considerations and Limitations section of the Veeam Backup & Replication User Guide.

Restoring Microsoft Entra ID Items and Logs

Restoring Microsoft Entra ID Items and Item Properties

To restore entire Microsoft Entra ID items or item properties, take the following steps:

  1. To get a backup ID of the Microsoft Entra ID tenant backup that you want to use for restore, send the Get All Backups request.
  2. To start a mount session and mount the tenant backup to the mount point, use the Mount Microsoft Entra ID Tenant request. In response, you receive a mount session ID that you will need later. You can also get existing mount sessions using the Get Mount Points of All Microsoft Entra ID Tenants request.
  3. To browse the Microsoft Entra ID tenant backup for the items you want to restore, send the Get Microsoft Entra ID Items request.
  4. Choose the restore points from which to restore your items:
  5. If you want to check if a backed-up item exists in the production environment, send the Check Microsoft Entra ID Items in Production request.
  6. If you restore users, send the Generate Microsoft Entra ID User Passwords request to generate custom passwords for restored Microsoft Entra ID users. Alternatively, you can specify one default password for all restored users.
  7. [Delegated restore] If you perform the restore operation under the Restore Operator role, you must obtain credentials to connect to the production Microsoft Entra ID tenant:
    a. Obtain a user code. For details, see Get User Code for Delegated Restore of Microsoft Entra ID Items.
    b. To get the credentials required for restore, send the Get Credentials for Delegated Restore of Microsoft Entra ID Items request. Use the obtained credentials ID in the request body of the restore requests.
  8. To restore Microsoft Entra ID items, send the Restore Microsoft Entra ID Items request. The request starts a restore session.
  9. To restore item properties, send the Restore Microsoft Entra ID Item Properties request.
  10. To stop restore sessions, send the Stop Restore Session of Microsoft Entra ID Tenant request.
  11. To stop the mount session and unmount the tenant backup from the mount point, send the Unmount Microsoft Entra ID Tenant request.

Restoring Microsoft Entra ID Audit Logs

To restore Microsoft Entra ID audit and sign-in logs, take the following steps:

  1. To get the ID of the Microsoft Entra ID log backup you want to use for restore, run the Get All Backups request.
  2. To start a mount session and mount log files to the mount point, use the Start Microsoft Entra ID Audit Log Restore request. In response, you receive a mount session ID that you will need later. You can also get existing mount sessions using the Get All Unstructured Data Mount Points request.
  3. To browse the hierarchy tree of the mounted log files, use the Browse Unstructured Data File System request. In the request body, specify the path of the folder that you want to browse.
  4. If you want to search for a specific file or folder, use the Search for Files and Folders in Unstructured Data Mount Point and Browse Search Results in Unstructured Data Mount Point requests.
  5. To restore log files, send the Copy Files and Folders to Specific Folder request.
  6. To stop the mount session and unmount the log files from the mount point, send the Unmount Microsoft Entra ID Audit Logs request.

Microsoft Active Directory Forest Support

The REST API allows you to add Microsoft Active Directory forests to the inventory and check whether backup jobs protect domain controllers of the forests in accordance with SLA requirements.

Domain controllers of the forest are backed up by VMware vSphere, Microsoft Hyper-V and Veeam Agent backup jobs. The SLA Compliance job of the forest rescans the forest topology and checks whether these jobs protect the domain controllers. In the Active SLA compliance mode, the SLA Compliance job also adds unprotected domain controllers to the backup jobs that you select.

Adding Microsoft Active Directory Forest

To add an Active Directory forest, take the following steps:

  1. To get the ID of the credentials record used to connect to domain controllers of the forest over LDAPS, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.

  2. To get the TLS certificate of a domain controller, run the Get Microsoft Active Directory Domain Controller Certificate request. If the certificate.isTrusted property is false, save the certificate.thumbprint value.

  3. To discover the forest topology, run the Discover Microsoft Active Directory Forest request. In the request body, specify the DNS name of any domain controller of the forest, the credentials ID and, for an untrusted certificate, the certificate thumbprint. In response, you receive the forest identity (rootDomainFqdn and rootDomainAdId) and the domainControllers array with suggested machine mappings.

  4. Check the machine mappings of the domain controllers:

    • If mappingType is Manual, Veeam Backup & Replication did not find an unambiguous match. Specify the machine in mapping.machine. To get inventory objects, use the Get All Virtual Inventory request for VMs or the Get All Physical Inventory request for computers with Veeam Agent.
    • To add a domain controller without a mapping, omit mapping.
    • To discover mappings again for specific domain controllers, repeat the discovery request and specify the objectGUIDs of the domain controllers in dcObjectGuids.
  5. [Optional] To find backup jobs that already include the domain controllers, run the Discover Microsoft Active Directory Forest Backup Jobs request. In the request body, specify the domainControllers array with the confirmed mappings. You can specify the returned jobId and platform values in catchAllJobs.jobs when you add the forest.

  6. To add the forest, run the Add Microsoft Active Directory Forest request. In the request body, specify the following settings:

    • Forest identity (rootDomainFqdn and rootDomainAdId) and credentials ID (credentialsId).
    • Domain controllers that you want to add, with their machine mappings (domainControllers). Veeam Backup & Replication adds only the specified domain controllers.
    • SLA compliance mode and SLA requirements (slaMonitoring and slaRequirements). For details, see Configuring SLA Compliance.
    • [Optional] Backup jobs for unprotected domain controllers and Veeam Agent installation settings (catchAllJobs). For details, see Backing Up Domain Controllers.
    • [Optional] Schedule of automatic rescans and SLA compliance checks (schedule).

    To start the SLA Compliance job after the forest is added, set the performRescan query parameter to true. In response, you receive a session. To track the session, use the Get Session request.

Backing Up Domain Controllers

Veeam Backup & Replication does not back up an Active Directory forest with a dedicated backup job. To back up domain controllers of the forest, take the following steps:

  1. To create a backup job, use the Create Job request. Add the machines of the domain controllers to the job and enable application-aware processing. You can use the following backup jobs:

    NOTE

    If application-aware processing is disabled, the Active Directory database in the backup is crash-consistent, and you cannot use it for Active Directory recovery.

  2. [Active SLA compliance mode] To let Veeam Backup & Replication add unprotected domain controllers to backup jobs, specify the jobs in the catchAllJobs.jobs array when you add or edit the forest. For each job, specify the job ID and the machine platform (VSphere, HyperV or Agent). Veeam Backup & Replication adds each domain controller only to a job of the same platform that meets the SLA requirements.

  3. [Active SLA compliance mode] To install Veeam Agent on unprotected domain controllers that are not mapped or are mapped to physical machines, set catchAllJobs.agentDeployment.autoInstall to true and specify the ID of a credentials record with administrator privileges on the domain controllers in catchAllJobs.agentDeployment.credentialsId. The catchAllJobs.jobs array must contain a job of the Agent platform.

  4. To get backup jobs that protect domain controllers of the forest in accordance with SLA requirements, run the Get Microsoft Active Directory Forest Protecting Jobs request.

Configuring SLA Compliance

To configure SLA compliance of the forest, specify the slaMonitoring and slaRequirements properties when you add or edit the forest.

In the slaMonitoring.mode property, specify one of the following SLA compliance modes:

SLA Compliance Mode Description
Passive Veeam Backup & Replication detects and reports unprotected domain controllers and does not change backup jobs.
Active Veeam Backup & Replication detects and reports unprotected domain controllers and adds them to the backup jobs specified in catchAllJobs.jobs.

In the slaRequirements property, specify the following SLA requirements:

  • frequency — maximum allowed time between backups. To check the backup frequency, set isEnabled to true and specify interval and unit.
  • retention — minimum number of restore points that backup jobs must keep. Veeam Backup & Replication checks the daily tier against the short-term retention policy of the job, and the weekly, monthly and yearly tiers against the GFS retention policy of the job. To check a tier, set isEnabled of retention and of the tier to true and specify backups.
  • requireAllDomainControllers — if true, all domain controllers of each domain must meet the SLA requirements. If false, at least one domain controller of each domain must meet the requirements.

Veeam Backup & Replication checks SLA compliance during each session of the SLA Compliance job. The job runs on the schedule specified in the schedule property of the forest. If the automatic rescan schedule of the forest is disabled, the SLA Compliance job does not evaluate domains and domain controllers, and their status is NotEvaluated.

Checking SLA Compliance

To check SLA compliance of the forest, take the following steps:

  1. [Optional] To start the SLA Compliance job manually, run the Rescan Microsoft Active Directory Forest request. The job rescans the forest topology, checks the connection to the forest and checks SLA compliance. In response, you receive a session. To track the session, use the Get Session request.
  2. To get the connection status and SLA compliance status of all forests, run the Get States of All Microsoft Active Directory Forests request. The response contains the following statuses:
    • connectionStatus — result of the connection to the forest during the last session of the SLA Compliance job: Connected or Disconnected.
    • domains[].status — SLA compliance status of each domain: Protected, Unprotected or NotEvaluated.
    • domains[].domainControllers[].status — SLA compliance status of each domain controller: Protected, Unprotected or NotEvaluated.
  3. To get the forest settings and the machine mappings of domain controllers, run the Get All Microsoft Active Directory Forests or Get Microsoft Active Directory Forest request.
  4. To get the log of the last SLA Compliance job session, run the Get Session Logs request, using the lastSessionId value of the forest.

Managing Microsoft Active Directory Forests

You can perform the following operations with forests added to the inventory:

Unstructured Data Support

The REST API allows you to back up and restore unstructured data.

Adding Unstructured Data Infrastructure

Before you can create an unstructured data backup job, you must configure the infrastructure.

Adding Unstructured Data Sources

You can add the following types of unstructured data sources:

Type Description
FileServer Microsoft Windows-managed or Linux-managed file server
SMBShare SMB file share
NFSShare NFS file share
NASFiler Enterprise NAS system as a NAS filer
S3Compatible S3 Compatible Object Storage
AmazonS3 Amazon S3 Object Storage
AzureBlob Microsoft Azure Object Storage
  1. Get the necessary credentials record to connect to the file share or object storage. The type of credentials required depends on the unstructured data source:
  2. [For object storage] Run the Get Cloud Hierarchy request to browse the object storage and get the remaining required properties.
  3. All unstructured data types require a cache repository. Run the Get All Repositories or the Add Repository request.
  4. Run the Add Unstructured Data Servers request to add an unstructured data source to the backup server. Additional requests may be required depending on the type of unstructured data source.
    • [For file servers] The server must be added as a managed server. To get the necessary property values, run the Get All Servers or the Add Server request.
    • [For NAS filers] The server must be added as a backup repository to the storage infrastructure. To get the necessary property values, run the Get All Repositories or the Add Repository request.
  5. You can use the following requests to get, edit and remove unstructured data servers:

[Optional] Adding Backup Proxies

You can deploy a backup proxy to remove unwanted overhead on the server. All unstructured data types require proxies, except for file servers. However, note that all unstructured data types that require a backup proxy allow you to auto-select backup proxies when creating a backup job, which removes the need to set one up manually.
To add a backup proxy, use the Add Proxy request. In the request body, specify the GeneralPurposeProxy proxy type and other proxy properties.

Creating Backup Jobs

The REST API allows you to create the following types of unstructured data backup jobs:

Backup Job Type Description
FileBackup File share backup jobs.
ObjectStorageBackup Object storage backup jobs.

To create the backup job, run the following requests:

  1. Run the Add Repository request to get the IDs of the backup repositories that will serve as a primary and archive repository for the backup job.
  2. Run the Get All Backups request to get the source backup ID. This allows you to map the job to a specific backup stored in the backup repository. Backup job mapping allows you to move backup files to a new backup repository and to point the job to existing backups on this new backup repository.
  3. Run the Get All Unstructured Data Servers request to get the ID of the unstructured data server you need.
  4. Run the Create Job request to start the backup job. In the request body, specify the FileBackup or ObjectStorageBackup backup job type.
  5. [Optional] You can use the Run Health Check and Repair request on the backup job or the backup itself to check the integrity of the backup job or the backup.

Restoring Unstructured Data

The REST API allows you to perform the following restore operations:

  • Restore an entire file share
  • Restore an entire bucket or container
  • Perform Instant File Share Recovery
  • Restore files from unstructured data backup

Restoring Entire File Share

To restore the entire file share, run the following requests:

  1. Run the Get All Restore Points request to get the ID of the restore point as of which you want to restore your data.
  2. Run the Get All Unstructured Data Servers request to get the ID of the target file share.
    This ID is not necessary if restoreToBackupServer property value is set to true — in this case, the file share will be restored to the backup server.
  3. Enter the remaining properties in the request body and run the Restore Entire File Share request.

Restoring Entire Bucket or Container

To restore the entire object storage bucket or container, run the following requests:

  1. Run the Get All Restore Points request to get the ID of the restore point as of which you want to restore your data.
  2. Run the Get All Unstructured Data Servers request to get the ID of the target object storage.
    This ID is not necessary if restoreToBackupServer property value is set to true — in this case, the bucket or container will be restored to the backup server.
  3. Enter the remaining properties in the request body and run the Restore Entire Object Storage Bucket or Container request.

Performing Instant File Share Recovery

You can perform Instant File Share Recovery to the original or another location. This operation is only available for SMB shares.

Starting Instant File Share Recovery

To start Instant File Share Recovery, perform the following steps:

  1. Run the Get All Restore Points request to get the restorePointId property value of the SMB share you want to restore.
  2. [Optional] Run the Get Mount Servers request to get the mountServerId property value. This property is not required if you have set the autoSelectMountServers property to true — in this case, the backup server is used as a mount server.
  3. Run the Start Instant File Share Recovery request using the responses of the previous requests in the request body. If necessary, you can manually enter the remaining property values.

Managing Instant File Share Recovery Session

After you start the Instant Recovery session, an Instant Recovery mount point will be created on the target SMB share. You can perform the following actions:

  1. To get the mount point, run the Get All Mount Points for Instant File Share Recovery or the Get Mount Point for Instant File Share Recovery request.
  2. To start the process of migrating the SMB share to the target file share, run the Start File Share Migration request.
  3. To get the selected switchover settings, run the Get File Share Switchover Settings request.
  4. To edit the switchover settings, run the Update File Share Switchover Settings request.
  5. [For Manual and Scheduled Switchover Options] To manually initiate switchover, run the Start File Share Switchover request.
  6. After a successful operation, you can unmount the mount point with the Stop File Share Publishing request.

Restoring Files from Unstructured Data Backup

For more information, see File Restore.

Veeam Agent Management

You can create protection groups, add protected computers, cloud machines, clusters and domains, manage the agent on the added objects, install components on the objects, as well as back up and restore those objects.

Managing Protection Groups

  1. [For individual computer, CSV file and Active Directory protection group types] Get the necessary credentials ID for the protected computer with the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.
  2. If you want to add a Microsoft Active Directory domain to a protection group, use the Add Active Directory Domain request.
    1. If you have added multiple domains to Veeam Backup & Replication, run the Get Active Directory Domains request.
    2. To get a domain using its ID, run the Get Active Directory Domain request.
    3. To remove the domain, run the Remove Active Directory Domain request.
  3. Run the Add Protection Group request to create a protection group and add protected computers.
  4. [For the pre-installed agents protection group type] To download agent packages that you can install on the computers you want to add to the protection group, run the Download Protection Group Packages request. The format property is mandatory in the request body. In response, you receive a binary archive returned with a Content-Disposition attachment header.
    • To download Microsoft Windows packages, set the includeWindowsPackages property of the request body to true.
    • To download Mac packages, set the includeMacPackages property of the request body to true.
    • To get the Linux packages you can download, run the Get Linux Agent Packages request. Then specify the package names in the linuxPackages.packageNames properties of the request body.
    • To get the Unix packages you can download, run the Get Unix Agent Packages request. Then specify the package names in the unixPackages.packageNames properties of the request body.
  5. If you have multiple protection groups, you can get them with the Get Protection Groups request. You can also use the Get Protection Group request to get a protection group with a specified ID.
  6. If necessary, you can edit the protection group settings with the Edit Protection Group request.
  7. To rescan, or manually start the discovery process for the protection group, run the Rescan Protection Group request. To rescan specific entities without rescanning the entire protection group, run the Rescan Discovered Entities request.
  8. To disable automatic discovery of protected entities added to a protection group, run the Disable Protection Group request. To enable automatic discovery of protected computers, run the Enable Protection Group request.
  9. To get all discovered entities from a protection group with a specified ID, run the Get Discovered Entities request. To get a specific entity from a protection group, run the Get Discovered Entity request.
  10. The following requests allow you to install and upgrade Veeam Agent on a discovered entity and to install various components necessary for managing backup and recovery.
  11. To uninstall the agent from one or several discovered entities, run the Uninstall Agent from Discovered Entities request. To uninstall all components, run the Uninstall All Components from Discovered Entities request.
  12. You can remove objects from the protection group with the Remove Discovered Entity request. To remove the entire protection group, run the Remove Protection Group request.

Backing Up Discovered Entities

To back up the contents of a protection group, perform the following steps:

  1. Choose the objects you want to back up:
  2. To create a backup job, use the Create Job request. In the request body, specify one of the following backup job types:
    • WindowsAgentBackup — Veeam Agent backup jobs for Microsoft Windows computers
    • LinuxAgentBackup — Veeam Agent backup jobs for Linux computers
    • WindowsAgentBackupWorkstationPolicy — Veeam Agent backup policies for Microsoft Windows computers of the workstation type
    • LinuxAgentBackupWorkstationPolicy — Veeam Agent backup policies for Linux computers of the workstation type
    • WindowsAgentBackupServerPolicy — Veeam Agent backup policies for Microsoft Windows computers of the server type
    • LinuxAgentBackupServerPolicy — Veeam Agent backup policies for Linux computers of the server type
    • MacAgentBackupWorkstationPolicy — Veeam Agent backup policies for Mac computers of the workstation type
    • MacAgentBackupServerPolicy — Veeam Agent backup policies for Mac computers of the server type
    • UnixAgentBackupServerPolicy — Veeam Agent backup policies for IBM AIX and Oracle Solaris computers of the server type
      You can specify any agent-managed objects in the policy settings (including computers, protection groups, clusters and so on). If the array includes a protection group, computers discovered in that group later are automatically protected by the backup policy.
  3. [For backup policies] In some cases, for example, when one or more protected computers could not be accessed over the network at the time when the backup policy was created, you may want to manually apply a Veeam Agent backup policy settings to protected computers. To do this, run the Apply Backup Policy Configuration request.
  4. [For backup policies] In some cases, for example, when the backup cache contains one or more restore points and the backup chain in the target location has changed before Veeam Agent starts uploading restore points to the target location, you must clear the backup cache on computers added to the backup policy. To do this, run the Clear Backup Cache request.
    This request is available for:
    • Computers that are protected with Veeam Agent for Microsoft Windows.
    • All protection group types except with protection groups with pre-installed agents.

Restoring Files and Folders

  1. [Optional] If necessary, Veeam Backup & Replication REST API allows you to use recovery tokens to allow the agents authenticated access to backups created by Veeam Agents.
    1. To get all recovery tokens, run the Get All Recovery Tokens request. To create a recovery token, run the Create Recovery Token request.
    2. To get a specific recovery token using the recovery token id, run the Get Recovery Token request.
    3. To edit the settings of a recovery token with a specified id, run the Edit Recovery Token request.
    4. To delete the recovery token, run the Delete Recovery Token request.
  2. Veeam Backup & Replication REST API only supports file-level restore from backups of agent-managed objects. For more details on how to perform this operation, see File Restore.

Application Backup Policies

The REST API allows you to back up Microsoft SQL Server, Oracle RMAN and SAP HANA databases with application backup policies, copy application backups to another backup repository and create snapshots of application backup repositories.

Application backup policies process databases on computers added to protection groups. The computers must have Veeam Plug-ins installed.

Installing Veeam Plug-ins

Before you install Veeam Plug-ins, add the database servers to a protection group. For details, see Veeam Agent Management.

You can install the following types of Veeam Plug-ins:

Plug-in Type Description
MSSQL Veeam Plug-in for Microsoft SQL Server
OracleRMAN Veeam Plug-in for Oracle RMAN
SAPHANA Veeam Plug-in for SAP HANA
SAPOnOracle Veeam Plug-in for SAP on Oracle

To install a plug-in, take the following steps:

  1. To get the protection group ID, run the Get Protection Groups request.
  2. To get the IDs of the discovered computers, run the Get Discovered Entities request. The plugins array of each computer contains the type, version and status of each plug-in.
  3. To install the plug-in, run the Install Plug-in on Discovered Entities request. In the request body, specify the IDs of the discovered computers (entityIds) and the plug-in type (pluginType). In response, you receive a session. To track the session, use the Get Session request.

You can perform the following operations with installed plug-ins:

The requests start a session. To track the session, use the Get Session request.

To install plug-ins on all computers discovered in a protection group, set options.installApplicationPlugins to true and specify the plug-in types in options.applicationPlugins when you add or edit the protection group. To upgrade plug-ins automatically, set options.updateAutomatically to true.

Creating Application Backup Policies

You can create the following types of application backup policies:

Backup Policy Type Description
MsSqlBackupPolicy Microsoft SQL Server application backup policy.
OracleRmanBackupPolicy Oracle RMAN application backup policy.
SapHanaBackupPolicy SAP HANA application backup policy.

To create an application backup policy, take the following steps:

  1. To get the IDs of the protection groups that contain the database servers, run the Get Protection Groups request.
  2. To get the ID of the target backup repository, run the Get All Repositories or Get All Scale-Out Backup Repositories request.
  3. To get the IDs of the credentials records used to connect to the database servers and databases, run the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request.
  4. To create the policy, run the Create Job request. In the request body, specify the following settings:
    • Policy type (type), name (name) and description (description).
    • Backup scope (databases.includes). For each object, specify the object ID in id. For objects other than protection groups, also specify the ID of the protection group in parentContainerId. To exclude objects from the scope, specify them in databases.excludes.
    • Target backup repository (storage.backupRepositoryId).
    • Credentials:
      • [For MsSqlBackupPolicy] Credentials for every Microsoft SQL Server instance in the scope (credentials). For each instance, specify the credentials ID (credentialsId). To use Microsoft SQL Server authentication, set useSqlServerAuthentication to true.
      • [For OracleRmanBackupPolicy] Credentials of the OS account (databaseProcessing[].credentialsId) and of the Oracle account (databaseProcessing[].dbCredentialsId). If you omit dbCredentialsId, OS authentication is used.
      • [For SapHanaBackupPolicy] Credentials for every SAP HANA system in the scope (credentials). For each system, specify the credentials of the OS account used to connect over SSH (sshCredentialsId) and the credentials of the SAP HANA backup user (backupUserCredentialsId).
    • [Optional] Log processing settings of individual objects (databaseProcessing): transaction log backups for Microsoft SQL Server, archived redo log backups for Oracle RMAN and redo log backups for SAP HANA.
    • [Optional] Retention policy (storage.retentionPolicy), GFS retention policy (storage.gfsPolicy) and advanced settings (storage.advancedSettings).
    • [Optional] Schedule (schedule). Application backup policies do not support the continuous schedule.

Managing Application Backup Policies

You can perform the following operations with application backup policies:

  • To edit a policy, get the policy with the Get Job request, change the settings and send them with the Edit Job request. You cannot change the policy type.
  • To start a policy, run the Start Job request. To create an active full backup, set performActiveFull to true. You can start an Oracle RMAN or SAP HANA policy only if the policy is enabled and has run at least once. In response, you receive a session. To track the session, use the Get Session request.
  • To stop a running policy, run the Stop Job request.
  • To retry a policy, run the Retry Job request. The retry processes only the databases that failed during the latest policy run.
  • To enable or disable a policy, run the Enable Job or Disable Job request.
  • To clone a policy, run the Clone Job request.
  • To delete a policy, run the Delete Job request.

The OracleRMANBackup, SapHanaBackintBackup, SapOracleBackintBackup, MSSQLPluginBackup, DB2PluginBackup and SapMaxDBBackup job types are plug-in backup jobs. You cannot create plug-in backup jobs with the REST API, and the Get All Jobs request does not return them. The Get All Job States request returns plug-in backup jobs that are not managed by an application backup policy. To get backups created by plug-in backup jobs, use the jobTypeFilter parameter of the Get All Backups request.

Creating Application Backup Copy Jobs

To copy application backups to another backup repository, create a backup copy job of the ApplicationBackupCopy type. To create the job, take the following steps:

  1. Get the IDs of the source objects:
  2. To get the ID of the target backup repository, run the Get All Repositories or Get All Scale-Out Backup Repositories request.
  3. To create the job, run the Create Job request. In the request body, specify the following settings:
    • Job type (ApplicationBackupCopy), name (name) and description (description).
    • Source objects (sourceObjects.includes). Specify at least one job, repository or backup.
    • Copy mode (mode). Specify Immediate. The Periodic copy mode is not supported. If you specify schedule, set schedule.type to Immediate.
    • Target backup repository (target.backupRepositoryId) and, optionally, retention policy (target.retentionPolicy). The GFS retention policy is not supported. If you specify target.gfsPolicy, set target.gfsPolicy.isEnabled to false.

To get application backup copy jobs, run the Get All Jobs request with the typeFilter parameter set to ApplicationBackupCopy. To edit a job, use the Edit Job request. To enable or disable encryption of backup files, disable the job with the Disable Job request, wait for the job to stop and then edit the job.

Creating Application Backup Repository Snapshots

An application backup repository is an NFS share hosted on a Linux server and based on Veeam Hardened Repository. Veeam Backup & Replication creates immutable snapshots of the share and turns them into restore points. You can create a snapshot on demand only if the snapshot schedule is enabled for the repository.

To create a snapshot of an application backup repository, take the following steps:

  1. To get the repository ID, run the Get All Application Backup Repositories request.
  2. To create the snapshot, run the Create Application Backup Repository Snapshot request. Veeam Backup & Replication creates the snapshot and rescans the repository in the background. In response, you receive a snapshot session with the isCompleted property set to false.
  3. To track the snapshot session, run the Get Snapshot Session request with the id of the snapshot session. Repeat the request until isCompleted is true. If the session has completed successfully, the response contains the snapshot ID (snapshotId). If a completed session does not contain snapshotId, the session has failed.
NOTE

Snapshot sessions are kept for 7 days. Snapshot sessions are also removed when the Veeam Backup Service restarts.

File Restore

Using Veeam Backup & Replication REST API, you can restore files and folders from the following sources:

  • Backups and replicas of Microsoft Windows and Linux machines.
  • Backups of unstructured data.

To restore files and folders, take the following steps:

  1. Start the restore session and mount the machine file system to the mount server.
  2. Perform restore operations.
  3. Stop the restore session.

Mounting File System

To mount the file system to the mount server, do the following:

  1. Get a restore point from a backup or a replica. Note that replicas are not supported for unstructured data.

    • To get a restore point from a backup, perform the following steps:
      1. To get the backup object from which you want to restore files or folders, send the Get All Backup Objects request. Save the backup object ID that you need.
      2. To get the necessary restore point from the backup object, use the Get Restore Points request, using the backup object ID. Save the restore point ID that you need.
        Alternatively, you can use the Get All Restore Points request to get an array of all backup restore points created on the backup server. Save the restore point ID that you need.
    • To get a restore point from a replica, perform the following steps:
      1. To get the replica from which you want to restore files or folders, send the Get All Replicas request. Save the replica ID that you need.
      2. To get the necessary restore point from the replica, use the Get All Replica Restore Points request, using the replica ID. Save the restore point ID that you need.
        Alternatively, you can use the Get All Replicas request to get an array of all replica restore points created on the backup server. Save the restore point ID that you need.
  2. Get the credentials ID with the Get All Credentials request. To add a new credentials record, use the Add Credentials Record request. This step is not necessary in the following cases:

    • When restoring files or folders from a Microsoft Windows server to the original location.
    • When restoring files or folders to SMB shares and NAS filers that do not require authorization.
  3. Use one of the following requests to mount the file system to the mount server:

    In response, you will receive a FileLevelRestore session. Save the restore session ID to use it for restore operations.

  4. To get all active sessions, run the following requests

Performing Restore

To restore files and folders, take the following steps:

  1. To browse file system items (drives, folders, files and links) available in a restore session, run the following requests:

  2. [Optional] [For Microsoft Windows or Linux machines] To compare file system items in the FileLevelRestore session with the items on the production machine, do the following:

    1. To connect to the production machine, run the Initialize Compare Mode request. In the request body, specify the ID of the credentials record used to access the production machine (credentialsId). If you do not specify the credentials, Veeam Backup & Replication checks whether the production machine requires them. If isCredentialsNeeded is true in the response, repeat the request with the credentials ID. Run this request before other compare requests in the restore session.
    2. To compare file system items (drives, folders, files and links), run the Compare Files and Folders request. In the request body, specify the item paths in paths and set isEnabled to true. To exclude items from the comparison, set isEnabled to false.
    3. To check the comparison results, run the Browse File System request. The itemState property of each item contains the comparison result, for example, Changed, Unchanged or Deleted. To get items in specific states, specify them in filter.itemStates.
    4. To compare attributes of folders, files and links, run the Compare Attributes request for one item or the Compare Attributes in Batch request for multiple items. To get unchanged attributes as well, set showUnchangedAttributes to true. You cannot compare attributes of volumes.
    NOTE

    You cannot compare items of public cloud backups, CDP replicas and macOS backups.

  3. [Optional] [For unstructured data] To compare file system items and their attributes in the FileLevelRestore session with the source, run the following requests:

  4. [Optional] To search for a specific file or folder and to preview the hierarchy tree of the mounted files and folders, run the following requests:

    If you specify an empty path in the request body, you will browse the root folder, and then you can go deeper into the tree.

  5. To restore the necessary files or folders, you can perform any of the following operations:

Stopping Browser Session

To stop the mount session and unmount the file system from the mount point, run one of the following requests:

This step is obligatory if you have disabled autoUnmount in the request bodies of the Start File Restore and Start File Restore from Unstructured Data Backup requests.

Bare Metal Recovery and Volume Restore

Using Veeam Backup & Replication REST API, you can restore volumes of a Microsoft Windows machine protected by Veeam Agent to one of the following targets:

  • A Veeam Agent computer.
  • A recovery appliance. This target requires a license for Remote Bare Metal Recovery.

To restore volumes, take the following steps:

  1. Create Veeam Recovery Media.
  2. Prepare the target host for bare metal recovery.
  3. [For a recovery appliance] Install missing device drivers on the appliance.
  4. Start a disk management session for the target host.
  5. Map the disk layout of the restore point onto the disk layout of the target host.
  6. Start volume restore.

Creating Veeam Recovery Media

Veeam Recovery Media is an ISO image that you use to boot a machine into the recovery environment. To create and download Veeam Recovery Media, do the following:

  1. Start the task that creates Veeam Recovery Media with one of the following requests:

    In response, you will receive a task. Save the task ID.

  2. To track the task progress, run the Get Task request, using the task ID.

  3. After the task completes, download the ISO file with the Download Recovery Media request.

Preparing Hosts for Bare Metal Recovery

To prepare Microsoft Windows computers in a protection group for bare metal recovery, you can perform the following actions:

  1. To get the computers of a protection group, run the Get Discovered Entities request. To get the computers of all protection groups, run the Get All Discovered Entities request. The embeddedRecoveryMediaState property of a computer contains the state of its embedded recovery media.
  2. To create embedded recovery media on the computers, run the Recreate Embedded Recovery Media on Agent Hosts request. To create embedded recovery media automatically, set the createEmbeddedRecoveryMedia property of the ProtectionGroupAdvancedWindowsSettingsModel object when you add or edit a protection group.
  3. To prepare the computers for Remote Bare Metal Recovery, run the Prepare Agent Hosts for Remote Bare Metal Recovery request.
  4. To reboot the computers, run the Reboot Discovered Entities request.
  5. To get the state of the Veeam Agents installed on the computers, run the Get All Agent States or Get Agent State request.

To manage recovery appliances that are connected to the backup server, use the following requests:

Installing Drivers on Recovery Appliances

If a recovery appliance has no drivers for some devices, for example, storage controllers or network adapters, you can install the drivers on the appliance. Driver installation is available if the operations array of the appliance contains the InstallDrivers operation with enabled set to true.

To install drivers on a recovery appliance, take the following steps:

  1. To get the devices of the appliance, run the Get Agent Recovery Appliance Devices request. The status property of each device contains the driver status:

    • Installed — the driver is installed.
    • DriverAvailable or UnknownWithDriver — a matching driver is available on the appliance.
    • DriverMissing or Unknown — no matching driver is available on the appliance.

    To get devices with specific driver statuses, use the statusFilter parameter.

  2. [For a device with an available driver] To install the driver, run the Install Existing Driver on Agent Recovery Appliance Device request, using the device ID. In response, you receive the refreshed array of devices.

  3. [For a device without an available driver] To install a custom driver, do the following:

    1. Upload the driver package to the backup server with one of the following requests:

      The package must contain exactly one .inf file and the files it references. In response, you receive the uploadId of the package. If isComplete is false, the missingFiles array contains the referenced files that are missing from the package.

    2. To install the uploaded package, run the Install Custom Driver on Agent Recovery Appliance request, using the uploadId value. In response, you receive the refreshed array of devices.

    3. To keep the driver upload session active between requests, periodically run the Keep Alive Agent Recovery Appliance Driver Upload Session request. If isAlive is false, the session has expired, and you must upload the package again.

    4. After you install the drivers, run the Release Agent Recovery Appliance Driver Upload Session request. Veeam Backup & Replication removes the uploaded driver package from the backup server.

  4. [Optional] To enable or disable driver injection during volume restore to the appliance, run the Edit Agent Recovery Appliance Driver Injection Settings request. In the request body, set injectDrivers to true or false. The setting applies to every subsequent volume restore to this appliance.

If you install a storage controller driver after you start a disk management session, refresh the restore layout. For details, see Mapping Disk Layout.

NOTE

You cannot install drivers on a recovery appliance while volume restore to this appliance is in progress.

Starting Disk Management Session

To start a disk management session, do the following:

  1. Get the restore point that you want to restore volumes from:

    1. To get the backup object, send the Get All Backup Objects request. Save the backup object ID that you need.
    2. To get the restore point, use the Get Restore Points request, using the backup object ID. Save the restore point ID that you need.

    [Optional] To get the network interfaces of the restore point, run the Get Restore Point Network Info request.

  2. Get the ID of the target host:

  3. Run the Initialize Disk Management request. In the request body, specify the host ID, the restore point ID and the hostType property with the Agent or RecoveryAppliance value. Veeam Backup & Replication loads the live disk layout of the host. In response, you will receive a disk management session ID.

  4. To keep the disk management session active, periodically run the Keep Disk Management Session Alive request. The disk management session expires if the request is not sent.

NOTE

A disk management session is available only to the user who started it.

Mapping Disk Layout

The backup disk layout must be mapped onto the disk layout of the target host before you start volume restore. To map the layout, do the following:

  1. To map the layout automatically, run the Map Backup Layout to Host Layout Automatically request with one of the following mappingType values:

    • ToOriginalLayout — maps the layout to the original disk layout.
    • Custom — maps the layout to a custom disk layout.

    In response, you will receive the success property with the mapping result and the current restore layout.

  2. To get the current restore layout of the host, run the Get Current Restore Layout of Host request. The volumeMatchingResults property contains the volumes that were matched automatically.

  3. [Optional] To detect disks that became visible to the host after the disk management session started, for example, after you installed a storage controller driver, run the Refresh Restore Layout of Host request. Veeam Backup & Replication re-reads the disk layout of the host and maps the backup layout to it again. The request discards manual mapping changes made in the session.

  4. [Optional] To unlock a BitLocker-protected volume, run the Unlock BitLocker-Protected Volume request.

  5. If the layout was not mapped automatically, or if you want to change the mapping, you can perform the following operations:

    Each of these requests returns the updated disk mapping context with the version property. Save the disk mapping context returned by the last request.

Performing Volume Restore

To restore the volumes, run the Starts Volume Restore for Agent or Recovery Appliance request. In the request body, specify the disk management session ID and the disk mapping context. For a recovery appliance, Veeam Backup & Replication injects drivers during the restore if driver injection is enabled for the appliance. For details, see Installing Drivers on Recovery Appliances.

Note the following:

  • The version property of the disk mapping context must match the version of the current restore layout. Otherwise, the request fails. To get the current version, run the Get Current Restore Layout of Host request.
  • The disk layout must be mapped and must contain at least one mapped volume.
  • After the restore starts successfully, Veeam Backup & Replication releases the disk management session. To restore volumes again, start a new disk management session.

In response, you will receive a RestoreAgentVolumes or RestoreRecoveryApplianceVolumes session. To track the session, run the Get Session request.

To restore volumes of multiple recovery appliances in one session, run the Start Volume Restore for Multiple Hosts request. In the hosts array of the request body, specify the disk management session ID and the disk mapping context of each appliance. Veeam Backup & Replication validates each host separately. In response, you receive the following properties:

  • session — RestoreRecoveryApplianceVolumes session that restores the hosts that passed validation. To track the session, use the Get Session request.
  • hostErrors — hosts that failed validation, with the error code (errorCode) and the reason (message). If all hosts fail validation, the response does not contain session.
NOTE

The Start Volume Restore for Multiple Hosts request supports recovery appliances only.

Instant Recovery to Microsoft Azure

You can perform Instant Recovery of Microsoft Windows and Linux machines to Microsoft Azure.

NOTE

Deploying a helper appliance template with the REST API is not supported. Before you run this request, you must deploy a helper appliance template in the Veeam Backup & Replication UI or with the Deploy-VBRAzureApplianceTemplate cmdlet.

Starting Instant Recovery

To start Instant Recovery to Microsoft Azure, perform the following steps:

  1. Run the Get All Restore Points request to get the RestorePointId property value of the machine you want to restore.
  2. Run the Get Restore Point Disks request to get the diskUid property value.
  3. Run the Get All Cloud Credentials request to get the subscriptionId property value.
    If you do not have a Microsoft Azure subscription added, you must add it with the request.
  4. Run the Get Cloud Hierarchy request to get the values for the remaining required properties.
  5. Run the Start Instant Recovery to Microsoft Azure request using the responses of the previous requests in the request body. An Instant Recovery session will be started. Note that there are multiple types of sessions associated with the Instant Recovery to Microsoft Azure operation. You can get an overview of all these sessions with the Get All Mount Sessions for Instant Recovery to Microsoft Azure request.

Managing Instant Recovery Session

After you start the Instant Recovery session, an Instant Recovery mount point will be created in Microsoft Azure. You can perform the following actions:

  1. To get the mount point, run the Get Mount Point for Instant Recovery to Microsoft Azure request.
  2. To start migrating the machine to Microsoft Azure, run the Start Migrating Machine to Microsoft Azure request.
  3. To get the selected switchover settings, run the Get Settings for Switchover to Microsoft Azure request.
  4. To edit the switchover settings, run the Update Settings for Switchover to Microsoft Azure request.
  5. [For Manual and Scheduled Switchover Options] To manually initiate switchover to Microsoft Azure, run the Start Switchover to Microsoft Azure request.
  6. After a successful operation, you can unmount the mount point with the Stop Publishing Machine to Microsoft Azure request.

Malware Detection

Using Veeam Backup & Replication REST API, you can configure malware detection settings, manage malware events and the malware status of backups, scan backups with antivirus software or YARA rules, and analyze backups for signs of encryption.

Configuring Malware Detection Settings

To manage malware detection settings, use the following requests:

  1. To get all malware detection settings, run the Get All Malware Detection Settings request. The response contains the following groups of settings:
    • encryptionDetectionSettings — inline scan for signs of encryption and its sensitivity.
    • fileDetectionSettings — guest index scan, monitoring of indicators of compromise and automatic update of malware definitions.
    • signatureDetectionSettings — detection engine, scan of archives and automatic signature-based scan.
    • notificationSettings — email notifications about malware events.
    • incidentAPISettings — quick backup on an external event.
  2. To edit malware detection settings, run the Edit Malware Detection Settings request.
  3. To get the suspicious file masks, trusted extensions and trusted paths, run the Get Malware Suspicious File Masks Settings request. To edit them, run the Edit Malware Suspicious File Masks Settings request.
  4. To get the file extensions that can be added to the trusted list, run the Get Malware Allowed Trusted Extensions request.
  5. To get the indicators of compromise and their monitoring status, run the Get Malware File Detection Indicators of Compromise request. To turn monitoring on or off, run the Enable Monitoring of Indicators of Compromise or Disable Monitoring of Indicators of Compromise request.

Managing Malware Events

To manage malware events, use the following requests:

  1. To get all malware events, run the Get All Malware Events request. To filter the events by the time they were created, use the createdAfterTimeUtcFilter and createdBeforeTimeUtcFilter parameters.
  2. To get a specific malware event, run the Get Malware Event request.
  3. To report malware activity detected by a third-party solution, run the Create Malware Event request.

Managing Malware Status of Backups

To manage the malware status of backups, use the following requests:

  1. To get all malware detection objects, run the Get All Malware Detection Objects request. To get a specific object, run the Get Malware Detection Object request.
  2. To get the restore points that have a specific malware status, run the Get Restore Points or Get All Restore Points request with the malwareStatusFilter parameter.
  3. To mark backup objects that were flagged as suspicious or infected as clean, run the Mark Backup Objects as Clean request.
  4. To change the malware status of a specific backup file, run the Mark Backup File as Clean or Mark Backup File as Infected request.
  5. To exclude backup objects from malware detection, use the following requests:

Scanning Backups

To scan backups with antivirus software or YARA rules, do the following:

  1. [For a scan with a YARA rule] To get the YARA rules available on the backup server, run the Get YARA Rules request.

  2. Run the Scan Backups with Antivirus or YARA Rules request. In the request body, specify the MalwareBackupScanBaseSpec schema with the following properties:

    • scanEngine — antivirus software or a YARA rule.
    • scanMode — MostRecent, AllInInterval, FirstInInterval or Specific.
    • scanRange — time interval within which the restore points are scanned.
    • restorePointId — restore point to scan.
    • continueScan — whether to continue the scan after the first occurrence of malware.

    In response, you will receive a SureBackupContentScan session.

  3. To get the logs of a scan task session, run the Get Logs for SureBackup Scan Task Session request.

Analyzing Backups for Signs of Encryption

To analyze a backup for signs of encryption, do the following:

  1. Get the ID of the malware event that you want to analyze with the Get All Malware Events request.
  2. Run the Start Malware Encryption Analysis request, using the event ID. In response, you will receive an EncryptionAnalysis session. Save the session ID.
  3. After the session completes, download the log file with the Download Malware Encryption Analysis Logs request.

Resource Tags

The REST API allows you to create tags, assign them to jobs, backups, replicas, backup infrastructure components, roles and inventory objects, and get entities by their tags.

A tag consists of a key and a value. A tag key with its settings is a tag definition. Each tag definition has a list of values that you can assign to entities. The predefined Location tag is a single-value tag whose values are the locations configured in Veeam Backup & Replication.

NOTE

In this version, you can create tag definitions only for system tags. You can manage system tags and their assignments only on a backup server managed by Veeam Service Provider Console. On other backup servers, you can create values of the Location tag and assign them to entities.

Creating Tag Definitions and Values

To create a tag, take the following steps:

  1. [Optional] To check whether the tag key already exists, run the Get All Tag Definitions request. To get definitions whose key starts with a specific prefix, use the keyFilter parameter.

  2. [For system tags] To create a tag definition, run the Create Tag Definition request. In the request body, specify the tag key (key) and the following settings:

    • isSystem — whether the tag is a system tag.
    • isMultivalue — whether an entity can have more than one value of the key.
    • isInheritable — whether child objects in the inventory hierarchy inherit the tag.
    • propagateJobTagToBackup — whether the tag assigned to a job is also assigned to the backups that the job creates.

    If a definition with this key already exists, you receive the existing definition, and its settings do not change.

  3. To create a tag value, run the Create Tag Value request. In the request body, specify the value (value) and the tag definition, either by key (key) or by ID (resourceTagDefinitionId). To create a location, specify the Location key. If the value already exists, you receive the existing value.

  4. To get the values of a tag definition, run the Get Tag Values by Key request. Specify the tag key in the keyFilter parameter. To get values that start with a specific prefix, use the valueFilter parameter.

Tag keys and values must meet the following requirements:

  • A key or value can be up to 127 characters long and cannot contain control characters.
  • Keys and values are case-insensitive. A key must be unique, and a value must be unique within its tag definition.
  • You cannot use the Location key for a new tag definition.

Assigning Tags to Resources

You can assign tags to the following entities:

Entity Endpoint
Jobs /api/v1/jobs/{id}/resourceTags
Protection groups /api/v1/agents/protectionGroups/{id}/resourceTags
Credentials records /api/v1/credentials/{id}/resourceTags
Encryption passwords /api/v1/encryptionPasswords/{id}/resourceTags
KMS servers /api/v1/kmsServers/{id}/resourceTags
Backups /api/v1/backups/{id}/resourceTags
Replicas /api/v1/replicas/{id}/resourceTags
Backup repositories /api/v1/backupInfrastructure/repositories/{id}/resourceTags
Scale-out backup repositories /api/v1/backupInfrastructure/scaleOutRepositories/{id}/resourceTags
Managed servers /api/v1/backupInfrastructure/managedServers/{id}/resourceTags
Roles /api/v1/security/roles/{id}/resourceTags
Unstructured data servers /api/v1/inventory/unstructuredDataServers/{id}/resourceTags
Inventory objects /api/v1/inventory/resourceTags

Each endpoint supports the same set of requests. For example, for jobs, use the following requests:

  • Get Job Tags — gets the tags assigned to the job.
  • Assign Job Tags — adds the specified tags to the tags of the job. If the tag definition is single-value, the specified value replaces the current value of the key.
  • Replace Job Tags — replaces all tags of the job with the specified tags. To remove all tags, including the Location tag, specify an empty tags array.
  • Remove Job Tags — removes the specified tags from the job. If one of the tags is not assigned to the job, the request fails, and no tags are removed.

To assign tags to an entity, take the following steps:

  1. Get the ID of the entity. For example, to get a job ID, run the Get All Jobs request.

  2. Run the assign request for the entity, for example, Assign Job Tags. In the request body, specify the tags array. For each tag, specify the value (value) and the tag definition, either by key (key) or by ID (resourceTagDefinitionId). By default, the values must already exist. To create missing values, set createTagValue to true.

    In response, you receive all tags of the entity after the change.

  3. [For jobs] Veeam Backup & Replication also assigns the job tags whose definition has propagateJobTagToBackup set to true to the backups that the job creates. By default, a tag change also applies to the backups that the job has already created. To change only the tags of the job, set the propagateToBackups query parameter to false. The existing backups keep their tags until the next job run.

To assign tags to an inventory object, take the following steps:

  1. To get the inventory object, run the Get Inventory Objects request.

  2. Run the Assign Inventory Object Tags request. In the request body, specify the inventory object (object) and the tags (resourceTags). To replace or remove tags of the object, use the Replace Inventory Object Tags or Remove Inventory Object Tags request.

    You cannot assign tags to VMware vSphere objects of the Multitag type and to inventory objects of the CloudDirector, VcfAutomation and Agent platforms.

You can assign the Location tag only to managed servers, backup repositories, protection groups, unstructured data servers, and VMware vSphere clusters and datacenters.

Getting Tag Assignments

To get tag assignments, use the following requests:

  1. To get the tags of a specific entity, run the get request for the entity, for example, Get Job Tags. For an inventory object, run the Get Inventory Object Tags request and specify the inventory object in the request body. The source property of each tag shows how the entity received the tag:

    • Direct — the tag is assigned to the entity directly.
    • InheritFromParent — the entity inherits the tag from a parent object in the inventory.
    • PropagatedFromJob — the tag is copied from the job that created the backup.
    • PropagatedFromToken — the tag comes from the access token of the user who created the entity.
  2. To get inventory objects with the tags assigned directly to them, run the Get Inventory Tag Assignments request. To get objects of a specific platform, use the platformFilter parameter.

  3. To find entities by tags, run the Get Tag Assignments by Query request. In the request body, specify the conditions array. For each condition, specify the tag key (key), the match operator (match) and, for the Equals and StartsWith operators, the value (value). An entity matches the query only if it meets all conditions. If the conditions array is empty, the response contains no entities. To filter the result by entity type or name, use the entityTypeFilter and entityNameFilter parameters.

    In response, you receive the type and name of each matching entity. The response contains only entities that you can access.

  4. To filter entities by tags in other requests, use the resourceTagQuery query parameter of the following requests: Get All Jobs, Get Protection Groups, Get All Credentials, Get All Encryption Passwords, Get All KMS Servers, Get All Backups, Get All Replicas, Get All Repositories, Get All Scale-Out Backup Repositories, Get All Servers, Get All Roles and Get All Unstructured Data Servers. Pass the tag query as a URL-encoded JSON object, for example:

    resourceTagQuery={"conditions":[{"key":"env","match":"Equals","value":"prod"}]}
    
  5. To filter inventory objects by tags, specify the resourceTagQuery property in the request body of the Get Inventory Objects request. To get the tags of each returned object, set the populateResourceTags property to true.

Managing Tags

You can perform the following operations with tag definitions and values:

  • To edit a tag definition, run the Edit Tag Definition request. Properties that the request body does not contain keep their current values. To rename the definition, specify a new key. The key must not be used by another definition. You cannot set isMultivalue to false if an entity has more than one value of the key.
  • To rename a tag value, run the Rename Tag Value request. The value keeps its ID and assignments. The new value must not be used by another value of the same tag definition.
  • To delete a tag value, run the Delete Tag Value request. Veeam Backup & Replication removes the value from all entities. If the tag definition has no values left, Veeam Backup & Replication also deletes the definition, unless the definition keeps unassigned values.
  • To delete a tag definition, run the Delete Tag Definition request. Veeam Backup & Replication deletes the definition with all its values and removes the values from all entities.

A tag definition created with the Create Tag Definition request keeps unassigned values: when you remove the last assignment of a value, the value remains and can be assigned again.

NOTE

You cannot edit or delete the definition of the Location tag.