hashicorp / hashicorp/vagrant

Enhancement Request: Specify Hyper-V Boot Order

Open
#12,166 2 comments 3 reactions 0 assignees View on GitHub
enhancement provider/hyperv
Dominant language
Ruby
Stars
27.2k
Forks
4.4k
Avg merge
1m
Merged PRs (30d)
1

Description

**Is your feature request related to a problem? Please describe.**
Vagrant's Boot Order when using a Hyper-V image puts the Network Adapter before the Hard Drive like so:

![image](https://user-images.githubusercontent.com/2592881/106496350-02c22e00-647a-11eb-8fb2-7f82b3093e5a.png)

This results in slower boot times during `vagrant up` as the PXE Boot Process must time out before continuing.

**Describe the solution you'd like**
It would be nice to be able to configure these settings in the vagrantfile, but looking at the documentation there does not appear to be a way to do so.

This could be done via `Set-VMFirmware` https://docs.microsoft.com/en-us/powershell/module/hyper-v/set-vmfirmware?view=win10-ps

**Describe alternatives you've considered**
For right now after `vagrant up` runs I am manually changing the boot settings, however it would be better to have this in the configuration file.

**Additional context**
Could this be an authoring error when the box was created in packer? I tried having my packer file look like the following, but that does not appear to affect it when it finally flows into vagrant:

```
{
"builders": [
{
"boot_command": [
"a"
],
"boot_order": [
"DVD",
"SCSI:0:0"
],
"boot_wait": "2s",
"cd_files": [
"cdfiles/*"
],
"communicator": "winrm",
"cpus": 2,
"disk_size": "40960",
"generation": "2",
"first_boot_device": "DVD",
"headless": true,
"iso_checksum": "md5:5d1ec50e50a76aa9f0ef13f92272d283",
"iso_url": "en_windows_server_2012_r2_x64_with_updates_from_20210126.iso",
"memory": 2048,
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"switch_name": "Default Switch",
"type": "hyperv-iso",
"winrm_password": "vagrant",
"winrm_port": "5985",
"winrm_timeout": "240m",
"winrm_username": "vagrant"
}
],
"post-processors": [
{
"output": "windows-2012r2-hyperv.box",
"type": "vagrant",
"vagrantfile_template": "vagrantfile.template"
}
]
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the Vagrantfile configuration and the Hyper-V Set-VMFirmware reference, then compare the requested boot-order settings with the supplied Packer hyperv-iso configuration. Done means Hyper-V boot order can be configured for Vagrant-managed machines so the PXE timeout is avoided during vagrant up.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, ruby
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.