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

Confidential VM builds - Packer azure plugin crash unexpected EOF #406

Closed
phochard opened this issue Apr 16, 2024 · 1 comment · Fixed by #407
Closed

Confidential VM builds - Packer azure plugin crash unexpected EOF #406

phochard opened this issue Apr 16, 2024 · 1 comment · Fixed by #407
Assignees
Labels

Comments

@phochard
Copy link

Hi,

We are trying to build an image on Azure using packer.

Our configuration file looks like this :

variable "prefix" {}
variable "client_id" {}
variable "tenant_id" {}
variable "subscription_id" {}
variable "client_secret" {}

locals {
  client_id = "${var.client_id}"
  client_secret = "${var.client_secret}"
  subscription_id = "${var.subscription_id}"
  tenant_id = "${var.tenant_id}"
  ubuntu_managed_image_name = "${var.prefix}-***"
  ubuntu_build_resource_group_name = "***"
  os_type = "***"
  image_publisher = "***"
  image_offer = "***"
  image_sku = "***"
  vm_size = "***"
  vtpm_enabled = true
  secure_boot_enabled = true
  security_type = "***"
}

source "azure-arm" "ubuntu" {
  client_id                 = local.client_id
  tenant_id                 = local.tenant_id
  subscription_id           = local.subscription_id
  client_secret             = local.client_secret
  build_resource_group_name   = local.ubuntu_build_resource_group_name
  os_type                     = local.os_type
  vm_size                     = local.vm_size
  secure_boot_enabled         = local.secure_boot_enabled
  vtpm_enabled                = local.vtpm_enabled
  security_type               = local.security_type
  shared_image_gallery {
    subscription = "***"
    resource_group = "***"
    gallery_name = "***"
    image_name = "***"
    image_version = "***"
  }
  shared_image_gallery_destination {
    resource_group = "***"
    gallery_name = "***"
    image_name = "***"
    image_version = "***"
    storage_account_type = "***"
    target_region {
      name = "***"
    }
  }
}

build {
  sources = ["source.azure-arm.ubuntu"]

}

When running packer build -debug azure-sev-ubuntu.pkr.hcl, Packer crashes even before trying to build the image, it seems like there is an issue with a plugin we are using.
The log file is attached below.

Could someone help us with this error please ?

crash.log

@phochard phochard added the bug label Apr 16, 2024
@JenGoldstrich JenGoldstrich changed the title Packer azure plugin crash unexpected EOF Confidential VM builds - Packer azure plugin crash unexpected EOF Apr 16, 2024
@JenGoldstrich JenGoldstrich self-assigned this Apr 16, 2024
@JenGoldstrich
Copy link
Contributor

Hey @phochard thanks for reporting this and for the crash log and template, this helped me reproduce this issue very quickly, I have a PR open here, I'll work with my team to get this approved and merged, and am planning to release a fix for this shortly after we merge the PR

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