-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key Vaule is not deleted on cleanup azure-arm #8493
Comments
Am seeing the same with Packer 1.5.2
|
@jghal thanks for reaching out on this issue. I'm having a little trouble correlating the provided errors to the key vault cleanup issue. Are you able to share a full debug log output stripped of any sensitive information |
@nywilken will try but will probably be a few days before I can get it. |
So I'm only seeing that error when the image build has failed for some other reason. For example using VM size Standard_D2s_v3 and I hit the issue where WinRM doesn't self-configure correctly and the packer build times out. When I change the VM size to D8s and the build is successful, I don't see the error I posted but I do see the KeyVault left behind. Interestingly, I not only don't see the error, I don't see any lines relating to KeyVault during the destroy. Error when build is already failed, with KeyVault listed in resources to destroy
KeyVault not listed in resources to destroy when build otherwise succeeded
In both cases the KeyVault is still present in the resource group. Here's the debug log that follows the "resource group was not created by Packer" message in the successful build
|
When using new option added in 1.5.2 to specify a keyvault "build_key_vault_name" Image build completes but the Packer build fails with Looks like Packer is trying to delete a temporary KeyVault that was not created due to the new config option "build_key_vault_name" being used.
|
I am seeing this behavior too. I see the issue as the KV packer is trying to clean up is not the same name as the one it provisions. eg.. ==> azure-arm: -> Key Vault Name : 'pkrkv65gv9k9b8g' ==> azure-arm: -> Key Vault Secret Name : 'packerKeyVaultSecret' ==> azure-arm: -> Certificate URL : 'https://pkrkv65gv9k9b8g.vault.azure.net/secrets/packerKeyVaultSecret/f52a90173e3a4af18bf55d7a2520e776' But what packer tries to delete.... ==>_ azure-arm: Removing the created Deployment object: 'kvpkrdp65gv9k9b8g' |
One is the vault itself, the other is the deployment. Those are two different things, I believe. I'm investigating this issue now. |
I believe I've fixed at least two variants of this error in the linked PR: test builds can be found here: https://circleci.com/gh/hashicorp/packer/40035#artifacts/containers/0 |
1.5.5 fixed this issue for me. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
Overview of the Issue
When using the azure-arm provisioner with build_resource_group_name, the key vault resource isn't deleted at cleanup
Reproduction Steps
See overview
Packer version
1.4.5 and 1.4.4
Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
Windows Server 2019, 64x, Nothing has been installed on these machines bar packer
Log Fragments and crash.log files
I was unable to set env variables as the machines are locked down. But the console output lists the keyvault as one of the resources to delete but doesnt do anything. No delete request within azure, nothing blocking the subscription or resource group from deleting resources etc.
The text was updated successfully, but these errors were encountered: