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

Failed to Delete Temporary VM Disk - Authentication Not Supported #315

Closed
wbz-mt opened this issue Jul 6, 2023 · 7 comments · Fixed by #326
Closed

Failed to Delete Temporary VM Disk - Authentication Not Supported #315

wbz-mt opened this issue Jul 6, 2023 · 7 comments · Fixed by #326
Assignees

Comments

@wbz-mt
Copy link

wbz-mt commented Jul 6, 2023

Originally posted by @JenGoldstrich in #190 (comment)

I'm still seeing the same issue with the latest packer and azure plugins installed.

 packer --version
1.9.1
packer plugins installed
/home/ubm/.config/packer/plugins/github.com/hashicorp/azure/packer-plugin-azure_v1.4.3_x5.0_linux_amd64
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Deleting Virtual Machine deployment and its attatched resources...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Compute/virtualMachines : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Waiting for deletion of all resources...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Compute/virtualMachines : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/publicIPAddresses resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkripzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/virtualNetworks resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrvnzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/networkInterfaces resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrnizlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/publicIPAddresses resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkripzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/virtualNetworks resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrvnzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  Deleting -> Microsoft.Compute/disks : '/subscriptions/xxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/disks/pkroszlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Error deleting resource.  Please delete manually.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: /subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/disks/pkroszlbn4usnxl
@JenGoldstrich JenGoldstrich changed the title Closing this as it appears resolved, please open a new issue if you run into a new crash that is from the same root error (changing property of source virtual machine) please open a new issue, thanks all! Failed to Delete Temporary VM Disk on Plugin version v1.4.3 Jul 6, 2023
@JenGoldstrich
Copy link
Contributor

JenGoldstrich commented Jul 6, 2023

@wbz-mt Can you please post a simplified template and the full output of your packer build

I will add that I believe this is a separate issue #190 was two issues, one was that we tried to delete the KeyVault's disk incorrectly, and the other was related to an auto-rest crash when trying to create a managed image, with the clearer output in v1.4.3 I can see you are failing to delete the temporary data disk, is this happening every time you build?

@wbz-mt
Copy link
Author

wbz-mt commented Jul 6, 2023

@JenGoldstrich I've been tried multiple times with the latest version to create ubuntu20.04, yes, every time since this morning. Please find the simplified template below.

packer {
  required_plugins {
    azure = {
      version = ">= 1.4.2"
      source  = "github.com/hashicorp/azure"
    }
  }
}

source "azure-arm" "linux-ubuntu-2004-sig-image-prod" {
  client_id                         = var.az_client_id
  client_secret                     = var.az_client_secret
  build_resource_group_name         = var.az_build_resource_group_name
  os_type                           = "Linux"
  image_publisher                   = var.image_publisher
  image_offer                       = var.image_offer
  image_sku                         = var.image_sku
  subscription_id                   = var.az_subscription_id
  tenant_id                         = var.az_tenant_id
  vm_size                           = var.vm_size
  async_resourcegroup_delete        = true
}

build {
  name = "linux"
  sources = [
    "source.azure-arm.linux-ubuntu-2004-sig-image-prod",
  ]

provisioner "shell" {
  execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
  inline_shebang  = "/bin/sh -x"

  inline = [
    "apt-get update",
    "apt-get upgrade -y",
    "apt-get -y install wget",

    "wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux",
    "tar -xf azcopy.tar.gz",
    "sudo cp ./azcopy_linux_amd64_*/azcopy /usr/local/bin",
    
    "mkdir -p /tmp/toolinstalls", 
    "azcopy cp 'https://xxx.blob.core.windows.net/installs/' '/tmp/toolinstalls/' --recursive=true",
  ]
}

  provisioner "shell" {
    execute_command   = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
    script            = "Packer-linux.sh"
    expect_disconnect = true
  }

  provisioner "shell" {
    execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'"
    inline          = ["apt-get update", "apt-get upgrade -y", "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"]
    inline_shebang  = "/bin/sh -x"
  }

}

and one output below.

linux.azure-arm.linux-ubuntu-2004-sig-image-prod: output will be in this color.

==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Running builder ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Getting tokens using client secret
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Getting tokens using client secret
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Creating Azure Resource Manager (ARM) client ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Getting source image id for the deployment ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SourceImageName: '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/publishers/Canonical/ArtifactTypes/vmimage/offers/0001-com-ubuntu-server-focal/skus/20_04-lts-gen2/versions/latest'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Using existing resource group ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Location          : 'westeurope'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Validating deployment template ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> DeploymentName    : 'pkrdpzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Deploying deployment template ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> DeploymentName    : 'pkrdpzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Getting the VM's IP address ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName   : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> PublicIPAddressName : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> NicName             : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Network Connection  : 'PublicEndpoint'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> IP Address          : '20.73.47.181'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Waiting for SSH to become available...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Connected to SSH!
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Provisioning with shell script: /tmp/packer-shell2516906428
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:4 http://azure.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:5 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:6 http://azure.archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:7 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:8 http://azure.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:9 http://azure.archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:10 http://azure.archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:11 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2697 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:12 http://azure.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [448 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:13 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.9 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:14 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2085 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:15 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [290 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:16 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [548 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:17 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1081 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:18 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [257 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:19 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [25.2 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:20 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [31.6 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:21 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [8032 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:22 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [688 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:23 http://azure.archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:24 http://azure.archive.ubuntu.com/ubuntu focal-backports/main Translation-en [16.3 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:25 http://azure.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:26 http://azure.archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:27 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:28 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:29 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:30 http://azure.archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:31 http://azure.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [2302 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:32 http://azure.archive.ubuntu.com/ubuntu focal-security/main Translation-en [366 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:33 http://azure.archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [13.0 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:34 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1965 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:35 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [275 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:36 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [544 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:37 http://azure.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [853 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:38 http://azure.archive.ubuntu.com/ubuntu focal-security/universe Translation-en [176 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:39 http://azure.archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [18.6 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:40 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:41 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5488 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Get:42 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Fetched 27.7 MB in 4s (6735 kB/s)
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading package lists...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading package lists...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Building dependency tree...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading state information...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Calculating upgrade...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading package lists...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Building dependency tree...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading state information...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: wget is already the newest version (1.20.3-1ubuntu2).
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: wget set to manually installed.
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: --2023-07-06 15:24:02--  https://aka.ms/downloadazcopy-v10-linux
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Resolving aka.ms (aka.ms)... 104.126.231.94
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Connecting to aka.ms (aka.ms)|104.126.231.94|:443... connected.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: HTTP request sent, awaiting response... 301 Moved Permanently
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Location: https://azcopyvnext.azureedge.net/release20230530/azcopy_linux_amd64_10.19.0.tar.gz [following]
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: --2023-07-06 15:24:02--  https://azcopyvnext.azureedge.net/release20230530/azcopy_linux_amd64_10.19.0.tar.gz
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Resolving azcopyvnext.azureedge.net (azcopyvnext.azureedge.net)... 95.101.78.219, 95.101.78.170, 2a02:26f0:1180:3::212:7989, ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Connecting to azcopyvnext.azureedge.net (azcopyvnext.azureedge.net)|95.101.78.219|:443... connected.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: HTTP request sent, awaiting response... 200 OK
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Length: 14533319 (14M) [application/gzip]
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Saving to: ‘azcopy.tar.gz’
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: INFO: Scanning...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Job 2efed667-7698-e646-6a40-28e799c31e5e has started
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Log file is located at: /home/packer/.azcopy/2efed667-7698-e646-6a40-28e799c31e5e.log
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: 100.0 %, 3 Done, 0 Failed, 0 Pending, 0 Skipped, 3 Total, 2-sec Throughput (Mb/s): 249.3098
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Job 2efed667-7698-e646-6a40-28e799c31e5e summary
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Elapsed Time (Minutes): 0.0334
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of File Transfers: 3
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of Folder Property Transfers: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of Symlink Transfers: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Total Number of Transfers: 3
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of File Transfers Completed: 3
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of Folder Transfers Completed: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of File Transfers Failed: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of Folder Transfers Failed: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of File Transfers Skipped: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Number of Folder Transfers Skipped: 0
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: TotalBytesTransferred: 62381329
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Final Job Status: Completed
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: 2023-07-06 15:24:02 (140 MB/s) - ‘azcopy.tar.gz’ saved [14533319/14533319]
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Provisioning with shell script: Packer-linux-ubuntu-setup.sh
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Provisioning with shell script: /tmp/packer-shell3439533609
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Hit:1 http://azure.archive.ubuntu.com/ubuntu focal InRelease
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Hit:2 http://azure.archive.ubuntu.com/ubuntu focal-updates InRelease
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Hit:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Hit:4 http://azure.archive.ubuntu.com/ubuntu focal-security InRelease
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading package lists...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading package lists...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Building dependency tree...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Reading state information...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Calculating upgrade...
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: /usr/sbin/waagent:27: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: WARNING! The waagent service will be stopped.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:   import imp
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: WARNING! Cached DHCP leases will be deleted.
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: WARNING! root password will be disabled. You will not be able to login as root.
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: WARNING! /etc/resolv.conf will NOT be removed, this is a behavior change to earlier versions of Ubuntu.
    linux.azure-arm.linux-ubuntu-2004-sig-image-prod: WARNING! packer account and entire home directory will be deleted.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Querying the machine's properties ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ComputeName       : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Managed OS Disk   : '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/disks/pkroszlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Querying the machine's additional disks properties ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ComputeName       : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Powering off machine ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> ComputeName       : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Compute ResourceGroupName : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Compute Name              : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Compute Location          : 'westeurope'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Generalizing machine ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Publishing to Shared Image Gallery ...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Source ID used for SIG publish        : '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG publish resource group            : 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG gallery name                      : 'packertesting01'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG image name                        : 'ubuntu'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG image version                     : '23.07.00'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG replication regions               : '[westeurope]'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG storage account type              : ''
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG image version endoflife date      : ''
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG image version exclude from latest : 'false'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> SIG replica count [1, 100]            : '1'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  -> Shared Gallery Image Version ID : '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/galleries/packertesting01/images/ubuntu/versions/23.07.00'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Deleting Virtual Machine deployment and its attatched resources...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Compute/virtualMachines : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Adding to deletion queue -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Waiting for deletion of all resources...
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Compute/virtualMachines : 'pkrvmzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/publicIPAddresses resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkripzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/virtualNetworks resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrvnzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/networkInterfaces resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrnizlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrnizlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/publicIPAddresses resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkripzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Couldn't delete Microsoft.Network/virtualNetworks resource. Will retry.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: pkrvnzlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkripzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvnzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:  Deleting -> Microsoft.Compute/disks : '/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/disks/pkroszlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Error deleting resource.  Please delete manually.
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Name: /subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxxxxxxxxxxxxxxxx/providers/Microsoft.Compute/disks/pkroszlbn4usnxl
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Error:  authentication is not supported yet
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Removing the created Deployment object: 'pkrdpzlbn4usnxl'
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod:
==> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: The resource group was not created by Packer, not deleting ...
Build 'linux.azure-arm.linux-ubuntu-2004-sig-image-prod' finished after 11 minutes 38 seconds.

