İngilizce dilinde oku

Aracılığıyla paylaş


REST API kullanarak Azure Sanal makinelerini geri yükleme

Bu makalede, REST API kullanarak Azure VM'sinin veya disklerinin nasıl geri yükleneceği açıklanmaktadır.

Önkoşullar

Azure Backup ile bir Azure VM yedeklemesini tamamladıktan sonra vm'lerin, disklerin veya dosyaların tamamını aynı yedekleme kopyasından geri yükleyebilirsiniz. Herhangi bir geri yükleme işlemi için önce ilgili kurtarma noktasını tanımlamanız gerekir.

Kurtarma noktasını seçin

Bir yedekleme öğesinin kullanılabilir kurtarma noktaları, liste kurtarma noktası REST API'sini kullanarak listelenebilir. Tüm ilgili değerleri içeren basit bir GET işlemidir.

GET https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints?api-version=2019-05-13

{containerName} ve {protectedItemName} burada oluşturulur. {fabricName} Azure.

GET URI'sinde gerekli tüm parametreler bulunur. Ek istek gövdesine gerek yoktur.

Yanıtlar

Adı Tür Açıklama
200 Tamam RecoveryPointResourceList Tamam

Örnek yanıt

GET URI'sı gönderildikten sonra 200 (Tamam) yanıtı döndürülür.

HTTP/1.1 200 OK
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id: 03453538-2f8d-46de-8374-143ccdf60f40
x-ms-client-request-id: c48f4436-ce3f-42da-b537-12710d4d1a24; c48f4436-ce3f-42da-b537-12710d4d1a24
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14998
x-ms-correlation-request-id: 03453538-2f8d-46de-8374-143ccdf60f40
x-ms-routing-request-id: SOUTHINDIA:20180604T071851Z:03453538-2f8d-46de-8374-143ccdf60f40
Cache-Control: no-cache
Date: Mon, 04 Jun 2018 07:18:51 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET

