Support using Vagrant with hyper-v on Windows

RESOLVED FIXED

Status

Tree Management
Treeherder: Docs & Development
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: gps, Assigned: gps)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
PR coming.
Created attachment 8804078 [details] [review]
Link to PR 1949

Comment 2

2 years ago
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/4f75d0706db90dc86d4076a6e5cc95db670c677c
Bug 1312544 - Support for Hyper-V

Vagrant wants to use Virtualbox by default on Windows. Unfortunately,
Virtualbox doesn't work when Hyper-V - the VM provider built into
Windows itself - is running.

This commit modifies the Vagrantfile to support Hyper-V.

The obvious change is the addition of a new provider block for
Hyper-V. It overrides the default box to use one that is compatible
with Hyper-V.

The non-obvious change is the refactor of the provisioner logic.

The Hyper-V box doesn't have Puppet installed. So we need to install
Puppet in a provisioner before the Puppet provisioner runs. But due
to the way Vagrantfiles are evaluated, we can't just insert the
provisioner in the hyperv provider block. So, this commit relies on
the fact that Vagrantfiles are really Ruby scripts that return a data
structure. The code for configuring the Puppet provisioner is factored
into a function. The provisioners are then moved to a provider override
block so we can guarantee the order they are registered in. It is a bit
ugly, but it gets the job done.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Component: Treeherder → Treeherder: Docs & Development
Resolution: --- → FIXED
Summary: Support hyper-v → Support using Vagrant with hyper-v on Windows
You need to log in before you can comment on or make changes to this bug.