==> Wait completed after 11 minutes 38 seconds

==> Builds finished. The artifacts of successful builds are:
--> linux.azure-arm.linux-ubuntu-2004-sig-image-prod: Azure.ResourceManagement.VMImage:

@JenGoldstrich JenGoldstrich changed the title Failed to Delete Temporary VM Disk on Plugin version v1.4.3 Failed to Delete Temporary VM Disk - Authentication Not Supported Jul 6, 2023
@JenGoldstrich
Copy link
Contributor

Okay I've seen this issue before,

The actual error here is

authentication is not supported yet

coming back from the Azure API, I am not sure why we're seeing this but will investigate it, thanks for your report

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

This issue has been synced to JIRA for planning.
JIRA ID: HPR-1234

@wbz-mt
Copy link
Author

wbz-mt commented Jul 25, 2023

@JenGoldstrich, since I have no visibilities on JIRA ID: HPR-1234, just wanted to check the status of this issue, I'm still getting such errors every time with a deployment.

@JenGoldstrich
Copy link
Contributor

JenGoldstrich commented Aug 3, 2023

Hey @wbz-mt,

I have addressed this in this not yet merged PR #326 and the fix for this will be released in the v2.0.0 release of Packer. We were calling the wrong Delete Disk endpoint for VHD builds, leading to that error message when attempting to delete the OS Disk as we don't initialize the storage account client for builds that don't create VHDs.

v2.0.0 does not have any breaking changes that impact the build you're using in the template above but for a full list of breaking changes if you are concerned https://github.com/JenGoldstrich/packer-plugin-azure/releases/tag/v2.0.0-betarc1 the release notes for this temporary beta build have all of the breaking changes that will go in the final release

@wbz-mt
Copy link
Author

wbz-mt commented Aug 4, 2023

Thanks @JenGoldstrich for the feedback and then I will be waiting for the v2.0.0 when it's available.

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

Successfully merging a pull request may close this issue.

2 participants