Kopie van VM-herstelpunten in meerdere regio's
In dit artikel leert u hoe u herstelpunten van virtuele machines (VM's) naar een andere regio kopieert.
Vereisten
Als u een herstelpunt in een regio wilt kopiëren, moet u een restorePointCollection
resource in de doelregio vooraf maken.
Meer informatie over kopiëren tussen regio's en de beperking ervan voordat u herstelpunten kopieert.
Een verzameling herstelpunten maken in een doelregio
De eerste stap bij het kopiëren van een bestaand VM-herstelpunt van de ene regio naar de andere is het maken van een restorePointCollection
resource in de doelregio door te restorePointCollection
verwijzen naar de bronregio.
URI-aanvraag
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}&api-version={api-version}
Aanvraagtekst
{
"name": "name of target restorePointCollection resource",
"location": "location of target restorePointCollection resource",
"tags": {
"department": "finance"
},
"properties": {
"source": {
"id": "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/restorePointCollections/{restorePointCollectionName}"
}
}
}
De respons
Het aanvraagantwoord bevat een statuscode en een set antwoordheaders.
Statuscode
De bewerking retourneert 201 tijdens het maken en 200 tijdens de update.
Hoofdtekst van de reactie
{
"name": "name of the copied restorePointCollection resource",
"id": "CSM Id of copied restorePointCollection resource",
"type": "Microsoft.Compute/restorePointCollections",
"location": "location of the copied restorePointCollection resource",
"tags": {
"department": "finance"
},
"properties": {
"source": {
"id": "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/restorePointCollections/{restorePointCollectionName}",
"location": "location of source RPC"
}
}
}
Een VM-herstelpunt maken in een doelregio
De volgende stap is het activeren van de kopie van een herstelpunt in de doelresource RestorePointCollection
door te verwijzen naar het herstelpunt in de bronregio die moet worden gekopieerd.
URI-aanvraag
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}&api-version={api-version}
Aanvraagtekst
{
"name": "name of the restore point resource",
"properties": {
"sourceRestorePoint": {
"id": "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
}
}
}
Notitie
De locatie wordt sourceRestorePoint
afgeleid van die van de bron RestorePointCollection
.
Respons
Het aanvraagantwoord bevat een statuscode en een set antwoordheaders.
Statuscode
Deze bewerking wordt lang uitgevoerd, dus de bewerking retourneert 201 tijdens het maken. De client zal naar verwachting een poll uitvoeren op de status met behulp van de bewerking. Voor dit doel worden zowel de als de location
Azure-AsyncOperation
headers verstrekt.
Tijdens het maken van herstelpunten wordt ProvisioningState
dit weergegeven als Creating
in het ANTWOORD van de GET-herstelpunt-API. Als het maken mislukt, ProvisioningState
wordt deze weergegeven als Failed
. ProvisioningState
is ingesteld op Succeeded
wanneer het kopiëren van gegevens tussen regio's wordt gestart.
Notitie
U kunt de kopieerstatus bijhouden door de GET-exemplaarweergave (?$expand=instanceView
) aan te roepen op het herstelpunt van de doel-VM. Zie de sectie 'Get the VM restore points Copy/Replication status'. Het VM-herstelpunt wordt beschouwd als bruikbaar (kan alleen worden gebruikt om een VIRTUELE machine te herstellen) wanneer een kopie van alle schijfherstelpunten is geslaagd.
Hoofdtekst van de reactie
{
"id": "CSM Id of the restore point",
"name": "name of the restore point",
"properties": {
"optionalProperties": "opaque bag of properties to be passed to extension",
"sourceRestorePoint": {
"id": "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
},
"consistencyMode": "CrashConsistent | FileSystemConsistent | ApplicationConsistent",
"sourceMetadata": {
"vmId": "Unique Guid of the VM from which the restore point was created",
"location": "source VM location",
"hardwareProfile": {
"vmSize": "Standard_A1"
},
"osProfile": {
"computername": "",
"adminUsername": "",
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.KeyVault/vaults/<keyvault-name>"
},
"vaultCertificates": [
{
"certificateUrl": "https://<keyvault-name>.vault.azure.net/secrets/<secret-name>/<secret-version>",
"certificateStore": "certificateStoreName on Windows"
}
]
}
],
"customData": "",
"windowsConfiguration": {
"provisionVMAgent": "true|false",
"winRM": {
"listeners": [
{
"protocol": "http"
},
{
"protocol": "https",
"certificateUrl": ""
}
]
},
"additionalUnattendContent": [
{
"pass": "oobesystem",
"component": "Microsoft-Windows-Shell-Setup",
"settingName": "FirstLogonCommands|AutoLogon",
"content": "<XML unattend content>"
}
],
"enableAutomaticUpdates": "true|false"
},
"linuxConfiguration": {
"disablePasswordAuthentication": "true|false",
"ssh": {
"publicKeys": [
{
"path": "Path-Where-To-Place-Public-Key-On-VM",
"keyData": "PEM-Encoded-public-key-file"
}
]
}
}
},
"storageProfile": {
"osDisk": {
"osType": "Windows|Linux",
"name": "OSDiskName",
"diskSizeGB": "10",
"caching": "ReadWrite",
"managedDisk": {
"id": "CSM Id of the managed disk",
"storageAccountType": "Standard_LRS"
},
"diskRestorePoint": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/restorePointCollections/<rpcName>/restorePoints/<rpName>/diskRestorePoints/<diskRestorePointName>"
}
},
"dataDisks": [
{
"lun": "0",
"name": "datadisk0",
"diskSizeGB": "10",
"caching": "ReadWrite",
"managedDisk": {
"id": "CSM Id of the managed disk",
"storageAccountType": "Standard_LRS"
},
"diskRestorePoint": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/restorePointCollections/<rpcName>/restorePoints/<rpName>/diskRestorePoints/<diskRestorePointName>"
}
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": " http://storageaccount.blob.core.windows.net/"
}
}
},
"provisioningState": "Succeeded | Failed | Creating | Deleting",
"provisioningDetails": {
"creationTime": "Creation Time of Restore point in UTC"
}
}
}
De kopieer-/replicatiestatus van de VM-herstelpunten ophalen
Nadat de kopie van VM-herstelpunten is gestart, kunt u de kopieerstatus bijhouden door de GET-exemplaarweergave (?$expand=instanceView
) aan te roepen op het doel-VM-herstelpunt.
URI-aanvraag
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}?$expand=instanceView&api-version={api-version}
Respons
{
"id": "CSM Id of the restore point",
"name": "name of the restore point",
"properties": {
"optionalProperties": "opaque bag of properties to be passed to extension",
"sourceRestorePoint": {
"id": "/subscriptions/{subid}/resourceGroups/{resourceGroupName}/providers/microsoft.compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}"
},
"consistencyMode": "CrashConsistent | FileSystemConsistent | ApplicationConsistent",
"sourceMetadata": {
"vmId": "Unique Guid of the VM from which the restore point was created",
"location": "source VM location",
"hardwareProfile": {
"vmSize": "Standard_A1"
},
"osProfile": {
"computername": "",
"adminUsername": "",
"secrets": [
{
"sourceVault": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/providers/Microsoft.KeyVault/vaults/<keyvault-name>"
},
"vaultCertificates": [
{
"certificateUrl": "https://<keyvault-name>.vault.azure.net/secrets/<secret-name>/<secret-version>",
"certificateStore": "certificateStoreName on Windows"
}
]
}
],
"customData": "",
"windowsConfiguration": {
"provisionVMAgent": "true|false",
"winRM": {
"listeners": [
{
"protocol": "http"
},
{
"protocol": "https",
"certificateUrl": ""
}
]
},
"additionalUnattendContent": [
{
"pass": "oobesystem",
"component": "Microsoft-Windows-Shell-Setup",
"settingName": "FirstLogonCommands|AutoLogon",
"content": "<XML unattend content>"
}
],
"enableAutomaticUpdates": "true|false"
},
"linuxConfiguration": {
"disablePasswordAuthentication": "true|false",
"ssh": {
"publicKeys": [
{
"path": "Path-Where-To-Place-Public-Key-On-VM",
"keyData": "PEM-Encoded-public-key-file"
}
]
}
}
},
"storageProfile": {
"osDisk": {
"osType": "Windows|Linux",
"name": "OSDiskName",
"diskSizeGB": "10",
"caching": "ReadWrite",
"managedDisk": {
"id": "CSM Id of the managed disk",
"storageAccountType": "Standard_LRS"
},
"diskRestorePoint": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/restorePointCollections/<rpcName>/restorePoints/<rpName>/diskRestorePoints/<diskRestorePointName>"
}
},
"dataDisks": [
{
"lun": "0",
"name": "datadisk0",
"diskSizeGB": "10",
"caching": "ReadWrite",
"managedDisk": {
"id": "CSM Id of the managed disk",
"storageAccountType": "Standard_LRS"
},
"diskRestorePoint": {
"id": "/subscriptions/<subId>/resourceGroups/<rgName>/restorePointCollections/<rpcName>/restorePoints/<rpName>/diskRestorePoints/<diskRestorePointName>"
}
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true,
"storageUri": " http://storageaccount.blob.core.windows.net/"
}
}
},
"provisioningState": "Succeeded | Failed | Creating | Deleting",
"provisioningDetails": {
"creationTime": "Creation Time of Restore point in UTC"
},
"instanceView": {
"statuses": [
{
"code": "ReplicationState/succeeded",
"level": "Info",
"displayStatus": "Replication succeeded"
}
],
"diskRestorePoints": [
{
"id": "<diskRestorePoint Arm Id>",
"replicationStatus": {
"status": {
"code": "ReplicationState/succeeded",
"level": "Info",
"displayStatus": "Replication succeeded"
},
"completionPercent": "<completion percentage of the replication>"
}
}
]
}
}
}
Volgende stappen
- Maak een VM-herstelpunt.
- Meer informatie over back-up- en herstelopties voor VM's in Azure.