Wednesday, January 15, 2014

Testing Shared VHDX in Windows Server 2012 R2 Hyper-V environment

In Windows Server 2012 R2 with Hyper-V role, it supports a virtual hard disk sharing. Multiple virtual machines can share a virtual hard disk which is in vhdx format. To use shared VHDX function in Windows Server 2012 R2 with Hyper-V, there are some following requirements.
  • Operating systems of virtual machines: Windows Server 2012 or Windows Server 2012 R2 with Windows Server 2012 R2 Integration services
  • Storage requirements: Cluster Shared Volumes or Scale-Out File Server. This storage can be iSCSI, Fibre Channel, Serial Attached SCSI (SAS), or clustered storage spaces that use a set of shared SAS just-a-bunch-of-disks (JBOD) enclosures.


Virtual Hard Disk Sharing function can be applied to deploy failover cluster in virtual machines. It supports both Generation 1 and Generation 2 virtual machines.

In my lab environment, I don't have the above hardware. However, I read the post from Microsoft technet which was wrote by "Jose Barreto". He used a command "fltmc" to load  a minifilter driver to support Shared VHDX in a hard disk even though there is no "Cluster Shared Volumes" and "Scale-Out File Server" in his lab environment.

Remark: This following setting is used to testing Shared VHDX function. You shouldn't apply this following setting in any production environment.

Lab environment
  • 1 Windows Server 2012 R2 with Hyper-V role is named HV02
  • At least 2 physical hard disks in the server
  • 2 virtual machine are named VM01 and VM02

Goal
Share a virtual hard disk for 2 virtual machines by "Enable virtual hard disk sharing" in a lab environment.



1. On HV02, log in as Local Administrator.
2. Launch "Command Prompt" as administrator.
3. Perform "fltmc" to check the current minifilter driver.


There is no "svhdxflt" minifilter driver at this moment. To add "svhdxflt", we have to install "Failover Clustering" feature in the Hyper-V server, HV02.

4. Launch "PowerShell" as administrator.
5. Perform "Install-WindowsFeature Failover-Clustering -IncludeManagementTools" to install "Failover Clustering" feature.


6. Go to "Command Prompt" to check the current minifilter driver again.


"svhdxflt" minifilter driver has been installed. Then, we need to load this driver.

Before we load the "svhdxflt" driver, I'd like to add a new virtual hard disk in VM01.

7. Launch "Hyper-V Manager".
8. Make sure VM01 hasn't been started. Right-click "VM01", select "Settings".


9. Navigate to "SCSI Controller", click "Add" to add a "Hard Drive".


10. Next to "Virtual hard disk", click "New".


11. On "Before You Begin" window, click "Next".
12. On "Choose Disk Type" window, select "Dynamically expanding".


13. Click "Next".
14. On "Specify Name and Location" window, next to "Name", type "SHD01.vhdx".
14. Next to "Location", type "I:\DataDisk\".


There is a physical hard disk named I in my test environment. I will perform "fltmc" to attach the "svhdxflt" into this drive. There is no other vhdx file in I drive.

15. Click "Next".
16. On "Configure Disk" window, next to "Size", type "2".


17. Click "Next".
18. On "Summary" window, click "Finish".
19. Expand "SHD01.vhdx", select "Advanced Features".


20. On right pane, check "Enable virtual hard disk sharing" and then click "Apply".


The "svhdxflt" hasn't been loaded into I drive so we made this error.

21. Click "Close".
22. Go to "Command Prompt", perform "fltmc attach svhdxflt I:\" to load the driver into I drive.


The "svhdxflt" has been loaded successfully into I drive.

23. Back to "Settings for VM01 on HV02", click "Apply" again.


This time there is no error to enable virtual hard disk sharing.

24. Click "OK".
25. On "Hyper-V Manager", right-click "VM02", select "Settings".


26. Navigate to "SCSI Controller", click "Add" to add a "Hard Drive".
27. Click "Browse".


28. Navigate to "I:\DataDisk\", select "SHD01" and then click "Open".


29. Expand "SHD01.vhdx", select "Advanced Features".
30. On right pane, check "Enable virtual hard disk sharing" and then click "OK".


As a result, the virtual hard disk has been shared in both virtual machines.

More information:



Additional information:

This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment