Convert VMware .vmdk to Hyper-V .vhdx with Powershell

Download Microsoft Virtual Machine Converter 3.1 over here.

  1. Install mvmc_setup.msi
  2. Run your Powershel 3.0+ as an administrator.

Import-Module “C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1”

Convert to VHD:
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “E:\Virtuele Machines\DC01\DC01.vmdk” -DestinationLiteralPath “G:\Hyper-V” -VhdType FixedHardDisk -VhdFormat Vhd

Convert VHD to VHDX:
Convert-VHD -Path ‘G:\Hyper-V\dc01.vhd’ -DestinationPath “G:\Hyper-V\dc01.vhdx” -VHDType Fixed -Passthru

Microsoft Virtual Machine Converter 3.0 Released

New Features in Microsoft Virtual Machine Converter 3.0
The 3.0 release of MVMC adds the ability to convert a physical computer running Windows Server 2008 or above server operating systems or Windows Vista or above client operating systems to a virtual machine running on Hyper-V host.

Standard stuff is:

  • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Microsoft Azure.
  • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
    Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
  • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
  • Supports conversion of offline virtual machines.
  • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
  • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
  • Windows Server® 2012 R2
  • Windows Server® 2012
  • Windows Server 2008 R2 SP1
  • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
  • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
  • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
  • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
    Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
    Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
  • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
  • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
    Note The offline disk conversion does not include driver fixes.

Download

Source

Hyper-V Configuration Toolkit

Mark Scholman has been working on a new script project to configure Hyper-V hosts.

This tool allows you to configure hyper-v hosts. It is using the converged network setup as described in this blog post. What it does is the following:

  • Rename Adapters
  • Create Teams
  • Create Tnics
  • Set Network Config (MGT,LM,CSV)
  • Join Server to the Domain
  • Create a server-local administrators group in the domain
  • Allows you to create a new or join an existing cluster
  • Configure Cluster network names
  • Configure Cluster Live migration subnet

On the to-do list is the following and will be added with upcoming releases:

  • Configure Storage network (iSCSI & SMB3)
  • Use of different topologies for converged networking as described here
  • Using Jea or PSCustomSessionConfiguration for deployment of Hyper-V hosts

How to use the tool:

On the newly provisioned Hyper-V Server start the Deploy-HyperVHost.ps1. On the Configure Nic’s tab select the adapters you want to use for Management (MGT / LM / CSV) and click “Set Management Adapters”:

Notice the list box will refresh with the new names for the adapters. Next select the adapters you want to use for VM Network and click “Set VMNet Adapters”

Finally configure Storage adapters:

Result is that we have configured all adapters now with a logical name we can use in the rest of the deployment:

Side note: I used 2 adapters for each team configuration, but you can use for example 3 adapters or 4 adapters for Management and 2 or 3 for the VMNet. The script is intelligent on using the logical names and reusing them in the Team setup.

Next part is to setup the host parameters and start the deployment of the host. Go to the tab “Configure host”

We need to specify the next parameters:
Host Name
The name of the server.
Domain Name
The domain to join the server to.
Management IP
The ip address for the management interface.
Management VLAN
If you’re using vlans specify the vlan id. Untagged is vlan 1.
Management gateway
The gateway for the management network.
Live Migration IP
The ip address for live migration (LM) communication
Live Migration VLAN
The VLAN id used for the LM network.
CSV IP
Cluster IP Address.
CSV VLAN
Cluster VLAN ID.
Primary DNS
The Primary DNS server to use for management network.
Secondary DNS (optional)
If applicable: The second DNS server for the management network.
Domain Controller Name
The Name of a Domain Controller. (needs remote Powershell enabled)
Local Admin Group Name (optional)
Name of a Domain group what is configured to be Local Administrator on the host
Group OU Path (optional)
The OU DN where the group needs to be created.
LAB: Build HyperV on HyperV

Used for demo purposes when you want to run this tool in a Hyper-V Virtual Machine. (Team settings and Hyper-V Role modification in the VM)

Next click on the “Deploy Host” button and enter domain admin credentials

Now wait until the server automatically reboots. While server is rebooting you can verify that the computer is in the domain and the local group is created:

When the server is rebooted login as the domain admin and start the Deployment tool again.

The last tab is for Configure the Cluster. You can create a new cluster:

Or add the node to an existing cluster:

Download the script http://gallery.technet.microsoft.com/Hyper-V-Deployment-Tool-419679d3

For the home lab: free toolkit from Veeam, Starwind and 5nine!

This is a little cool gem I discovered today: a free toolkit made available by Veeam, Starwind and 5nine software. This toolkit enables anyone to get started with virtualization, completely free. And even better, it’s very well known and high-quality stuff, too.

The most affordable toolkit to meet your goals!

There is no better way to start virtualizing than with a FREE Microsoft Hyper-V environment, free backup, free virtual storage and free management software!
With this free toolkit, you can create your own test lab, run a small business or even scale your production environment up to 1,000 VMs. It’s a FREE way to virtualize!

The toolkit consists of the following software:

Screen-Shot-2014-06-23-at-16.54.08-630x152

  1. Microsoft Hyper-V Server 2012 R2
    Free Hypervisor with all the functionality of it’s ‘big brother’, Windows Server 2012 R2 Hyper-V
  2. Veeam Backup & Replication
    Effective and easy-to-use tool for Hyper-V backup
  3. StarWind Virtual SAN
    Reliable shared storage with unlimited storage capacity for a single-node device
  4. 5nine Manager
    Simple and easy-to-use Graphical User Interface, local or remote, to manage Hyper-V virtual machines

Now obviously, since it’s a free bundle, the contained software will be free editions with limited functionality. But for in a lab, or when you’re just getting started with virtualization, it might be very cost-effective.

Screen-Shot-2014-06-23-at-16.54.16-630x163

Finally, here’s the evaluation guides for each of the products.

  1. Microsoft Hyper-V 2012 R2
  2. Veeam Backup Free Edition
  3. StarWind Virtual SAN
  4. 5nine Manager Free Edition

I think this is a good way to show the world what each of the products have in store, especially now with Hyper-V’s ecosystem evolving and maturing and having vendors like Veeam, Starwind and 5nine integrate not only with the hypervisor, but with each other, too!

Thnx to JOEP PISCAER

Microsoft Virtual Machine Converter 2.0

    Microsoft® Virtual Machine Converter (MVMC) is a Microsoft-supported, stand-alone solution for the information technology (IT) pro or solution provider who wants to convert virtual machines and disks from VMware hosts to Hyper-V® hosts and Windows Azure™.
    MVMC can be deployed with minimal dependencies. Because MVMC provides native support for Windows PowerShell®, it enables scripting and integration with data center automation workflows such as those authored and run within Microsoft System Center Orchestrator 2012 R2. It can also be invoked through the Windows PowerShell® command-line interface. The solution is simple to download, install, and use. In addition to the Windows PowerShell capability, MVMC provides a wizard-driven GUI to facilitate virtual machine conversion.
    New Features in MVMC 2.0
    MVMC 2.0 release of MVMC includes the following new features:

    • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Windows Azure.
    • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
      Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
    • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
    • Supports conversion of offline virtual machines.
    • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
    • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
    • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.
    Standard MVMC Features
    In addition to the new features previously identified, MVMC provides the following functionality:

    • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts on any of the following operating systems:
    • Windows Server® 2012 R2
    • Windows Server® 2012
    • Windows Server 2008 R2 SP1
    • Converts VMware virtual machines, virtual disks, and configurations for memory, virtual processor, and other virtual computing resources from the source to Hyper-V.
    • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
    • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.0, and VMware vSphere 4.1 hosts to Hyper-V.
    • Has a wizard-driven GUI, which simplifies performing virtual machine conversions.
    • Uninstalls VMware Tools before online conversion (online only) to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
      Important MVMC takes a snapshot of the virtual machine that you are converting before you uninstall VMware Tools, and then shuts down the source machine to preserve state during conversion. The virtual machine is restored to its previous state after the source disks that are attached to the virtual machine are successfully copied to the machine where the conversion process is run. At that point, the source machine in VMware can be turned on, if required.
      Important MVMC does not uninstall VMware Tools in an offline conversion. Instead, it disables VMware services, drivers, and programs only for Windows Server guest operating systems. For file conversions with Linux guest operating systems, VMware Tools are not disabled or uninstalled. We highly recommend that you manually uninstall VMware Tools when you convert an offline virtual machine.
    • Supports Windows Server and Linux guest operating system conversion. For more details, see the section “Supported Configurations for Virtual Machine Conversion” in this guide.
    • Includes Windows PowerShell capability for offline conversions of VMware-based virtual hard disks (VMDK) to a Hyper-V–based virtual hard disk file format (.vhd file).
      Note The offline disk conversion does not include driver fixes.

Download

HV Backup A free Hyper-V backup Tool

HVbackup is a very easy and powerful free tool to backup and restore Hyper-V virtual machines, in standalone and clustered (CSV) environments, overcoming all the limitations that a generic tool like Diskshadow provides.
This tool targets Windows 2008 (R2) and Windows Server 2012 (R2). All the corresponding core and free Hyper-V editions are also supported!
HVBackup supports app consistent and crash consistent backups through the Hyper V VSS writer component integrated in the operating system.
There are quite a few expensive commercial solutions on the market supporting this scenario, but this is the first open source one, based on the research we did before publishing the project.
We integrated this tool in our datacenter’s production environment management infrastructure, which means that it undergoes continuous testing in a real world environment 🙂
HVBackup can be invoked from the command line, scripted with Powershell or integrated in any .Net program through it’s class library.
The backup process generates a separate zip file for each virtual machine in the specified output directory, containing all the files owned by the VM and identified for backup by the VSS Hyper-V provider.
Requirements:
.Net Framework 3.5, which can be easily enabled on the command line.

Samples:

HVBackup -a -o c:\backup
Performs a full VSS backup (using the HyperV VSS writer) of all VMs on the host.
HVBackup -l VM1,VM2 -o \\yourserver\backup
Performs a full VSS backup of the provided list of VMs (use quotes if the names contain spaces).
In this sample the output directory is on a remote server.
HVBackup -f list.txt -o c:\backup
Performs a full VSS backup of the VMs names provided in “list.txt”, one per line.

How to perform a scheduled backup

backup.cmd :

set BCKPATH=\\yourserver\yourpath
net use %BCKPATH% /user:<user> <password>
pushd %BCKPATH% && forfiles.exe -m *.zip -d -7 -c “cmd /c del @path”
popd
HVBackup.exe -a -o %BCKPATH% 1> lastlog_out.txt 2> lastlog_err.txt

Note: This script will delete every zip file older than 7 days in the target directory before performing a backup of all the VMs on the host. Change it accordingly to your needs.

Now, as we don’t have a scheduled task UI on hyper-v or server core, in order to schedule the previous script every night at 01 AM, just run:

schtasks.exe /create /tn HVBackup /tr c:\hvbackup\backup.cmd /sc DAILY /ru <username> /rp /st 01:00:00

Tool: http://hypervbackup.codeplex.com/

Download: HVBackup_1_0_beta1_20120330.zip Windows 2008 (R2) and Windows Server 2012

Download: HVBackup_1_0_1_Beta.zip Windows Server 2012 R2

Windows Server 2012 R2 Hyper-V Component Architecture Poster

