Azure / Azure/azure-libraries-for-java

Encrypting the VM fails due to invalid secret URL "Preparing machine for bitlocker".

Ouverte
#656 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Compute Compute - VM customer-reported
Langage dominant
Java
Étoiles
97
Forks
102
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Steps to reproduce
1. Created a win10 VM with osDisk and encrypt the VM.
2. Took the snapshot of the osDisk after the encryption.
3. Deleted the original VM and original osDisk
4. Recreated the VM with the same name in the same RG from the encrypted snapshot.
5. Added a datadisk to the new VM and then tried to encrypt the data disk using the following.

```
WindowsVMDiskEncryptionConfiguration config =
new WindowsVMDiskEncryptionConfiguration(
keyVault.id(),
applicationId,
applicationSecretEncrypted)
.withVolumeType(DiskVolumeType.DATA);
DiskVolumeEncryptionMonitor monitor = vm.diskEncryption().enable(config);
```

Azure throws the following exception

> com.microsoft.azure.CloudException:
> Preparing machine for bitlocker is not a valid versioned Key Vault Secret URL. It should be in the format `https:///secrets//.:` Preparing machine for bitlocker is not a valid versioned Key Vault Secret URL. It should be in the format `https:///secrets//.`

But retrying it after few minutes once it fails works.

I guess it's trying to re-install the "AzureDiskEncryption" extension since this was deleted as part of the original VM delete. But not waiting for extension's provisioning state to succeed (which will set the status message correctly to the secret URL) and using an intermediate status message "Preparing machine for bitlocker" as the secret URL.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start at WindowsVMDiskEncryptionConfiguration and the vm.diskEncryption().enable(config) entry point, then trace how the AzureDiskEncryption extension provisioning status supplies the secret URL. Reproduce the snapshot-based VM recreation flow and verify that encryption does not use the intermediate “Preparing machine for bitlocker” message; done means the first encryption attempt succeeds without a retry.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
azure, java
Domaine
cloud, security
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.