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

valid box file not generated when using artifacts from 'artifice' post-processor with provider_override="hyperv" #121

Open
sup-engineer opened this issue May 16, 2024 · 0 comments

Comments

@sup-engineer
Copy link

sup-engineer commented May 16, 2024

Overview of the Issue

When this post processor is used with artifacts from the 'artifice' post processor along with the provider_override="hyperv", the resulting .box output file does not seem to be valid.

Reproduction Steps

Prerequisite:

  1. following Hyper V vm source files :

image

  1. packer with the necessary plugins installed
  2. Execute : packer build
    • Expected behaviour: a working vagrant box (.box file) is generated from the hyperv source files
    • Observed behaviour:
      • An incomplete .box file file is generated (see attached file:packer_example_hyperv_amd64.box in the zip file ).
        packer_example_hyperv_amd64.zip

      • No Hyper-v VM artifacts are present in the .box file. It only contains the vagrantfile and the metadata.json. Also the input
        artifacts are being copied to 'c:\users' folder which was not expected behaviour.

Plugin and Packer version

image

image

Simplified Packer Buildfile

file: vagrant_post_processor_hyperv.pkr.hcl

  required_plugins {
    vagrant = {
      version = "~> 1"
      source = "github.com/hashicorp/vagrant"
    }
  }
}

source "null" "example" {
  communicator = "none"
}

build {
  sources = [
    "source.null.example"
  ]
  post-processors {
    post-processor "artifice" {
      files = [
        "output-windows10/Virtual Hard Disks/VnV-W10-001.vhdx",
        "output-windows10/Virtual Machines/4643F645-2EDB-4DD5-8E17-18A7DE59893C.vmcx",
        "output-windows10/Virtual Machines/4643F645-2EDB-4DD5-8E17-18A7DE59893C.vmgs",
        "output-windows10/Virtual Machines/4643F645-2EDB-4DD5-8E17-18A7DE59893C.VMRS",
        "output-windows10/Virtual Machines/box.xml"
      ]
    }
    post-processor "vagrant" {
      keep_input_artifact = true
      provider_override   = "hyperv"
    }
  }
}

Operating system and Environment details

image

image

Log Fragments and crash.log files

See attached log file from the CMD prompt ( packer_build_logt.txt) for the packer build:

packer_build_logt.txt

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

No branches or pull requests

2 participants