Provides a visual reference for understanding key Hyper-V technologies in Windows Server 2012 R2 and focuses on Generation 2 virtual machines, Hyper-V with virtual hard disk sharing, online virtual hard disk resizing, storage quality-of-service, enhanced session mode, live migration, Hyper-V failover clustering, and upgrading your private cloud

image

System Center Summer Night

For wo that missed the Dutch System Center Summer Night community event. Here are the slides: 

Convert VHD to VHDX

VHDX is the new and default format of virtual hard disk (VDH) that is provided by Windows 8 Client Hyper-V and Windows Server 2012 Hyper-V. There are many reasons to favor VHDX files over VHD files, including:

  • scalability to 64 TB instead of 2040GB
  • better performance by offering 4 K sector matching
  • protection against data corruption during power outages
Using PowerShell to Convert to VHDX

You can dispense with the time-consuming wizard by using PowerShell. This will be extremely useful if you need to use a script to automate lots of VHD conversions across many virtual machines. The following snippet will convert a VHD to a VHDX:

Convert-VHD –Path d:\VM01\Disk0.vhd –DestinationPath d:\VM01\Disk0.vhdx

When you create a new VHDX file (not converted) it has a physical sector size of 4 K. A converted VHDX file has a physical sector size of 512 Bytes. You can change the physical sector size of a converted VHDX by running this piece of PowerShell before you power up the virtual machine:

set-vhd d:\VM01\Disk0.vhdx -PhysicalSectorSizeBytes 4096

Now you have a virtual machine that is using the best kind of virtual machine storage, the VHDX format virtual hard disk

The above instructions do not finish the job. The next essential set of steps are:

  1. Open the settings of the virtual machine.
  2. Replace the VHD with the VHDX.
  3. Start and test the virtual machine.
  4. Delete the VHD file.

Microsoft Virtual Machine Converter Solution Accelerator

The Microsoft Virtual Machine Converter (MVMC) Solution Accelerator is a Microsoft-supported, stand-alone solution for the IT pro or solution provider who wants to convert VMware-based virtual machines and disks to Hyper-V®-based virtual machines and disks.

MVMC provides the following features:

  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts including Hyper-V on Windows Server® 2012. As part of the machine conversion MVMC converts the virtual disks attached to the source virtual machine. It also migrates configuration such as memory, virtual processor and so on from the source virtual machine to the converted virtual machine deployed on Hyper-V. It adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V.
  • Converts VMware virtual disks to Hyper-V based virtual hard disks (VHDs).
  • Supports conversion of virtual machines from VMware vSphere 4.1 and 5.0 hosts to Hyper-V.
    • Note MVMC also supports conversion of virtual machines from VMware vSphere 4.0 if the host is managed by vCenter 4.1 or vCenter 5.0. You have to connect to vCenter 4.1 or 5.0 through MVMC to convert virtual machines on vSphere 4.0.
  • Offers fully scriptable command-line interfaces for performing virtual machine and disk conversions that integrates well with data center automation workflows and Windows PowerShell scripts.
  • Has a wizard-driven GUI, making it simple to perform virtual machine conversion.
  • Uninstalls VMware tools prior to conversion to provide a clean way to migrate VMware-based virtual machines to Hyper-V.
  • Supports Windows Server guest operating system conversion, including Windows Server 2008 R2, Windows Server 2008 and Windows Server 2003 SP2.
  • Enables conversion of Windows® client versions including Windows 7.
  • Installs integration services on the converted virtual machine if the guest operating system is Windows Server 2003 SP2.

System requirements

Supported operating systems: Windows 7, Windows Server 2008 R2, Windows Server 2012

Before you install MVMC, you must install the following software on the computer on which MVMC will run:

  • Operating systems: Windows 7, Windows Server 2008 R2, or Windows Server 2012 (full installation)
  • Microsoft .NET Framework 3.5 and Microsoft .NET Framework 4 if installing MVMC on Windows 7 or Windows Server 2008 R2
  • Microsoft .NET Framework 4.5 if installing MVMC on Windows Server 2012

Download