question

HorvathRobert-5012 avatar image
0 Votes"
HorvathRobert-5012 asked HorvathRobert-5012 commented

Limit Range of UUID for new VMs (Vagrant / Packer)

We use Packer and Vagrant to generate/build our OS VMs.
It is necessary that all the VMs are created with the configuration version 8.0.

In Packer there is a setting available to set the config-version for new VMs. That works and i can see that in the Hyper-V-Manager and the produced .VMCX file.
Here comes the tricky part: Packer/Vagrant use a second config file for the VM metadata besides the .VMCX file: box.xml
That box.xml currently does not support setting the config-version which results in a VM with the default config-version on our build machine --> 9.0
(No, we cannot downgrade the build machine nor upgrade the target host machine of that VM)

There is already an issue for that in Github discussing this issue in the Vagrant plugin inside Packer. (I wrote the explanation for the UUID problem)
https://github.com/hashicorp/packer-plugin-vagrant/issues/23

--> My question resolves around the UUID which Hyper-V sets for a new VM:
Is it possible to limit the Range of UUIDs that the Hyper-V is using?
(I'd need UUIDs starting with numbers only ...)

windows-server-hyper-vwindows-10-hypervmsc-virtual-machine-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered HorvathRobert-5012 commented

Hello @HorvathRobert-5012

If you are talking about BIOS uuid, then there are some scripts available from altaro , just make a search in search engine and you will be able to get it.

If the reply was helpful, please don’t forget to upvote or accept as answer.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Yes, excuse me, I mean the BIOS GUID. As far as I know, thas GUID is used for naming the VMCX files.

Thanks, I found the scripts, but that requires to intercept the running/provisioning/packaging process of packer. I thought, it is possible to run a script before packer to set a specific range of GUIDs.
I'll still try to integrate the altaro script from here: https://www.altaro.com/hyper-v/free-powershell-script-change-bios-guid-hyper-v-virtual-machine/

But let me know if there is any way to limit the range of those GUIDs.

0 Votes 0 ·