Comments (4)
@fsdrw08
I am facing the same issue and I found a trace to what we could do, but I cant get past it.
On some builds it will create a Box which will start as configuration version 8.0 and some will start as 9.0.
I found that the information about which configuration version Hyper-V should use is only in the *.vmcx files.
On 'vagrant up', Vagrant searches for any configuration files in the 'Virtual Machines' folder. It will stop on the first valid one (no matter if it is a box.xml or *.vmcx).
https://github.com/hashicorp/vagrant/blob/5b501a3fb05ed0ab16cf10991b3df9d231edb5cf/plugins/providers/hyperv/action/import.rb#L31
*.vmcx are named after the UUID of the VM, which is randomly generated.
So: Some builds from packer create a Box with a structure inside the 'Virtual Machines' Folder like this:
- 'box.xml'
- 'F1C7C5C3-F7EA-45CA-8B87-119864E08A35.vmcx'
- 'F1C7C5C3-F7EA-45CA-8B87-119864E08A35.vmrs'
And some will be like this:
- '29A77F80-839B-488E-8233-9F2E16FE4E86.vmcx'
- '29A77F80-839B-488E-8233-9F2E16FE4E86.vmrs'
- 'box.xml'
Notice that some vmcx files start with a number and will be further up in a Folder listing.
Packer will read all artifact names inside the builder plugin and will return a list of files for the post-processors.
(https://github.com/hashicorp/packer-plugin-hyperv/blob/main/builder/hyperv/common/artifact.go#L27)
This means, renaming the VMCX files to start with a number or '_' in a post-processing step wont work, because packer already knows which files need to be exported.
The only thing left would be to set the range of the UUIDs which Hyper-V creates and let it only create ones that start with a number. And that's where I am stuck ...
from packer-plugin-vagrant.
@fsdrw08
I am facing the same issue and I found a trace to what we could do, but I cant get past it.On some builds it will create a Box which will start as configuration version 8.0 and some will start as 9.0.
I found that the information about which configuration version Hyper-V should use is only in the *.vmcx files.
On 'vagrant up', Vagrant searches for any configuration files in the 'Virtual Machines' folder. It will stop on the first valid one (no matter if it is a box.xml or *.vmcx).
https://github.com/hashicorp/vagrant/blob/5b501a3fb05ed0ab16cf10991b3df9d231edb5cf/plugins/providers/hyperv/action/import.rb#L31*.vmcx are named after the UUID of the VM, which is randomly generated.
So: Some builds from packer create a Box with a structure inside the 'Virtual Machines' Folder like this:
- 'box.xml'
- 'F1C7C5C3-F7EA-45CA-8B87-119864E08A35.vmcx'
- 'F1C7C5C3-F7EA-45CA-8B87-119864E08A35.vmrs'
And some will be like this:
- '29A77F80-839B-488E-8233-9F2E16FE4E86.vmcx'
- '29A77F80-839B-488E-8233-9F2E16FE4E86.vmrs'
- 'box.xml'
Notice that some vmcx files start with a number and will be further up in a Folder listing.
Packer will read all artifact names inside the builder plugin and will return a list of files for the post-processors.
(https://github.com/hashicorp/packer-plugin-hyperv/blob/main/builder/hyperv/common/artifact.go#L27)
This means, renaming the VMCX files to start with a number or '_' in a post-processing step wont work, because packer already knows which files need to be exported.
The only thing left would be to set the range of the UUIDs which Hyper-V creates and let it only create ones that start with a number. And that's where I am stuck ...
I notice this issue in these days too, I think it should make a improvement in vagrant side, vagrant should take vmcx config file as primary than the box.xml file
from packer-plugin-vagrant.
Hi, any update on this topic?
from packer-plugin-vagrant.
now I use terraform hyperv provider instead of Vagrant, Vagrant is dead
from packer-plugin-vagrant.
Related Issues (20)
- Packer plugin needs an architecture parameter. Packer builder does not download boxes with explicitly set architecture. HOT 3
- No box created when using a Vagrant box as a source and no errors reported HOT 1
- Allow specifying content for vagrantfile_template HOT 3
- Plugin fails on windows builds since implied shell (`bash -l`) is unavailable HOT 6
- "Post-processor failed: unexpected EOF" vagrant post processor on libvirt image HOT 1
- Invalid Vagrantfile with local vagrant cloud repository
- Is the current plugin support Windows VM ? HOT 4
- valid box file not generated when using artifacts from 'artifice' post-processor with provider_override="hyperv"
- Packer 1.12.0-alpha1 testing
- Vagrant-registry post-processor failure on box creation HOT 1
- [vagrant-cloud post-processor] support for checksum and checksum_type when creating/updating providers HOT 2
- Vagrant builder ssh authentication error
- /etc/default/grub is overwritten during post-processor HOT 1
- Builder vagrant with libvirt: "Remote connection disconnect" error to connect to a box made from the packer-built image.
- post-processor: create disk image without a backing file
- The synced_folder option does not expand ~/ HOT 1
- error "SSH Port was not properly retrieved from SSHConfig." (fixed after running "vagrant up")
- synced_folder absolute path generated in Vagrantfile must be escaped when run on a Windows host
- Missing link in docs for the `template` parameter HOT 2
- Add support for `provider_override = "qemu"`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-plugin-vagrant.