Contacts

Convert VHD in VMDK. Convert virtual disks on the example of working with the StarWind V2V utility converting VMDK in VHD

Today we want to tell how to convert virtual machine disks from one format to another. Suppose we have a virtual machine deployed in VMware virtualization environment, and we want to import it to Hyper-V Wednesday. Or vendor releases distributions only for Hyper-V, and we will definitely need to deploy the car in VMware, because we have the entire network on it. If you encountered such a problem, then be sure to read this article and you will find a solution.

Process

There are several formats of virtual rigid disks, which are supported by different virtualization media. Consider some of them:

  • VMDK (Virtual Machine Disk) - Virtual Hard Drive Image Image format for virtual machines developed by VMware
  • VHD (Virtual Hard Disk) - File format used for storage operating systemsDeveloped by Connectix, which later was purchased by Microsoft and is now used for Hyper-V images. VHDX is the same, only all the disk space should be set immediately.
  • VDI (Virtual Disk Images) - format of the image of the rigid disk guest virtual machines VirtualBox.

If you are using VirtualBox - Congratulations, you can take any of the available formats and create a virtual machine.

But it turned out that VHD and VMDK formats are incompatible with each other. Therefore, so that you can use VMDK in Hyper-V, and VHD in VMware, you first need to convert them.

So, let's say we have a VMWare virtual machine with a hard disk image Local-vm-disk1.vmdkwhich is in the folder C: \\ vmdks. In order to transfer it to Hyper-V, create a folder where our converted file VHD.C: \\ VHDS. After that, I download a special program from Microsoft - Microsoft Virtual Machine Converter 3.0, it is available at https://www.microsoft.com/en-us/download/details.aspx?id\u003d42497.

After pressing the button DownloadWe will offer to download 2 files - the program itself and the description of the teams. Install the program.


Before continuing, make sure that the PowerShell version that you have 3 or higher. You can check it if you enter the $ PSVersionTable command


If the version is below 3 - update PowerShell, if 3 or higher, then continue. To begin with, you must specify the path to the converter script, for this we enter the command:

Import-Module 'C: \\ Program Files \\ Microsoft Virtual Machine Converter \\ mvmccmdlet.psd1'

The location of the script may differ from C: \\ Program Files \\ Microsoft Virtual Machine Converter \\, it all depends on which path was specified when installing the program

The command must be executed without any errors. If the errors still appear - check the location of the script and correct input. Well, write an output of errors in the comments - we will try to help :)

Now you can start conversion. To do this, enter the following command:

Convertto-mvmcvirtualharddisk -sourceliteralpath "C: \\ Vmdks \\ Local-VM-Disk1.vmdk" -DestinationliteralPath "C: \\ VHDS \\" -VHDTYPE DynamichardDisk -Vhdformat VHD

  • C: \\ Vmdks \\ Local-vm-disk1.vmdk - path to the convertible image of VMDK format
  • C: \\ VHDS \\ - Folder where the converted VHD format image will be placed

After that, you can go to the folder where the converted file will be placed and monitor how it increases.

Built in Hyper-V, the disk conversion feature is hard to call a full-fledged converter. All that the Microsoft regular hypervisor can do with virtual hard disks of VHD and VHDX's own hard disks is to convert these formats one to another, as well as change the dynamic type to a fixed and vice versa.

The mechanism for converting virtual disks into the formats of other hypervisors as it is, for example, is provided for in virtualBox programThe Hyper-V is missing.

Let us consider how the process of converting VHD and VHDX disks is occurring with the guests installed to another type and format. We will convert the discs using the standard Hyper-V capabilities as part of Windows 10 and a third-party free StarWind V2V Converter program.

  • Why are virtual hard drives transformed
  • Transformation of VHD and VHDX discs from dynamic type in fixed and vice versa means HYPER-V
  • Transformation VHDX in VHD and, on the contrary, VHD in VHDX means Hyper-V
  • Transformation VHDX in the VMDK program StarWind V2V Converter
  • on the developer's website, after completing the questionnaire to register StarWind account. Link to download the installer comes to the mail specified in the registration data.

    With virtual format hard disks VMDK works not only by the native VMware hypervisor, but also VirtualBox. The process of converting VHDX disks in VMDK disks is still not avoided if the virtual machine Hyper-V You need to run on VMware or VirtualBox. But also in the transformation of the VHD format, supported and VMware, and VirtualBox, there are your benefits - VMDK discs more economically spend disk space physical computer, rather than VHD discs.

    StarWind V2V Converter can convert VHD and VHDX discs in VMDK discs. And vice versa - VMDK discs in VHD and VHDX discs. For VHD and VMDK disks, you can choose other than the existing type is dynamic or fixed. Consider the operation of the program on the example of the VHDX disk conversion into the VMDK disk.

    We launch StarWind V2V Converter and immediately press "Next".

    Indicate the way source file. VHDX. We click "Next".

    Select the format and type of VMDK disk. In our case, the first option is selected - VMWare Growable Image. This is a dynamic type of disk. Second version - VMware Pre-Allocated Image - This type of disk is fixed. We click "Next".

    As a VMWare controller, when creating virtual machines, it is recommended to select SCSI, and select it. We click "Next".

    04.12.2015 7310

    Nylicity of a certain number of restrictions does not diminish the dignity virtualization - one of the most remarkable technologies used for safe launch Applications in an isolated medium, testing software And God knows what. To create virtual disks - this most isolated environment is used. special programs, such as the Vmware. and VirtualBox. Either Hyper-V.integrated tool Microsoft Windows..


    Since virtualization has become an ordinary thing not only among system administratorsbut also among ordinary users, developers software Virtualization It is time to create a single compatible format of virtual machines. Justice should be said that the work in this direction is maintained, however, facing incompatibility problems when transferring virtual machines from one hypervisor to another, it is quite often.

    For example, how do you order, if you need to transfer the virtual machine Hyper-V. new format VHDX on the Vmware. or vice versa? Of course, you can go in the open paths, convert the disk VHDX In Old VHD. and try to connect it VirtualBox.but it is better to use a special utility-converter that allows you to convert virtual disks VHD. and VHDX in disks Vmdk. and vice versa. Together with this utility also allows you to choose a type of disk - dynamic or fixed.

    You can download the utility for free from the official page. www.starwindsoftware.com/v2v-converter-downloadhaving previously registered either download it from the resource SoftPediaIf you do not want to spend time on filling the fields of form. Install the utility, run it immediately press "Further". Specify through an overview path to the transformed disk VHD. or VHDX and press "Next".

    Next, the program will offer you to decide on the disk format. (for vmdk it is vmware growable image) and its type. If you need dynamic disk , choose Vmware Growable Image.if fixed, choose VMware Pre-Allocated Image. Click "Next".

    In the next window, you will need to specify the type of controller. It is recommended to choose SCSI.

    VHD disk conversion in VHDX

    The difference between disk data formats are reflected in the note. Now let's talk about how to convert these disks.

    It is worth noting - when converting a simple operating OS is inevitable, because A new format file (similar size) is created. Conversion Tool - Hyper-V,therefore, go to Hyper-V Manager, select "Edit Disk", go to VHD Editing Wizard:

    Specify the location of the disk that you want to convert and select the "Convert" item:

    Select the desired format and disk type:

    After that, specify the name and location of the "new" disk:

    Wherein old disc It remains in place, so for the further use of VM, it is necessary to delete and prescribe a new VHDX disk.

    Conversion available and through PowerShell.:

    Convert-VHD -Path "D: \\ Hyper-V \\ srv2k3.vhd" -vhdtype fixed -destinationpath "D: \\ Hyper-V \\ NEWSRV2K3.VHDX" -DeleteSource

    This line indicates the place of the old and "new" disks (-path and -destinationpath), the disk type (-vhdtype fixed, fixed size) and delete the source disk upon completion of the conversion (-deleteSource).

    IN Windows Server 2012 Hyper-V supported a new virtual disk format - VHDX. Virtual disks In VHDX format have many advantages, including greater maximum size Disc - 64 TB, protection against data damage and much more. You can convert current drives in VHD format to a new VHDX format using the Hyper-V Manager console. During the process will be created new Disc VHDX and copied data from the old disk to the new one. At the end of the procedure you will have 2 disks - in old format and in the new. After successful checking a new disk, you can manually remove the old one.

    • Turn off the virtual machine that has access to the disk.
    • Open settings virtual machine and found disc. We are waiting for the Edit button:
    • The Edit Virtual Hard Disk Wizard wizard is launched. Select an action Convert. and press Next .

    • Select Format VHDX and press Next.

    • You can choose whether the disk should be fixed or its size can dynamically change. This access option is no matter what type of disk has previously. Click Next.
    • Select the name and schedule of a new VHDX disk and click Next.
    • Check all settings and click FINISH To create a new disk. The creation time depends on the size of the source disk and the speed of your hard disk. On my SSD disk VHD sizes 300GB converted about 2 minutes.

    • The final stage will be the connection of a new disk to the virtual machine.

    After downloading the virtual machine, you need to check that everything is in order. If so, you can safely remove the old disk.

    You can also use PowerShell to convert. In this case, the actions turns out an order of magnitude less :)

    Convert-VHD -Path \\\\ Win2012-DC01 \\ VMS \\ OLD.VHD -DestinationPath \\\\ Win2012-DC01 \\ VMS \\ New.VHDX -DeleteSource -ComputerName Win2012-HV01

    Helpful information



    Did you like the article? Share it