Howto provision vm on hyper-v


I am facing the case where I've to deal with microsoft Hyperv and I've
tried libvirt but the driver hyperv is not compiled. So I need some advice
on what should I do :

  • manage with the hook plugin to send remote command to the hyperv (ssh,
    winrm, and fire a script to install/uninstall)
  • should I dev a new compute resource and to simply use like what I
    describe : ssh or winrm, and fire a script to install/uninstall
  • change hypervisor (not possible)

Any clue will be welcome.


Hi lovi,

i think libvirt is not the best choice to provisioning vm's on hyper-v
architecture. In fact iam not sure if it really works at all - nobody seems
to use it for provisioning.

A while ago i talked with @dlobatog to creating a new plugin for computing
resources on hyper-v on mail, but my companys choice goes on vmware 6.5, so
i have no testlab at this moment. If you can create a basic plugin of
course its great.

In my opinion the plugin should works similar as the vmware-plugin for
foreman. Creating vm's on a single host is the one thing, but bigger
hyper-v environments are managed by the System Center Virtual Machine
Manager (SCVMM) wich is in a simpler way compareable to the VMware vSphere
Architecture. You administrate there all hosts, datastores, cluster and
much more from a single point. I think to provisioning vm's on this should
be aimed for a hyper-v plugin, because things like image based provisiong
are quite different on hyper-v - based on VMM Libary, not just VM's who are
marked as templates like in vmware.

The appropriate API for managing all things is honestly based on Microsoft
Powershell. Unlike in VMware PowerCLI, there are two Powershell API's from
Microsoft. One for managing things on a single hyper-v host and another for
managing SCVMM. However, i think a possible architecture consider this
circumstances. So that comes to maybe two different architecture

  1. The management api calls are handled by a foreman smart-proxy wich is
    installed on a Windows Server because of the Powershell CMDlets. I think on
    a similar way how MSDHCP is handled in foreman.

  2. Waiting for full fledged Powershell on Linux , then the API calls can be
    managed directly by the foreman-master. Sure, nobody can say it will me
    ever done and at wich time …

Overall, i think managing Hyper-V over foreman is not simple stuff and it
will be much more work as it seems on the first look because of a missing
REST-API or other good Interfaces.

Just my thoughts on that. Maybe somebody as a proper ideas on this topic
(wich i think it will be better discussed at foreman-dev)