Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Conversion of virtual machine that has two or more disks fails in Virtual Machine Converter


Symptoms

When you use Microsoft Virtual Machine Converter (MVMC) v2.0 to convert a virtual machine that has two or more disks, the conversion process may fail with the following error:

System.InvalidOperationException: A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).

When you view the most recent MVMC log file in the user's %temp% folder in this situation, you find the following data:
05/07/2014 15:14:56 +02:00 [8] VERBOSE: Downloading VMware virtual disks from source virtual machine
05/07/2014 15:14:57 +02:00 [8] VERBOSE: Downloading device (/vm-1992-02-03/VirtualLsiLogicSASController0:0) disk-0.vmdk
05/07/2014 15:15:12 +02:00 [8] VERBOSE: Initializing (E:\MVMC\MVMC\0\disk-0.vhdx) with a size of 150323855360 with preallocate false.
05/07/2014 15:15:12 +02:00 [8] VERBOSE: End of initializing (E:\MVMC\MVMC\0\disk-0.vhdx).
05/07/2014 17:04:12 +02:00 [8] VERBOSE: Updating FAT/NTFS drive geometry.
05/07/2014 17:04:12 +02:00 [8] VERBOSE: Downloading device (/vm-1992-02-03/VirtualLsiLogicSASController0:1) disk-1.vmdk
05/07/2014 17:04:12 +02:00 [8] VERBOSE: Initializing (E:\MVMC\MVMC\0\disk-1.vhdx) with a size of 64424509440 with preallocate false.
05/07/2014 17:04:12 +02:00 [8] VERBOSE: End of initializing (E:\MVMC\MVMC\0\disk-1.vhdx).
05/07/2014 17:05:17 +02:00 [8] VERBOSE: System.InvalidOperationException: A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).
at System.Threading.Tasks.Task.Dispose(Boolean disposing)
at System.Threading.Tasks.Task.Dispose()
at Microsoft.Accelerators.Mvmc.Engine.ForVMware.ExportLease.GetFiles(IDownloadAdapter adapter, String host, DirectoryInfo dirInfo, TaskContext taskContext)
at Microsoft.Accelerators.Mvmc.Engine.ForVMware.VirtualMachine.DownloadFiles(IDownloadAdapter downloadAdapter, String toPath, TaskContext context)
at Microsoft.Accelerators.Mvmc.Engine.ServiceLayer.Internal.MachineConversionService.ConvertToDrives(IMachineConversionRequest machineConversionRequest, IPostProgress& provisionHyperVPhase, IVirtualMachine& sourceVM, TaskContext taskContext)

↑ Back to the top


Cause

This issue may occur when you try to convert a VMWare virtual machine that has two or more disks (VMDK files). 

↑ Back to the top


Resolution

This issue is resolved in the latest version of MVMC.

To download version 2.1, go to the following Microsoft website: 

The Date Published value for the package should be 6/12/2014 or later.

↑ Back to the top


More Information

When you review the log files, you notice that the first disk is successfully converted, as follows: 

VERBOSE: Initializing (E:\MVMC\MVMC\0\disk-0.vhdx) with a size of 150323855360 with preallocate false.
VERBOSE: End of initializing (E:\MVMC\MVMC\0\disk-0.vhdx).
VERBOSE: Updating FAT/NTFS drive geometry.
When the problem that's discussed in the "Symptoms" section is encountered, the following entries are logged. Notice that "Updating FAT/NTFS drive geometry" is replaced by "System.InvalidOperationException":

VERBOSE: Initializing (E:\MVMC\MVMC\0\disk-1.vhdx) with a size of 64424509440 with preallocate false.
VERBOSE: End of initializing (E:\MVMC\MVMC\0\disk-1.vhdx).
VERBOSE: System.InvalidOperationException: A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).
at System.Threading.Tasks.Task.Dispose(Boolean disposing)

↑ Back to the top


Keywords: kbexpertiseadvanced, kbtshoot, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2971014
Revision : 1
Created on : 1/7/2017
Published on : 7/4/2014
Exists online : False
Views : 95