[{"label":"Latest (2.0.0)","version":"latest"},{"version":"1.0.0"}]
srm-rest-api

Update VM Protection Settings

Description

Update the protection settings of a virtual machine. This endpoint must be called after the remove protection operation in order for the VM to be recovered during recovery.

Request

Request

URL

URL


put
https://{api_host}//pairings/{pairing_id}/protection-management/groups/{group_id}/vms/{vm_id}/protection-settings
Copy

Path Parameters

Path Parameters

string
pairing_id Required

The ID of a pairing between this Site Recovery Manager server and remote one.


string
group_id Required

The ID of a protection group defined within current pairing.


string
vm_id Required

The ID of a protected virtual machine.


Request Body

Request Body

VmProtectionSettings of mimetype application/json Required

A spec describing the new VM protection settings.

{
	"change_version": "string",
	"devices": [
		{
			"backing": "FILE",
			"detached": false,
			"key": 0,
			"label": "string",
			"production_datastores": [
				"string"
			],
			"production_path": {
				"datastore": "string",
				"datastore_name": "local",
				"filename": "finance-vm.vmdk",
				"friendly_path": "string",
				"path": "vms/finance-vm"
			},
			"recovery_path": {
				"datastore": "string",
				"datastore_name": "local",
				"filename": "finance-vm.vmdk",
				"friendly_path": "string",
				"path": "vms/finance-vm"
			},
			"replicated": false,
			"type": "HARD_DRIVE"
		}
	],
	"folder": {
		"editable": false,
		"is_inventory_mapped_target": false,
		"source": "string",
		"source_has_inventory_mapping": false,
		"source_name": "string",
		"target": "string",
		"target_name": "string"
	},
	"host": {
		"editable": false,
		"is_inventory_mapped_target": false,
		"source": "string",
		"source_has_inventory_mapping": false,
		"source_name": "string",
		"target": "string",
		"target_name": "string"
	},
	"location": {
		"name": "string",
		"placeholder_vm": "string",
		"placeholder_vm_path": {
			"datastore": "string",
			"datastore_name": "local",
			"filename": "finance-vm.vmdk",
			"friendly_path": "string",
			"path": "vms/finance-vm"
		},
		"production_vm_path": {
			"datastore": "string",
			"datastore_name": "local",
			"filename": "finance-vm.vmdk",
			"friendly_path": "string",
			"path": "vms/finance-vm"
		},
		"protected_site": "string",
		"recovery_site": "string"
	},
	"networks": [
		{
			"editable": false,
			"index": 0,
			"is_inventory_mapped_target": false,
			"key": 0,
			"source": "string",
			"source_has_inventory_mapping": false,
			"source_name": "string",
			"source_network_nsx_backed": false,
			"target": "string",
			"target_name": "string",
			"target_network_nsx_backed": false
		}
	],
	"placeholder_needs_repair": false,
	"resource_pool": {
		"editable": false,
		"is_inventory_mapped_target": false,
		"source": "string",
		"source_has_inventory_mapping": false,
		"source_name": "string",
		"target": "string",
		"target_name": "string"
	}
}
string
change_version Optional

Version number of these settings. Keep this if need to update the VM protection settings. Applicable only if the VM is protected.


devices Optional

List of VM devices, including hard disks, optical disks and floppy disks


folder Optional

Details about a protection resource of a VM. For example: folder, resource pool, host, network.


host Optional

Details about a protection resource of a VM. For example: folder, resource pool, host, network.


location Optional

Location details about a protected virtual machine.


networks Optional

List of VM networks


boolean
placeholder_needs_repair Optional

Whether repair placeholder operation is required. If true, only repair placeholder is possible and not configure protection.


resource_pool Optional

Details about a protection resource of a VM. For example: folder, resource pool, host, network.

Authentication

Authentication

This operation uses the following authentication methods.

Response

Response

Response Body

Response Body

202 Accepted

Returns TaskDrResponseEntity of type application/json

A task to monitor the operation progress

{
	"_meta": {
		"errors": [
			{
				"code": "string",
				"field": "string",
				"message": "string"
			}
		]
	},
	"complete_time": 0,
	"description": "string",
	"description_id": "string",
	"entity": "string",
	"entity_name": "string",
	"error": {
		"details": "string",
		"message": "string"
	},
	"id": "string",
	"progress": 0,
	"queued_time": 0,
	"result": {},
	"start_time": 0,
	"status": "QUEUED"
}
_meta Optional

Response meta data. Contains data about the response payload data.

Errors

Errors

ResponseError
400

Bad request - the server could not understand the request due to invalid syntax or invalid request body content


401

Unauthorized - the client must authenticate itself to get the requested response


