Conversion of vhd to vhdx

Hi

I have a hyper v 2012 R2 server which has various guest servers.

The one is question is a Server 2008 VM running Exchange 2010.  It has 3 virtual drives:

C: os | 150GB
E: exchange DBs | 780GB
F: exchange DBs | 930GB

These are all VHD files.

Is there a safe way to convert to vhdx drives?

Alternativley i have space to create a new disk G:? which i could create as a vhdx and then move the DBs across to that drive and then kill the E and F.

Would the server cope with having a VHD with OS and VHDX with the DBs?

thanks
timb551IT ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexantSystemsCommented:
You will need matching space on your server to do it.
Shutdown the server
Run PowerShell with Admin Privleges
Run the following command replacing the "test" with your VHD location and information

Convert-VHD –Path c:\test\testvhd.vhd –DestinationPath c:\test\testvhdx.vhdx

When it is complete edit the settings on the VM to point the hard drive location to the new VHDX file.
Start your VM
Once you are happy with the results delete the old VHDs

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dan CraciunIT ConsultantCommented:
You could use Powershell for that: https://technet.microsoft.com/en-us/library/hh848454.aspx?f=255&MSPPError=-2147217396

It should be safe, but always backup before.

It does not work with a live VM, you need to shutdown the machine first.

HTH,
Dan
timb551IT ManagerAuthor Commented:
i dont have enough space to do all of them at once but can do one at a time boot the server make sure its ok and then delete the vhd and then do the next drive.

Will this work?

Will the server run with a mix and match of vhd and vhdx files?
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Dan CraciunIT ConsultantCommented:
I don't see a reason why not.
AlexantSystemsCommented:
Although this is technically possible, it is possible that unexpected errors can occur. Therefore, a VHDX file that is bootable to both generation 1 and generation 2 virtual machines is not supported or recommended.

The VHDX file can be attached to the IDE controller or the SCSI controller of a generation 1 virtual machine. However, if this is a bootable VHDX file, the generation 1 virtual machine will not boot.

This page has a lot of good answer to any other question you may have.
https://technet.microsoft.com/en-us/library/dn282285.aspx
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Yes, your process would work.

Shut down the VM.
Convert VHD to VHDX #1.
Detach VHD and attach VHDX to VM.
Boot and verify.
Repeat for VHD #2 then #3.

You may get an activation prompt, and you may need to boot to the OS load and use DiskPart to reorganize the drive letters.

And, as mentioned, please make sure the backup is good before running this process!
timb551IT ManagerAuthor Commented:
So are you saying AlexantSystems, that i could convert the non bootable volumes to vdhx files but not the bootable one?
timb551IT ManagerAuthor Commented:
Bit concered that one of you say that i can do this and one of you say i cannot.
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
On a generation 1 VM make sure your OS VHDX/Partition is hooked into IDE 0/0. Any data VHDX/Partitions can then be hooked into IDE 0/1 or IDE 1/0 or IDE 1/1.

On a Generation 2 VM (2012 R2 with 2012 R2+ guest OS) your bootable VHDX needs to be SCSI ID 0. The rest can go anywhere on the 63 remaining SCSI bus locations. :)
timb551IT ManagerAuthor Commented:
ok just to get this perfectly clear.

I have a server 2012 R2 server running hyper v.

I have a guest running Server 2008 and Exchange 2010 and using 3 x vhd files.

IDE Controller 0
Hard Drive 0 (C Drive)
Hard Drive 1 (E Drive)

IDE Controller 1
Hard Drive 0 (H Drive)

I can convert all the drives even the bootable os drive but would be better to do one at a time and boot after each conversion to make sure.

do i leave it as a generation 1 unit or is there a way of converting to generation 2 as well?

thanks
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Gen2 requires 2012 R2 as the guest OS.

Take a backup, make sure it's good, and run the conversion on all of the VHDs while offline.

Once the conversion is done and the new VHDXs are attached to the VM in the same order boot to SAFE MODE CMD and DiskPart then verify your partitions have the right drive letter.

Once the drive letter has been confirmed EXIT and reboot. VM should be good to go.
timb551IT ManagerAuthor Commented:
do i leave the drives on the ide connectors or do they need to move to scsi when they are vhdx?
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
VHDX can be attached to either in 2012 RTM/R2+.
timb551IT ManagerAuthor Commented:
I took a slightly different route last night on the server.

I created a new vhdx drive and added it to my guest os.

I then migrated the exchange databases to it.  This went well and Exchange is running as normal.

Does this sound reasonable as a route to have taken?

I now just have the C drive left as a vhd.  So presumably i can just run the conversion on this drive.
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
Excellent job. Just make sure the storage is not overprovisioned. Do so will cause a Paused-Critical stall for all VMs with VHDX files in that partition when it gets filled.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Hyper-V

From novice to tech pro — start learning today.