Skip to content

Commit 8ce111e

Browse files
committed
partial Ram feedback included
1 parent c99b821 commit 8ce111e

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

azure-local/manage/trusted-launch-vm-import-key.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: alkohli
66
ms.topic: how-to
77
ms.service: azure-local
88
ms.reviewer: alkohli
9-
ms.date: 07/14/2025
9+
ms.date: 07/15/2025
1010
---
1111

1212
# Manual backup and recovery of VM guest state protection key
@@ -21,16 +21,13 @@ You can backup and restore the virtual machine (VM) guest state protection key o
2121

2222
## For Azure Local release 2505 and later
2323

24-
To backup, this approach copies VM guest state protection keys from the local key vault of your Azure Local instance to a folder that is backed up periodically. The VM guest state protection keys stored inside that folder are in an encrypted form.
24+
To backup, this approach copies VM guest state protection keys from the local key vault of your Azure Local instance to a folder that is backed up periodically. The VM guest state protection keys stored inside that folder are in an encrypted form.
2525

2626
To restore, this approach restores VM guest state protection keys from a folder (containing the backup copy) to the local key vault of an Azure Local instance where the VMs need to be restored.
2727

2828
### Backup
2929

30-
The steps below involve copying VM guest state protection keys from the local key vault of your Azure Local instance to a folder that is backed up periodically.
31-
32-
> [!NOTE]
33-
> You can only use this method for Azure Local 2505 release and later. If your Azure Local instance uses an earlier Azure Local release, use the other method.
30+
The steps below involve copying VM guest state protection keys from the local key vault of your Azure Local instance to a folder that is backed up periodically.
3431

3532
1. On a secure computer using PowerShell 7, generate a wrapping key of size 2048:
3633

