The createRecoveryPlan method creates a recovery plan. You call the method by passing the name and folder of the plan, and the protection group(s) that must be included in the plan.

Synopsis

CreateRecoveryPlanTask createRecoveryPlan(
		String name,
		drextapi.Folder folder,
		ProtectionGroup[] groups,
		@optional String description,
		@optional TestNetworkMapping[] mapping)
Parameter Description
name Specifies the name of the plan. Must be unique in the parent folder, and contain between 1 and 80 characters.
folder Specifies the folder where the plan is created.
groups Specifies the protection groups that are added to the recovery plan.
description Optional parameter. Specifies the recovery plan description. Should not contain more than 4096 characters.
mapping Optional parameter. Specifies the test network mappings. For more information, see GetTestNetworkMappings.

CreateRecoveryPlanTask is a task object that contains information about the status of the operation. Site Recovery Manager Server retains the object for 30 minutes after the task finishes.

IsCreateRecoveryPlanComplete returns true if the task for creating a recovery plan is complete.

GetCreateRecoveryPlanFailure returns the failure during the operation for creating a recovery plan. If you pass a name of a plan that exists, the failure is DuplicateNames.

If the operation is successful, the GetNewRecoveryPlan returns the created recovery plan.

Note: The recovery plan name can not be the same as the folder in which it will be created.
If a task fails, its error field may contain one of the following:
  • DuplicateNames if a plan with this name already exists.
  • InvalidArgument if the name parameter is empty string
  • InvalidType if folder parameter isn't meant to hold a recovery plans.
  • InvalidPrimaryNetwork if mapping parameter contains TestNetworkMapping with an invalid network on primary site. For example, uplink DVPortgroup.
  • InvalidSecondaryNetwork if mapping parameter contains TestNetworkMapping with an invalid network on secondary site. For example uplink DVPortgroup.
  • NoPermission if user doesn't have VcDr.RecoveryProfile.com.vmware.vcDr.Create privilege on the specified folder or VcDr.ProtectionProfile.com.vmware.vcDr.AssignToRecoveryPlan privilege on all protection groups in the plan.
  • StringArgumentTooLong if the size of either name or description of the plan is too long.
  • UnknownPrimaryNetwork if mapping parameter contains TestNetworkMapping with a network that does not exist on primary site.
  • UnknownSecondaryNetwork if mapping contains TestNetworkMapping with a network that does not exist on secondary site.

Faults

  • DirectionError
  • InvalidArgument
  • ProtectionGroupNotFound
  • RemoteSiteNotEnabled
  • RuntimeFault
  • StringArgumentTooLong

For information about the faults that Site Recovery Manager throws, see Faults in Site Recovery Manager API.