ResponseError
403

Forbidden - not sufficient access rights to fulfill the request


404

Not Found - server cannot find the requested in URL resource


ResponseError
500

Internal server error - unexpected condition prevents fulfilling the request

Code Samples

Code Samples

PowerCLI Client SDK Example

$FriendlyDatastorePathData = Initialize-SrmFriendlyDatastorePathData -Datastore "MyDatastore" -DatastoreName "local" -Path "vms/finance-vm" -Filename "finance-vm.vmdk" -FriendlyPath "MyFriendlyPath"
$VmLocationData = Initialize-SrmVmLocationData -Name "MyName" -ProtectedSite "MyProtectedSite" -ProductionVmPath $FriendlyDatastorePathData -RecoverySite "MyRecoverySite" -PlaceholderVmPath $FriendlyDatastorePathData -PlaceholderVm "MyPlaceholderVm"
$VmProtectionDevice = Initialize-SrmVmProtectionDevice -Key 0 -Type "HARD_DRIVE" -Backing "FILE" -Label "MyLabel" -ProductionPath $FriendlyDatastorePathData -ProductionDatastores "MyProductionDatastores" -RecoveryPath $FriendlyDatastorePathData -Replicated $false -Detached $false
$VmProtectionNetwork = Initialize-SrmVmProtectionNetwork -Editable $false -Source "MySource" -SourceName "MySourceName" -Target "MyTarget" -TargetName "MyTargetName" -IsInventoryMappedTarget $false -SourceHasInventoryMapping $false
$VmProtectionLocation = Initialize-SrmVmProtectionLocation -Editable $false -Source "MySource" -SourceName "MySourceName" -Target "MyTarget" -TargetName "MyTargetName" -IsInventoryMappedTarget $false -SourceHasInventoryMapping $false
$VmProtectionSettings = Initialize-SrmVmProtectionSettings -PlaceholderNeedsRepair $false -Location $VmLocationData -Devices $VmProtectionDevice -Networks $VmProtectionNetwork -Folder $VmProtectionLocation -ResourcePool $VmProtectionLocation -Host $VmProtectionLocation -ChangeVersion "MyChangeVersion"
Invoke-SrmUpdateVmProtectionSettings -pairingId "MypairingId" -groupId "MygroupId" -vmId "MyvmId" -vmProtectionSettings $vmProtectionSettings

cURL Command

curl -X PUT -H "Content-Type: application/json" -d '{"change_version":"string","devices":[{"backing":"FILE","detached":false,"key":0,"label":"string","production_datastores":["string"],"production_path":{"datastore":"string","datastore_name":"local","filename":"finance-vm.vmdk","friendly_path":"string","path":"vms/finance-vm"},"recovery_path":{"datastore":"string","datastore_name":"local","filename":"finance-vm.vmdk","friendly_path":"string","path":"vms/finance-vm"},"replicated":false,"type":"HARD_DRIVE"}],"folder":{"editable":false,"is_inventory_mapped_target":false,"source":"string","source_has_inventory_mapping":false,"source_name":"string","target":"string","target_name":"string"},"host":{"editable":false,"is_inventory_mapped_target":false,"source":"string","source_has_inventory_mapping":false,"source_name":"string","target":"string","target_name":"string"},"location":{"name":"string","placeholder_vm":"string","placeholder_vm_path":{"datastore":"string","datastore_name":"local","filename":"finance-vm.vmdk","friendly_path":"string","path":"vms/finance-vm"},"production_vm_path":{"datastore":"string","datastore_name":"local","filename":"finance-vm.vmdk","friendly_path":"string","path":"vms/finance-vm"},"protected_site":"string","recovery_site":"string"},"networks":[{"editable":false,"index":0,"is_inventory_mapped_target":false,"key":0,"source":"string","source_has_inventory_mapping":false,"source_name":"string","source_network_nsx_backed":false,"target":"string","target_name":"string","target_network_nsx_backed":false}],"placeholder_needs_repair":false,"resource_pool":{"editable":false,"is_inventory_mapped_target":false,"source":"string","source_has_inventory_mapping":false,"source_name":"string","target":"string","target_name":"string"}}' https://{api_host}/pairings/{pairing_id}/protection-management/groups/{group_id}/vms/{vm_id}/protection-settings
Vendor Extensions

Vendor Extensions

This operation contains the following vendor extensions defined in the spec:
x-dr-permissions:
    permissions:
        - System.View
        - System.Read
        - VcDr.ProtectionProfile.com.vmware.vcDr.Edit
x-dr-remote-site-connectivity-contract:
    not-authenticated: ERROR
    server-down: ERROR


Feedback

Was this page helpful?