@@ -50,30 +47,30 @@ The steps below involve copying VM guest state protection keys from the local ke
5047
5148
1. Copy VM guest state protection keys from the local key vault of your Azure Local instance to a folder that is backed up periodically:
5249
53-
1. Download the `TvmBackupUtils.psm1` script file located on GitHub (link to repo path) to your Azure Local instance.
50+
1. Download `TvmBackupUtils.psm1` script at <add hyperlink> to your Azure Local instance.
5451
5552
1. Run `import-module .\TvmBackupUtils.psm1 -force`.
5653
5754
1. Run `Backup-TVMKeys -WrappingKeyPath <path to public.pem> -BackupRootPath <path to backup root folder where the timestamped backup folder is stored>`.
5855
59-
1. Make note of the timestamped backup folder created under the backup root folder. You will need this later during recovery. For examople, backup folder named "20250612205355" with the format "yyyyMMddHHmmss".
56+
1. Make note of the timestamped backup folder created under the backup root folder. You will need this later during recovery. For example, backup folder named "20250612205355" with the format "yyyyMMddHHmmss".
6057
6158
1. Periodically backup the backup root folder.
6259
6360
### Restore
6461
6562
The steps below involve restoring VM guest state protection keys from a folder containing the backup copy to the local key vault of an Azure Local instance where the VMs need to be restored.
6663
67-
1. Copy both private and public key files for the wrapping key that you created during step 1 for Backup to the Azure Local instance.
64+
1. Copy both private and public key files for the wrapping key that you created during step 1 to the Azure Local instance.
6865
6966
1. Copy the timestamped backup folder to the Azure Local instance. Pick the folder under the backup root folder with the latest timestamp as that folder will have the most recent copy.
7067
7168
> [!NOTE]
72-
>Don't modify the backup folder.
69+
> Don't modify the backup folder.
7370
74-
1. Import the wrapping key that you created during backup step 1 for Backup to the Azure Local instance:
71+
1. Import the wrapping key that you created during backup step 1 to the Azure Local instance:
7572
76-
1. Download the `TvmBackupUtils.psm1` script file on Github at (link to file on GitHub repo Azure-Samples/AzureLocal: Contains scripts, code samples, for Azure Stack HCI) to your Azure Local instance.
73+
1. Download `TvmBackupUtils.psm1` script at <add hyperlink> to your Azure Local instance.
7774
7875
1. Run `Import-Module .\TvmBackupUtils.psm1 -force`.
7976
@@ -82,16 +79,16 @@ The steps below involve restoring VM guest state protection keys from a folder c
8279
8380
1. Run `Import-TvmWrappingKeyFromPem -KeyName <WrappingKeyName>  -PublicKeyPath <path to public.pem> -PrivateKeyPath <path to private.pem> -KeySize 2048`
8481
85-
1. Delete `AzureStackTvmAKRootKey`:
82+
1. Delete `AzureStackTvmAKRootKey` as follows:
8683
8784
> [!NOTE]
88-
> Do this step only if you're restoring the VM to the same Azure Local instance (the Azure Local instance where the VM resided before failure).
85+
> Do this step only if you're restoring the VM to the same Azure Local instance (the Azure Local instance where the VM resided before failure).
8986
9087
`Remove-MocKey -name  AzureStackTvmAKRootKey -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault`
9188
9289
1. Restore the keys from backup:
9390
94-
`Import-TVMKeys -WrappingKeyName  <WrappingKeyName> -BackupPath <path to timestamped backup folder> `.
91+
`Import-TVMKeys -WrappingKeyName  <WrappingKeyName> -BackupPath <path to timestamped backup folder>`
9592
9693
> [NOTE!]
9794
> If the local key vault of the Azure Local instance already has a VM guest state protection key with the same name or already has an `AzureStackTvmAKRootKey`, you will receive an `InvalidVersion` error for that key. You can ignore this, as the key is already in the key vault.
@@ -101,9 +98,9 @@ The steps below involve restoring VM guest state protection keys from a folder c
10198
1. Delete both `public.pem` and `private.pem` files from the Azure Local instance.
10299
103100
> [!IMPORTANT]
104-
> Remove the wrapping key from the local key vault of the Azure Local instance using `Remove-MocKey`. This will help avoid collisions later.
101+
> Remove the wrapping key from the local key vault of the Azure Local instance using `Remove-MocKey`. This will help avoid collisions later.
105102
106-
1. Run `Remove-MocKey -name WrappingKeyName -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault`.
103+
1. Run `Remove-MocKey -name WrappingKeyName -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault`
107104
108105
109106
## For Azure Local releases prior to 2505
@@ -114,17 +111,17 @@ To restore, this method restores VM guest state protection keys from the local k
114111
115112
### Backup
116113
117-
Follow these steps to copy the VM guest state protection key from the local key vault of the Azure Local instance where the VM resides to a backup key vault on another Azure Local instance:
114+
Follow these steps to copy the VM guest state protection key from the local key vault of the Azure Local instance where the VM resides to a backup key vault on another Azure Local instance:
118115
119116
1. On the Azure Local system with the backup key vault, run the following commands on the Azure Local system with the backup key vault:
120117
121118
1. Create a wrapping key in the backup key vault:
122119
123-
`New-MocKey -name wrappingKey -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type RSA -size 2048`
120+
`New-MocKey -name wrappingKey -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type RSA -size 2048`
124121
125122
1. Download the Privacy Enhanced Mail (PEM) file:
126123
127-
`Get-MocKeyPublicKey -name wrappingKey -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -outputFile wrappingKey.pem `
124+
`Get-MocKeyPublicKey -name wrappingKey -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -outputFile wrappingKey.pem`
128125
129126
1. On the Azure Local system where the VM resides, run the following commands on the Azure Local system:
130127
@@ -148,7 +145,7 @@ Follow these steps to copy the VM guest state protection key from the local key
148145
149146
1. Import the VM guest state protection key to the backup key vault:
150147
151-
`Import-MocKey -name <VM ID> -importKeyFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type AES -size 256`.
148+
`Import-MocKey -name <VM ID> -importKeyFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type AES -size 256`
152149
153150
### Restore
154151
@@ -174,20 +171,20 @@ Follow these steps to copy the VM guest state protection key from the backup key
174171
175172
1. Export the VM guest state protection key:
176173
177-
`Export-MocKey -name <VM ID> -wrappingKeyName wrappingKey -wrappingPubKeyFile wrappingKey.pem -outFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -size 256`.
174+
`Export-MocKey -name <VM ID> -wrappingKeyName wrappingKey -wrappingPubKeyFile wrappingKey.pem -outFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -size 256`
178175
179176
1. On the Azure Local system where the VM needs to be restored, run the following commands from the target Azure Local system:
180177
181178
1. Copy the `VM ID` and `VM ID`.json file to the Azure Local system.
182179
183180
1. Import the VM guest state protection key:
184181
185-
`Import-MocKey -name <VM ID> -importKeyFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type AES -size 256`.
182+
`Import-MocKey -name <VM ID> -importKeyFile <VM ID>.json -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault -type AES -size 256`
186183
187184
> [!NOTE]
188185
> Restore the VM guest state key (complete the steps above) before you start the VM on the Azure Local instance where the VM needs to be restored. This ensures that the VM uses the restored VM GSP key. Otherwise, the VM creation fails, and a new VM GSP key is created by the system. If this happens by mistake (human error), delete the VM GSP key and then repeat the steps to restore the VM GSP key.
189186
190-
`Remove-MocKey -name <vm id> -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault`.
187+
`Remove-MocKey -name <vm id> -group AzureStackHostAttestation -keyvaultName AzureStackTvmKeyVault`
191188
192189
## Next steps
193190

azure-local/manage/trusted-launch-vm-overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.topic: concept-article
55
author: alkohli
66
ms.author: alkohli
77
ms.service: azure-local
8-
ms.date: 07/14/2025
8+
ms.date: 07/15/2025
99
---
1010

1111
# Introduction to Trusted launch for Azure Local VMs enabled by Azure Arc
@@ -67,7 +67,7 @@ When working with Trusted launch Azure Local VMs, make sure to understand the fo
6767

6868
**Restoring to same Azure Local instance**
6969

70-
- In some situations, the VM may be restored to the same Azure Local instance, the same as the Azure Local instance where the VM resided before failure. For example, restoring an affected VM to the same Azure Local instance after recovery from a physical disk failure or partial data loss. When a Trusted launch VM is successfully restored to the same Azure Local instance, the VM can be managed via Azure Local control plane as it was before.
70+
- In some situations, the VM may be restored to the same Azure Local instance, the same as the Azure Local instance where the VM resided before failure. When a Trusted launch VM is successfully restored to the same Azure Local instance, the VM can be managed via Azure Local control plane as it was before.
7171

7272
**Restoring to different Azure Local instance**
7373

0 commit comments

Comments
 (0)