Disk Conversion Hyper-V vhd to vhdx – Cannot attach new disk on Virtual machine

Hyper-V includes a tool that can convert vhd disks to vhdx which is the newer version and should be used on production environments.

Sometimes the below error can occur which prevents one from attaching the new disk (vhdx) to the virtual machine needed. It seems as the new disk after the conversion to be locked and only by rebooting host the disk can be attached.

The process cannot access the file because it is being used by another process

This issue happens because the original disk is attached on the virtual machine during the conversion. The disk device should be attached as stated from Microsoft (link below). After the conversion the new disk can be attached and will not be locked from the host.