How to deploy Plesk 11 on Microsoft Hyper-V system


2016-11-16 12:41:00 UTC


2017-05-11 09:34:52 UTC


Was this article helpful?

Have more questions?

Submit a request

How to deploy Plesk 11 on Microsoft Hyper-V system

Applicable to:

  • Plesk 12.5 for Windows

Release Notes

To simplify Plesk 11 provisioning on Cloud for infrastructure providers (including service providers offering dedicated servers, VPS, or IaaS), Odin introduces instructions on how to deploy Plesk on a Microsoft Hyper-V system.

Creating VM image

Due to a Microsoft Windows Server licensing restriction, we cannot provide the Plesk Hyper-V image. It can be prepared by these simple steps:

  1. Go to Hyper-V Manager > choose a Hyper-V server > New Virtual Machine Wizard .
  2. Create a virtual machine with the following parameters, for example:      -  Name: Plesk 11 Image      -  Memory: 2 GB      -  Connection: Local Area Connection - Virtual Network      -  Virtual Hard Disk: 127 GB
  3. Install Microsoft Server 2008 R2 there.
  4. Install Plesk 11 with any component you want using Autoinstaller .
  5. Shut down and export the image VM to a location, for example, to C:\ drive.

The Plesk VM image is ready. It can be copied and used on a Windows Server 2008 R2 machine. NOTE: It is better not to switch to Remote Desktop (RDP) access on the image due to security reasons. The cloning script will do it during VM preparation after changing the Administrator password.

Steps to Deploy

Use PowerShell scripts from the attached as an example of batch VM cloning. The cloning script is written on Windows PowerShell. Please be sure that Windows PowerShell Integrate Scripting Environment (ISE) and .NET Framework 3.5.1 server features are installed on a Hyper-V server node. To check and install it, go to Server Manager > Features :

PowerShell Management Library for Hyper-V is also used to manage Hyper-V WMI API: The main idea of the provided cloning script is to use the DHCP server to resolve the IP address of the new VM. MAC address script option can be used to provide a fixed IP for each VM from the DHCP server.WARNING: Please check the cloning script before using it. Probablyanother cloning scenario will be needed.

Cloning script usage

  1. Unzip to C:\\PPPCloningScript , for example.

  2. Open CloneVM.ps1, for example, in Notepad.exe, and update the Administrator password that you set during VM image creation. This password is stored in the variable $VMDefaultPassword.

  3. Run powershell.exe.

  4. Move to C:\\PPPCloningScript folder.

  5. Run “CloneVM.ps1” with these parameters:

    .\\CloneVM.ps1 <Importing image path> <Root path for cloned VMs> <New VM Hyper-V name> <New VM Host name> <New VM Administrator password> [New VM MAC (optinal)]


    .\\CloneVM.ps1 "C:\\PPP 11.0 Image" "C:\\PPP 11.0 Clones" "PLESK VM 001" "HVPLESK001” "1qazxsW" "00155DECF690"

Cloning script description, step-by-step

  1. Create a new virtual machine by importing the VM image from the "Importing image path" location. The same operation can be done with "Hyper-V Manager" using the "Import Virtual Machine" wizard (though the script sets the “New VM Hyper-V name” also):

2. Recreate a network connection. NOTE: the NIC recreation step is added to the script because of the Hyper-V API error when resolving the IP address:

    .Get-WmiObject : Generic failure
At C:\\PPPCloningScript\\HyperV\\vm.ps1:525 char:37
+ Get-WmiObject <<<< -Namespace "root/cimV2" -query ("Select * from Win32_PingStatus where Address='" + $query) |
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand

You can check whether you need this step in your environment.

3. Change the virtual machine MAC address if it is provided in New VM MAC parameter.       4. Start the new virtual machine.       5. Get the new virtual machine IP address.       6. Initialize the new virtual machine. Initialize the Plesk environment, enable Remote Desktop (RDP), change the Administrator password and Host name, and install Plesk Micro-Updates. This step executes the “prepare\_vm.cmd” command file on the new VM using the “PsExec” tool: . You can change “prepare\_vm.cmd” how you like, but, please, do not remove the “cloning.exe” step. This step is needed to regenerate all Plesk passwords and GUIDs for the new cloned installation.       7. Restart the new virtual machine. This step is needed to complete “cloning.exe” and “change host name" operations.

Additional information

Approximately 15 to 30 minutes are needed to clone the new virtual machine with Plesk, depending on Hyper-V node performance.

Have more questions? Submit a request
Please sign in to leave a comment.