Over a million developers have joined DZone.

Automated, Self-Service Provisioning of VMs Using HyperForm (Part 1)

DZone 's Guide to

Automated, Self-Service Provisioning of VMs Using HyperForm (Part 1)

In this two-part series, learn how to empower your VMs with Hyper-V and HyperForm. In part one, see how to set up and register your VMs in clusters.

· Cloud Zone ·
Free Resource

HyperForm now provides superior automation of VM provisioning on Hyper-V through a self-service model that empowers users to provision infrastructure on-demand. With HyperForm, organizations can automate not just the VM provisioning, but the approval workflows and granular entitlements needed to provide personalized infrastructure services to meet unique IT and business needs.

HyperForm allows organizations to:
  • Connect multiple Hyper-V Nodes or Failover Clusters through a single proxy and customize the entitlements and quotas per registered Node or Failover Cluster
  • Empower users to provision virtual machines via a UI-based workflow or standardized YAML machine blueprints (i.e. blueprint as code) in the self-service library on Hyper-V nodes entitled to them
    • Select an image based on the available .VHDX templates available on Hyper-V.
    • Customize CPU, Memory, Disk and select a Network.
  • Register already running Linux or Windows virtual machines.
  • Manage the day-two operations of the provisioned VM's (e.g. start, stop and restart) and access an in-browser terminal to access the VM via a secure message queue.
  • Monitor the provisioned VM's (CPU, Memory, Disk Utilization) and get notifications/alerts whenever a VM is down or performance metrics exceed a pre-defined threshold.
  • Manage multiple tenants across the enterprise.
  • Register multiple LDAP Servers (e.g. Microsoft Active Directory) per tenant and allow users to authenticate seamlessly. Here's a detailed blog on this topic.
  • Manage user level permissions and roles.
  • Manage approval policies and quotas, and track the cost of both infrastructure & applications via cost profiles.
The advantages of HyperForm over Hyper-V management solutions is that it’s drastically simpler to install, supports 18 clouds (in addition to Hyper-V), provides self-service consumption of both machine and applications blueprints, provides historical monitoring & alerts and of course, provides superior Docker application modeling and life-cycle management.

Register Hyper-V Nodes or Failover Clusters via a Proxy

Once logged into HyperForm, a user can navigate to Cloud Providers and then click on the +New button to select Hyper-V. A user can then complete the requested information.

  • Name: A name for the Hyper-V Node or Failover Cluster
  • Endpoint URL: This is the URL of the server on which the proxy is running. The proxy is secured through SSL and so this URL should start with HTTPS.
    • To install a proxy from scratch, click on the "Is Proxy Installed" link. An auto-generated script is available allowing users to install the proxy on the Hyper-V server. You can change the password in the script by overriding "some-password" to your own custom password.
  • Password: This is the password used for the proxy.
  • Hyper-V Cluster/Node: This is the name of either the Hyper-V Node or Hyper-V Cluster
  • Template Location: The shared location on which the .VHDX templates reside (e.g. \\VFCN10-AD\HyperForm\Template\)
  • VM Destination: The destination that will be used for the VM metadata and hard disk (e.g. \\VFCN10-AD\HyperForm\VHDx\)


Advanced Configurations are also available. These can be defined by clicking on the Advanced Configurations button.

The optional fields allow you to enforce granular access controls and associate this provider with a quota policy.

  • Entitled Users: Yhese are the users who are allowed to use this Cloud Provider for infrastructure provisioning. The entitled users do not have permission to manage or delete this cloud provider and will not be able to view any of the credentials.
  • Entitled Blueprints: These are the Machine Compose templates that can be used with this cloud provider. For example, if a Tenant Admin wishes to restrict users to provisioning 4GB machines on certified operating systems, then users will not be able to use this cloud provider to provision any other machine.
  • Free-Form Provision: If enabled, allows entitled users to provision VM's uing the UI-based workflow.
  • Approval Enforced: If enabled, allows the Cloud Provider owner to approve new VM provisioning requests by entitled users
  • VM Limit: This is the maximum number of virtual machines that can be used with this cloud provider
  • Quota Policies: These are pre-defined policies for setting quotas on the number of VMs or the cost of VM's. Multiple quota policies can be selected to customize controls per user or per group of users.

Creating a Cluster (Pool of VMs)

Servers across hybrid clouds or local development machines can be associated with a cluster, which is a logical mapping of infrastructure. A user can create a cluster by navigating to Clusters page and then clicking on the +New button.

A cluster has advanced options, like:

  • Networking: A user can select out of multiple types of networks. Once machines are provisioned into a cluster, a user cannot change the network settings. Here are the available networks:
    • Docker: Allowing containers to connect to each other on the same host.
    • Weave: Allowing containers to connect to each other from multiple hosts.
    • Docker Swarm: Allowing containers to connect to each other from multiple hosts.
    • Skip Docker Install: Recommended for VM provisioning with non-container workloads (e.g. software pre-installed in a VM template).
  • Lease: A user can specify when the servers in this cluster expire so that HyperForm can automatically destroy those servers.
  • Placement Policy: A user can select from a number of placement policies like a proximity-based policy, round robin, or the default policy, which is a capacity-based placement policy that will place the Docker workload on the host that has sufficient compute resources.
  • Approval Enforced: If enabled, allows the Cloud Provider owner to approve new VM provisioning requests by entitled users
  • Granular Access Controls: A tenant admin can define access controls to a cluster to dictate who is able to deploy Docker applications to it through Entitled Users. For example, a developer may register his/her local machine and mark it as private. A tenant admin, on the other hand, may share a cluster with a specific group of users or with all tenant users. Additionally, the cluster owner can specify what application templates can be deployed to this cluster through Entitled Blueprints. If the cluster will be used in upstream environments, then only specific application templates (or "blueprints") can be deployed on it.

Registering Already Running VMs on Hyper-V

A user can register an already running AWS instance. This can be done by navigating to Machines and then clicking on the +New button. A user can then select the "Linux Host/VM" workflow and complete the required fields.

  • Name: The name of the server you would like to register. This does not necessarily need to be the actual hostname.
  • IP Address: This is the IP address of the server you're registering.
  • Cluster: This the cluster that the new server will be part of. Make sure that you create the cluster first — before registering servers or provisioning new ones.

Once a user clicks Save, then an automatically generated script appears. You can run this script on the host you're trying to register as a root user. The script checks if Docker is already installed. If not, then Docker, the DCHQ agent and Weave (optional) will be installed.

Here's what the script looks like with Docker networking:

curl -Ls <dchq.agent.script.url> | bash -s <DCHQ Server Key> <dchq.agent.connect.ip><dchq.agent.connect.port> docker.local <New Server IP>

If you're using HyperForm On-Premise, then you will be able to change the default arguments by navigating to System Settings.


Note that if   Weave had been enabled on this cluster, then the script would follow this format.
curl -Ls   < dchq.agent.script.url> | bash -s < DCHQ Server Key> < dchq.agent.connect.ip> < dchq.agent.connect.port> weave.local  <weave-password> <weave.ip>

...where   <weave.ip> is the IP address of the first server in the Weave cluster

This task can be automated programmatically using our REST APIs for creating “Docker Servers” ( https://dchq.readme.io/docs/dockerservers).

And that's all for now. You've got your VMs up and ready to go. Stay tuned to see how to provision them in part two.

modeling ,docker ,production ,docker compose ,virtual machine

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}