website/docs: hyper-v docs

This commit is contained in:
Mitchell Hashimoto 2014-02-28 18:53:20 +01:00
parent fbdca0c8b6
commit 13f25936e3
6 changed files with 188 additions and 0 deletions

View File

@ -215,6 +215,16 @@
</ul>
<% end %>
<li<%= sidebar_current("hyperv") %>><a href="/v2/hyperv/index.html">Hyper-V</a></li>
<% if sidebar_section == "hyperv" %>
<ul class="sub unstyled">
<li<%= sidebar_current("hyperv-usage") %>><a href="/v2/hyperv/usage.html">Usage</a></li>
<li<%= sidebar_current("hyperv-boxes") %>><a href="/v2/hyperv/boxes.html">Creating a Base Box</a></li>
<li<%= sidebar_current("hyperv-configuration") %>><a href="/v2/hyperv/configuration.html">Configuration</a></li>
<li<%= sidebar_current("hyperv-limitations") %>><a href="/v2/hyperv/limitations.html">Limitations</a></li>
</ul>
<% end %>
<li<%= sidebar_current("plugins") %>><a href="/v2/plugins/index.html">Plugins</a></li>
<% if sidebar_section == "plugins" %>
<ul class="sub unstyled">

View File

@ -0,0 +1,93 @@
---
page_title: "Creating a Base Box - Hyper-V Provider"
sidebar_current: "hyperv-boxes"
---
# Creating a Base Box
As with [every provider](/v2/providers/basic_usage.html), the Hyper-V
provider has a custom box format that affects how base boxes are made.
Prior to reading this, you should read the
[general guide to creating base boxes](/v2/boxes/base.html). Actually,
it would probably be most useful to keep this open in a separate tab
as you may be referencing it frequently while creating a base box. That
page contains important information about common software to install
on the box.
Additionally, it is helpful to understand the
[basics of the box file format](/v2/boxes/format.html).
<div class="alert alert-block alert-warn">
<p>
<strong>Advanced topic!</strong> This is a reasonably advanced topic that
a beginning user of Vagrant doesn't need to understand. If you're
just getting started with Vagrant, skip this and use an available
box. If you're an experienced user of Vagrant and want to create
your own custom boxes, this is for you.
</p>
</div>
## Additional Software
In addition to the software that should be installed based on the
[general guide to creating base boxes](/v2/boxes/base.html),
Hyper-V base boxes require some additional software.
### Hyper-V Kernel Modules
You'll need to install Hyper-V kernel modules. While this improves performance,
it also enables necessary features such as reporting its IP address so that
Vagrant can access it.
You can verify Hyper-V kernel modules are properly installed by
running `lsmod` on Linux machines and looking for modules prefixed with
`hv_`. Additionally, you'll need to verify that the "Network" tab for your
virtual machine in the Hyper-V manager is reporting an IP address. If it
is not reporting an IP address, Vagrant will not be able to access it.
For most newer Linux distributions, the Hyper-V modules will be available
out of the box.
Ubuntu 12.04 requires some special steps to make networking work. These
are reproduced here in case similar steps are needed with other distributions.
Without these commands, Ubuntu 12.04 will not report an IP address to
Hyper-V:
```
$ sudo apt-get install linux-tools-3.11.0-15-generic
$ sudo apt-get install hv-kvp-daemon-init
$ cp/usr/lib/linux-tools-3.11.0-15/hv_* /usr/sbin/
```
## Packaging the Box
To package a Hyper-V box, export the virtual machine from the
Hyper-V Manager using the "Export" feature. This will create a directory
with a structure similar to the following:
```
.
|-- Snapshots
|-- Virtual Hard drives
|-- Virtual Machines
```
Delete the "Snapshots" folder. It is of no use to the Vagrant Hyper-V
provider and can only add to the size of the box if there are snapshots
in that folder.
Then, create the "metadata.json" file necessary for the box, as documented
in [basics of the box file format](/v2/boxes/format.html). The proper
provider value to use for the metadata is "hyperv".
Finally, create an archive of those contents (but _not_ the parent folder)
using a tool such as `tar`:
```
$ tar cvzf ~/custom.box ./*
```
A common mistake is to also package the parent folder by accident. Vagrant
will not work in this case. To verify you've packaged it properly, add the
box to Vagrant and try to bring up the machine.

View File

@ -0,0 +1,13 @@
---
page_title: "Configuration- Hyper-V Provider"
sidebar_current: "hyperv-configuration"
---
# Configuration
The Hyper-V provider has some provider-specific configuration options
you may set. A complete reference is shown below:
* `ip_address_timeout` (integer) - The time in seconds to wait for the
virtual machine to report an IP address. This defaults to 120 seconds.
This may have to be increased if your VM takes longer to boot.

View File

@ -0,0 +1,25 @@
---
page_title: "Hyper-V Provider"
sidebar_current: "hyperv"
---
# Hyper-V
Vagrant comes with support out of the box for [Hyper-V](http://en.wikipedia.org/wiki/Hyper-V),
a native hypervisor written by Microsoft. Hyper-V is available by default for
almost all Windows 8.1 installs.
The Hyper-V provider is compatible with Windows 8.1 only. Prior versions
of Hyper-V do not include the necessary APIs for Vagrant to work.
Hyper-V must be enabled prior to using the provider. Most Windows installations
will not have Hyper-V enabled by default. To enable Hyper-V, go to
"Programs and Features" and check the box next to "Hyper-V."
<div class="alert alert-block alert-warn">
<strong>Warning:</strong> Enabling Hyper-V will cause VirtualBox, VMware,
and any other virtualization technology to no longer work. See
<a href="http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx">this blog post</a>
for an easy way to create a boot entry to boot Windows without Hyper-V
enabled, if there will be times you'll need other hypervisors.
</div>

View File

@ -0,0 +1,30 @@
---
page_title: "Limitations - Hyper-V Provider"
sidebar_current: "hyperv-limitations"
---
# Limitations
The Hyper-V provider works in almost every way like the VirtualBox
or VMware provider would, but has some limitations that are inherent to
Hyper-V itself.
## Limited Networking
Vagrant doesn't yet know how to create and configure new networks for
Hyper-V. When launching a machine with Hyper-V, Vagrant will prompt you
asking what virtual switch you want to connect the virtual machine to.
A result of this is that networking configurations in the Vagrantfile
are completely ignored with Hyper-V. Vagrant can't enforce a static IP
or automatically configure a NAT.
However, the IP address of the machine will be reported as part of
the `vagrant up`, and you can use that IP address as if it were
a host only network.
## Packaging
Vagrant doesn't implement the `vagrant package` command for Hyper-V
yet, though this should be fairly straightforward to add in a Vagrant
release in the near future.

View File

@ -0,0 +1,17 @@
---
page_title: "Usage - Hyper-V Provider"
sidebar_current: "hyperv-usage"
---
# Usage
The Hyper-V provider is used just like any other provider. Please
read the general [basic usage](/v2/providers/basic_usage.html) page for
providers.
The value to use for the `--provider` flag is `hyperv`.
Hyper-V also requires that you execute Vagrant with administrative
privileges. Creating and managing virtual machines with Hyper-V requires
admin rights. Vagrant will show you an error if it doesn't have the proper
permissions.