{
  "value": [
    {
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/microsoft.recoveryservices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;testRG;testVM/protectedItems/VM;testRG;testVM/recoveryPoints/20982486783671",
      "name": "20982486783671",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
      "properties": {
        "objectType": "IaasVMRecoveryPoint",
        "recoveryPointType": "AppConsistent",
        "recoveryPointTime": "2018-06-04T06:06:00.5121087Z",
        "recoveryPointAdditionalInfo": "",
        "sourceVMStorageType": "NormalStorage",
        "isSourceVMEncrypted": false,
        "isInstantIlrSessionActive": false,
        "recoveryPointTierDetails": [
          {
            "type": 1,
            "status": 1
          },
          {
            "type": 2,
            "status": 1
          }
        ],
        "isManagedVirtualMachine": true,
        "virtualMachineSize": "Standard_A1_v2",
        "originalStorageAccountOption": false
      }
    },
    {
      "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/microsoft.recoveryservices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;testRG;testVM/protectedItems/VM;testRG;testVM/recoveryPoints/23358112038108",
      "name": "23358112038108",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
      "properties": {
        "objectType": "IaasVMRecoveryPoint",
        "recoveryPointType": "CrashConsistent",
        "recoveryPointTime": "2018-06-03T06:20:56.3043878Z",
        "recoveryPointAdditionalInfo": "",
        "sourceVMStorageType": "NormalStorage",
        "isSourceVMEncrypted": false,
        "isInstantIlrSessionActive": false,
        "recoveryPointTierDetails": [
          {
            "type": 1,
            "status": 1
          },
          {
            "type": 2,
            "status": 1
          }
        ],
        "isManagedVirtualMachine": true,
        "virtualMachineSize": "Standard_A1_v2",
        "originalStorageAccountOption": false
      }
    },
......

Kurtarma noktası verilen yanıttaki {name} alanıyla tanımlanır.

Geri yükleme işlemleri

İlgili geri yükleme noktasını seçtikten sonra geri yükleme işlemini tetiklemeye devam edin.

Yedekleme öğesindeki tüm geri yükleme işlemleri aynı POST API ile gerçekleştirilir. Geri yükleme senaryolarıyla yalnızca istek gövdesi değişir.

Önemli

Çeşitli geri yükleme seçenekleri ve bağımlılıklarıyla ilgili tüm ayrıntılar burada belirtilmiştir. Bu işlemleri tetikleme işlemine devam etmeden önce lütfen gözden geçirin.

Geri yükleme işlemlerini tetikleme bir POST isteğidir. "Geri yüklemeyi tetikleme" REST API'si hakkında daha fazla bilgi edinin.

POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore?api-version=2019-05-13

{containerName} ve {protectedItemName} burada oluşturulur. {fabricName}"Azure" ve {recoveryPointId} yukarıda bahsedilen kurtarma noktasının alanıdır{name}.

Kurtarma noktası alındıktan sonra ilgili geri yükleme senaryosu için istek gövdesini oluşturun. Aşağıdaki bölümlerde her senaryo için istek gövdesi özetlenmiştir:

Yanıtı Geri Yükle

Herhangi bir geri yükleme işleminin tetiklenmesi zaman uyumsuz bir işlemdir. Bu, bu işlemin ayrı olarak izlenmesi gereken başka bir işlem oluşturduğu anlamına gelir.

İki yanıt döndürür: başka bir işlem oluşturulduğunda 202 (Kabul Edildi) ve bu işlem tamamlandığında 200 (Tamam) .

Adı Tür Açıklama
202 Kabul Edildi Kabul edildi

Örnek yanıtlar

Geri yükleme disklerini tetikleme için POST URI'sini gönderdikten sonra, ilk yanıt konum üst bilgisi veya Azure-async-header ile 202 (Kabul Edildi) olur.

HTTP/1.1 202 Accepted
Pragma: no-cache
Retry-After: 60
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/microsoft.recoveryservices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;testRG;testVM/protectedItems/vm;testRG;testVM/operationsStatus/781a0f18-e250-4d73-b059-5e9ffed4069e?api-version=2019-05-13
X-Content-Type-Options: nosniff
x-ms-request-id: 893fe372-8d6c-4c56-b589-45a95eeef95f
x-ms-client-request-id: a15ce064-25bd-4ac6-87e5-e3bc6ec65c0b; a15ce064-25bd-4ac6-87e5-e3bc6ec65c0b
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1198
x-ms-correlation-request-id: 893fe372-8d6c-4c56-b589-45a95eeef95f
x-ms-routing-request-id: SOUTHINDIA:20180604T130003Z:893fe372-8d6c-4c56-b589-45a95eeef95f
Cache-Control: no-cache
Date: Mon, 04 Jun 2018 13:00:03 GMT
Location: https://management.azure.com/subscriptions//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/microsoft.recoveryservices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;testRG;testVM/protectedItems/vm;testRG;testVM/operationResults/781a0f18-e250-4d73-b059-5e9ffed4069e?api-version=2019-05-13
X-Powered-By: ASP.NET

Ardından, basit bir GET komutuyla konum üst bilgisini veya Azure-AsyncOperation üst bilgisini kullanarak sonuçta elde edilen işlemi izleyin.

GET https://management.azure.com/subscriptions//subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/microsoft.recoveryservices/vaults/testVault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;testRG;testVM/protectedItems/vm;testRG;testVM/operationResults/781a0f18-e250-4d73-b059-5e9ffed4069e?api-version=2019-05-13

İşlem tamamlandıktan sonra, yanıt gövdesinde sonuçta elde edilen geri yükleme işinin kimliğiyle 200 (Tamam) döndürür.

HTTP/1.1 200 OK
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id: ea2a8011-eb83-4a4b-9ed2-e694070a966a
x-ms-client-request-id: a7f3a144-ed80-41ee-bffe-ae6a90c35a2f; a7f3a144-ed80-41ee-bffe-ae6a90c35a2f
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 14973
x-ms-correlation-request-id: ea2a8011-eb83-4a4b-9ed2-e694070a966a
x-ms-routing-request-id: SOUTHINDIA:20180604T130917Z:ea2a8011-eb83-4a4b-9ed2-e694070a966a
Cache-Control: no-cache
Date: Mon, 04 Jun 2018 13:09:17 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET

{
  "id": "781a0f18-e250-4d73-b059-5e9ffed4069e",
  "name": "781a0f18-e250-4d73-b059-5e9ffed4069e",
  "status": "Succeeded",
  "startTime": "2018-06-04T13:00:03.8068176Z",
  "endTime": "2018-06-04T13:00:03.8068176Z",
  "properties": {
    "objectType": "OperationStatusJobExtendedInfo",
    "jobId": "3021262a-fb3a-4538-9b37-e3e97a386093"
  }
}

Geri yükleme işi uzun süre çalışan bir işlem olduğundan, REST API belgesi kullanılarak izleme işlerinde açıklandığı gibi izlenmelidir.

Diskleri geri yükleme

Yedekleme verilerinden VM oluşturma işlemini özelleştirmek gerekiyorsa, diskleri seçilen bir depolama hesabına geri yükleyin ve bu disklerden gereksinimlerine göre bir VM oluşturun. Depolama hesabının Kurtarma Hizmetleri kasasıyla aynı bölgede olması ve alanlar arası yedekli olmaması gerekir. Diskler ve yedeklenen VM'nin ("vmconfig.json") yapılandırması verilen depolama hesabında depolanır. Burada açıklandığı gibi, diskleri geri yüklemek için ilgili istek gövdesi aşağıda verilmiştir.

İstek gövdesi oluşturma

Azure VM yedeklemesinden disk geri yüklemesini tetikleme için, istek gövdesinin bileşenleri şunlardır:

Adı Tür Açıklama
özellikler IaaSVMRestoreRequest RestoreRequestResourceProperties

İstek gövdesi tanımlarının tam listesi ve diğer ayrıntılar için rest API'yi geri yükleme tetikleyicisi makalesine bakın.

Örnek istek

Aşağıdaki istek gövdesi, disk geri yüklemesini tetikleme için gereken özellikleri tanımlar:

{
  "properties": {
    "objectType": "IaasVMRestoreRequest",
    "recoveryPointId": "20982486783671",
    "recoveryType": "RestoreDisks",
    "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
    "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testAccount",
    "region": "westus",
    "createNewCloudService": false,
    "originalStorageAccountOption": false,
    "encryptionDetails": {
      "encryptionEnabled": false
    }
  }
}

Diskleri seçmeli olarak geri yükleme

Diskleri seçmeli olarak yedeklediyseniz, geçerli yedeklenen disk listesi kurtarma noktası özetinde ve ayrıntılı yanıtta sağlanır. Ayrıca diskleri seçmeli olarak geri yükleyebilirsiniz ve burada daha fazla ayrıntı sağlanır. Yedeklenen diskler listesi arasında bir diski seçmeli olarak geri yüklemek için, kurtarma noktası yanıtından diskin LUN'sini bulun ve aşağıda gösterildiği gibi yukarıdaki istek gövdesine restoreDiskLunList özelliğini ekleyin.

{
    "properties": {
        "objectType": "IaasVMRestoreRequest",
        "recoveryPointId": "20982486783671",
        "recoveryType": "RestoreDisks",
        "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
        "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testAccount",
        "region": "westus",
        "createNewCloudService": false,
        "originalStorageAccountOption": false,
        "encryptionDetails": {
          "encryptionEnabled": false
        },
        "restoreDiskLunList" : [0]
    }
}

Burada açıklandığı gibi yanıtı izledikten ve uzun süre çalışan iş tamamlandığında, diskler ve yedeklenen sanal makinenin yapılandırması ("VMConfig.json") verilen depolama hesabında görünür.

Yedeklenen sanal makinedeki diskleri değiştirme

Geri yükleme diskleri kurtarma noktasından diskler oluştururken, diskleri değiştir, yedeklenen VM'nin geçerli disklerini kurtarma noktasındaki disklerle değiştirir. Burada açıklandığı gibi, diskleri değiştirmek için ilgili istek gövdesi aşağıda verilmiştir.

İstek gövdesi oluşturma

Azure VM yedeklemesinden disk değişimini tetikleme için, istek gövdesinin bileşenleri aşağıdadır.

Adı Tür Açıklama
özellikler IaaSVMRestoreRequest RestoreRequestResourceProperties

İstek gövdesi tanımlarının tam listesi ve diğer ayrıntılar için REST API'yi geri yükleme belgesini tetikleme bölümüne bakın.

Örnek istek

Aşağıdaki istek gövdesi, disk geri yükleme işlemini tetikleme için gereken özellikleri tanımlar.

{
    "properties": {
        "objectType": "IaasVMRestoreRequest",
        "recoveryPointId": "20982486783671",
        "recoveryType": "OriginalLocation",
        "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
        "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testAccount",  
        "region": "westus",
        "createNewCloudService": false,
        "originalStorageAccountOption": false,
        "affinityGroup": "",
        "diskEncryptionSetId": null,
        "subnetId": null,
        "targetDomainNameId": null,
        "targetResourceGroupId": null,
        "targetVirtualMachineId": null,
        "virtualNetworkId": null
     }
}

Başka bir sanal makine olarak geri yükleme

Yukarıda açıklandığı gibi, aşağıdaki istek gövdesi bir sanal makine geri yüklemesini tetiklemeniz için gereken özellikleri tanımlar.

{
  "properties": {
          "objectType":  "IaasVMRestoreRequest",
          "recoveryPointId": "348916168024334",
          "recoveryType": "AlternateLocation",
          "sourceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testVM",
          "targetVirtualMachineId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/targetRG/providers/Microsoft.Compute/virtualmachines/targetVM",
          "targetResourceGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/targetRG",
          "storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testingAccount",
          "virtualNetworkId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/targetRG/providers/Microsoft.Network/virtualNetworks/testNet",
          "subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/targetRG/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default",
          "region": "westus",
          "createNewCloudService": false,
          "originalStorageAccountOption": false,
          "encryptionDetails": {
            "encryptionEnabled": false
          }
     }
 }

Yanıt, diskleri geri yüklemek için yukarıda açıklanan şekilde işlenmelidir.

Bölgeler Arası Geri Yükleme

VM'lerinizi koruduğunuz kasada Bölgeler Arası Geri Yükleme (CRR) etkinleştirildiyse yedekleme verileri ikincil bölgeye çoğaltılır. Geri yükleme işlemi gerçekleştirmek için yedekleme verilerini kullanabilirsiniz. REST API kullanarak ikincil bölgede geri yükleme işlemini tetikleme için şu adımları izleyin:

İkincil bölgede kurtarma noktası seçme

CRR için kurtarma noktalarını listele REST API'sini kullanarak ikincil bölgedeki bir yedekleme öğesinin kullanılabilir kurtarma noktalarını listeleyebilirsiniz. Tüm ilgili değerleri içeren basit bir GET işlemidir.

GET https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints?api-version=2018-12-20

{containerName} ve {protectedItemName} burada oluşturulur. {fabricName} Azure.

GET URI'sinde gerekli tüm parametreler bulunur. Ek istek gövdesi gerekmez.

Not

İkincil bölgede kurtarma noktaları almak için yukarıdaki örnekte olduğu gibi API sürüm 2018-12-20'yi kullanın.

Yanıtlar

Adı Tür Açıklama
200 Tamam RecoveryPointResourceList Tamam

Örnek yanıt

GET URI'sı gönderildikten sonra 200 (Tamam) yanıtı döndürülür.

Headers:
Pragma                        : no-cache
X-Content-Type-Options        : nosniff
x-ms-request-id               : bfc4a4e6-c585-46e0-8e38-f11a86093701
x-ms-client-request-id        : 4344a9c2-70d8-482d-b200-0ca9cc498812,4344a9c2-70d8-482d-b200-0ca9cc498812
Strict-Transport-Security     : max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-resource-requests: 149
x-ms-correlation-request-id   : bfc4a4e6-c585-46e0-8e38-f11a86093701
x-ms-routing-request-id       : SOUTHINDIA:20210731T112441Z:bfc4a4e6-c585-46e0-8e38-f11a86093701
Cache-Control                 : no-cache
Date                          : Sat, 31 Jul 2021 11:24:40 GMT
Server                        : Microsoft-IIS/10.0
X-Powered-By                  : ASP.NET

Body:
{
  "value": [
    {
      "id":
"/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG1;testVM/protectedItems/VM;iaasvmcontainerv2;testRG1;testVM/recoveryPoints/932895704780058094",
      "name": "932895704780058094",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
      "properties": {
        "objectType": "IaasVMRecoveryPoint",
        "recoveryPointType": "CrashConsistent",
        "recoveryPointTime": "2021-07-31T09:24:34.687561Z",
        "recoveryPointAdditionalInfo": "",
        "sourceVMStorageType": "PremiumVMOnPartialPremiumStorage",
        "isSourceVMEncrypted": false,
        "isInstantIlrSessionActive": false,
        "recoveryPointTierDetails": [
          {
            "type": 1,
            "status": 1
          }
        ],
        "isManagedVirtualMachine": true,
        "virtualMachineSize": "Standard_D2s_v3",
        "originalStorageAccountOption": false,
        "osType": "Windows"
      }
    },
    {
      "id":
"/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG1;testVM/protectedItems/VM;iaasvmcontainerv2;testRG1;testVM/recoveryPoints/932891484644960954",
      "name": "932891484644960954",
      "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
      "properties": {
        "objectType": "IaasVMRecoveryPoint",
        "recoveryPointType": "CrashConsistent",
        "recoveryPointTime": "2021-07-30T09:20:01.8355052Z",
        "recoveryPointAdditionalInfo": "",
        "sourceVMStorageType": "PremiumVMOnPartialPremiumStorage",
        "isSourceVMEncrypted": false,
        "isInstantIlrSessionActive": false,
        "recoveryPointTierDetails": [
          {
            "type": 1,
            "status": 1
          },
          {
            "type": 2,
            "status": 1
          }
        ],
        "isManagedVirtualMachine": true,
        "virtualMachineSize": "Standard_D2s_v3",
        "originalStorageAccountOption": false,
        "osType": "Windows"
      }
    },
.....

Kurtarma noktası, yukarıdaki yanıttaki {name} alanıyla tanımlanır.

Erişim belirteci alma

Bölgeler arası geri yükleme gerçekleştirmek için, ikincil bölgedeki çoğaltılmış geri yükleme noktalarına erişim isteğinizi yetkilendirmek için bir erişim belirtecine ihtiyacınız vardır. Erişim belirteci almak için şu adımları izleyin:

1. Adım:

İkincil bölge için AAD özelliklerini almak için AAD Özellikleri API'sini kullanın (aşağıdaki örnekte westus):

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/westus/backupAadProperties?api-version=2018-12-20
Yanıt örneği

Yanıt aşağıdaki biçimde döndürülür:

{
  "properties": {
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "audience": "https://RecoveryServices/IaasCoord/aadmgmt/wus",
    "servicePrincipalObjectId": "00000000-0000-0000-0000-000000000000"
  }
}

2. Adım:

İkincil bölgedeki çoğaltılmış geri yükleme noktalarına erişim isteğinizi yetkilendirmek için Erişim Belirteci Al API'sini kullanın:

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken?api-version=2018-12-20

İstek gövdesi için, önceki adımda AAD Özellikleri API'sinin döndürdiği yanıtın içeriğini yapıştırın.

{
  "properties": {
    "tenantId": "00000000-0000-0000-0000-000000000000",
    "audience": "https://RecoveryServices/IaasCoord/aadmgmt/wus",
    "servicePrincipalObjectId": "00000000-0000-0000-0000-000000000000"
  }
}
Yanıt örneği

Yanıt aşağıdaki biçimde döndürülür:

{
	"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVaultRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG1;testVM/protectedItems/VM;iaasvmcontainerv2;testRG1;testVM/recoveryPoints/26083826328862",
  "name": "932879774590051503",
  "type": "Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints",
	"properties": {
		"objectType": "CrrAccessToken",
		"accessTokenString": "<access-token-string>",
		"subscriptionId": "00000000-0000-0000-0000-000000000000",
		"resourceGroupName": "testVaultRG",
		"resourceName": "testVault",
		"resourceId": "000000000000000000",
		"protectionContainerId": 000000,
		"recoveryPointId": "932879774590051503",
		"recoveryPointTime": "7/26/2021 3:35:36 PM",
		"containerName": "iaasvmcontainerv2;testRG1;testVM",
		"containerType": "IaasVMContainer",
		"backupManagementType": "AzureIaasVM",
		"datasourceType": "VM",
		"datasourceName": "testvm1234",
		"datasourceId": "000000000000000000",
		"datasourceContainerName": "iaasvmcontainerv2;testRG1;testVM",
		"coordinatorServiceStampUri": "https://pod01-coord1.eus.backup.windowsazure.com",
		"protectionServiceStampId": "00000000-0000-0000-0000-000000000000",
		"protectionServiceStampUri": "https://pod01-prot1h-int.eus.backup.windowsazure.com",
		"tokenExtendedInformation": "<IaaSVMRecoveryPointMetadataBase xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" i:type=\"IaaSVMRecoveryPointMetadata_V2015_09\" xmlns=\"http://windowscloudbackup.com/CloudCommon/V2011_09\"><MetadataVersion>V2015_09</MetadataVersion><ContainerType i:nil=\"true\" /><InstantRpGCId>ef4ab5a7-c2c0-4304-af80-af49f48af3d1;AzureBackup_testvm1234_932843259176972511;AzureBackup_20210726_033536;AzureBackupRG_eastus_1</InstantRpGCId><IsBlockBlobEnabled>true</IsBlockBlobEnabled><IsManagedVirtualMachine>true</IsManagedVirtualMachine><OriginalSAOption>false</OriginalSAOption><OsType>Windows</OsType><ReadMetadaFromConfigBlob i:nil=\"true\" /><RecoveryPointConsistencyType>CrashConsistent</RecoveryPointConsistencyType><RpDiskDetails i:nil=\"true\" /><SourceIaaSVMRPKeyAndSecret i:nil=\"true\" /><SourceIaaSVMStorageType>PremiumVMOnPartialPremiumStorage</SourceIaaSVMStorageType><VMSizeDescription>Standard_D2s_v3</VMSizeDescription><Zones xmlns:d2p1=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" i:nil=\"true\" /></IaaSVMRecoveryPointMetadataBase>",
		"rpTierInformation": {
			"InstantRP": "Valid",
			"HardenedRP": "Valid"
		},
		"rpOriginalSAOption": false,
		"rpIsManagedVirtualMachine": true,
		"rpVMSizeDescription": "Standard_D2s_v3",
		"bMSActiveRegion": "EastUS"
	}
}

Diskleri ikincil bölgeye geri yükleme

Bir öğeyi ikincil bölgeye geri yüklemek için Bölgeler Arası Geri Yükleme Tetikleyici API'sini kullanın.

POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore?api-version=2018-12-20

İstek gövdesinin iki bölümü olmalıdır:

  1. crossRegionRestoreAccessDetails: İstek gövdesinin bu kesimini doldurmak için önceki adımda gerçekleştirilen Erişim Belirteci Alma API'sinden yanıtın özellikler bloğunu yapıştırın.

  2. restoreRequest: İstek gövdesinin restoreRequest kesimini doldurmak için, daha önce elde edilen kurtarma noktası kimliğini ve kaynak VM'nin Azure Resource Manager (ARM) kimliğini ve hazırlama konumu olarak kullanılacak ikincil bölgedeki depolama hesabının ayrıntılarını geçirmeniz gerekir. Disk geri yükleme gerçekleştirmek için kurtarma türü olarak RestoreDisks'i belirtin.

Aşağıda, bir VM'nin disklerini ikincil bölgeye geri yüklemek için örnek bir istek gövdesi verilmiştir:

 {
  "crossRegionRestoreAccessDetails": {
        "objectType": "CrrAccessToken",
	    "accessTokenString": "<access-token-string>",
	    "subscriptionId": "00000000-0000-0000-0000-000000000000",
	    "resourceGroupName": "azurefiles",
	    "resourceName": "azurefilesvault",
	    "resourceId": "000000000000000000",
	    "protectionContainerId": 000000,
	    "recoveryPointId": "932879774590051503",
	    "recoveryPointTime": "7/26/2021 3:35:36 PM",
	    "containerName": "iaasvmcontainerv2;testRG1;testVM",
	    "containerType": "IaasVMContainer",
	    "backupManagementType": "AzureIaasVM",
		"datasourceType": "VM",
		"datasourceName": "testvm1234",
		"datasourceId": "000000000000000000",
		"datasourceContainerName": "iaasvmcontainerv2;testRG1;testVM",
		"coordinatorServiceStampUri": "https://pod01-coord1.eus.backup.windowsazure.com",
		"protectionServiceStampId": "00000000-0000-0000-0000-000000000000",
		"protectionServiceStampUri": "https://pod01-prot1h-int.eus.backup.windowsazure.com",
		"tokenExtendedInformation": "<IaaSVMRecoveryPointMetadataBase xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" i:type=\"IaaSVMRecoveryPointMetadata_V2015_09\" xmlns=\"http://windowscloudbackup.com/CloudCommon/V2011_09\"><MetadataVersion>V2015_09</MetadataVersion><ContainerType i:nil=\"true\" /><InstantRpGCId>ef4ab5a7-c2c0-4304-af80-af49f48af3d1;AzureBackup_testvm1234_932843259176972511;AzureBackup_20210726_033536;AzureBackupRG_eastus_1</InstantRpGCId><IsBlockBlobEnabled>true</IsBlockBlobEnabled><IsManagedVirtualMachine>true</IsManagedVirtualMachine><OriginalSAOption>false</OriginalSAOption><OsType>Windows</OsType><ReadMetadaFromConfigBlob i:nil=\"true\" /><RecoveryPointConsistencyType>CrashConsistent</RecoveryPointConsistencyType><RpDiskDetails i:nil=\"true\" /><SourceIaaSVMRPKeyAndSecret i:nil=\"true\" /><SourceIaaSVMStorageType>PremiumVMOnPartialPremiumStorage</SourceIaaSVMStorageType><VMSizeDescription>Standard_D2s_v3</VMSizeDescription><Zones xmlns:d2p1=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" i:nil=\"true\" /></IaaSVMRecoveryPointMetadataBase>",
		"rpTierInformation": {
			"InstantRP": "Valid",
			"HardenedRP": "Valid"
		},
		"rpOriginalSAOption": false,
		"rpIsManagedVirtualMachine": true,
		"rpVMSizeDescription": "Standard_D2s_v3",
		"bMSActiveRegion": "EastUS"
    },
    "restoreRequest": {
        "affinityGroup": "",
        "createNewCloudService": false,
        "encryptionDetails": {
            "encryptionEnabled": false
        },
        "objectType": "IaasVMRestoreRequest",
        "recoveryPointId": "932879774590051503",
        "recoveryType": "RestoreDisks",
        "sourceResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG1/providers/Microsoft.Compute/virtualMachines/testVM",
        "targetResourceGroupId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG1",
        "storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG1/providers/Microsoft.Storage/storageAccounts/testStorageAccount",
        "region": "westus",
        "affinityGroup": "",
        "createNewCloudService": false,
        "originalStorageAccountOption": false,
        "restoreDiskLunList": []
    }
}

Birincil bölge geri yükleme işlemine benzer şekilde, bu zaman uyumsuz bir işlemdir ve ayrı olarak izlenmesi gerekir.

Sonraki adımlar

Azure Backup REST API'leri hakkında daha fazla bilgi için aşağıdaki belgelere bakın: