Skip to content
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

Azure Windows 2019 build throws a false negative error #266

Closed
hc-github-team-packer opened this issue Feb 1, 2023 · 1 comment
Closed

Comments

@hc-github-team-packer
Copy link

This issue was originally opened by @ppetrovgh in hashicorp/packer#12206 and has been migrated to this repository. The original issue description is below.


Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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 building a Windows server 2019 Datacenter Packer image at the end of the build it shows a false negative:

==> azure-arm: Failed to find temporary OS disk on VM. Please delete manually.
==> azure-arm:
==> azure-arm: VM Name: testvm
==> azure-arm: Error: %!s(

When searching for the temporary disk in Azure, it does not exist, it has been deleted, and the above error is invalid.

Reproduction Steps

{
  "variables": {
    "managed_image_resource_group_name": "{{env `MANAGED_IMAGE_RESOURCE_GROUP_NAME`}}",
    "managed_image_name": "{{env `MANAGED_IMAGE_NAME`}}",
    "temp_compute_name": "{{env `TEMP_COMPUTE_NAME`}}",
    "virtual_network_name": "{{env `VIRTUAL_NETWORK_NAME`}}",
    "virtual_network_subnet_name": "{{env `VIRTUAL_NETWORK_SUBNET_NAME`}}",
    "virtual_network_resource_group_name": "{{env `VIRTUAL_NETWORK_RESOURCE_GROUP_NAME`}}",
    "build_resource_group_name": "{{env `BUILD_RESOURCE_GROUP_NAME`}}"
  },
  "builders": [{
    "type": "azure-arm",

    "use_azure_cli_auth": true,
  
    "managed_image_resource_group_name": "{{user `managed_image_resource_group_name`}}",
    "managed_image_name": "{{user `managed_image_name`}}",
    "temp_compute_name": "{{user `temp_compute_name`}}",
    "virtual_network_name": "{{user `virtual_network_name`}}",
    "virtual_network_subnet_name": "{{user `virtual_network_subnet_name`}}",
    "virtual_network_resource_group_name": "{{user `virtual_network_resource_group_name`}}",
  
    "os_type": "Windows",
    "image_publisher": "MicrosoftWindowsServer",
    "image_offer": "WindowsServer",
    "image_sku": "2019-Datacenter",
  
    "communicator": "winrm",
    "winrm_use_ssl": true,
    "winrm_insecure": true,
    "winrm_timeout": "5m",
    "winrm_username": "packer",
  
    "azure_tags": {
      "dept": "Engineering",
      "task": "Image deployment"
    },
  
    "build_resource_group_name": "{{user `build_resource_group_name`}}",
    "vm_size": "Standard_DS2_v2"
  }],
  "provisioners": [{
    "type": "powershell",
    "script": "set-vm.ps1"
  }]
}

Packer version

Packer v1.8.4

Simplified Packer Template

Above template adjusted from the following example: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer#define-packer-template

Operating system and Environment details

Ubuntu 20.04.5 LTS

@JenGoldstrich
Copy link
Contributor

This has been addressed in #296 which will be released soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants