Azure Stack HCI - How to create a shared disk?

45 views Asked by At

There is a request for a shared disk for two Hyper-V virtual machines.

I'm from VMware background and not familiar with Hyper-V and its PowerShell commands.

The GUI interface of the Windows Admin Center of the Azure Stack HCI does not have the option to create a shared disk as in the Hyper-V Manager.

1

There are 1 answers

0
Nash A On

From the article below, I was able to figure out the commands to create the shared disk and add it to the VMs.

https://cloudmechanic.net/2016/04/25/adding-shared-vhdx-using-powershell/

PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Add-VMHardDiskDrive -VMName 3753D-HCIWIN12 -Path C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21\HCIWIN12-HCIWIN21-disk01.vhdx -ShareVirtualDisk

PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Get-VMHardDiskDrive -VMName 3753d-hciwin12

VMName         ControllerType ControllerNumber ControllerLocation DiskNumber Path
------         -------------- ---------------- ------------------ ---------- ----
3753D-HCIWIN12 SCSI           0                0                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                5                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                6                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                7                             C:\ClusterStorage\Volume01\imageStore\d...

Before I move on to adding this disk to another VM, I was thinking, why not add this disk to a separate disk controller.

After powering off the VMs and removing the shared disk from the first VM, below are the codes and the final results.

PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Add-VMHardDiskDrive -VMName 3753D-HCIWIN12 -Path C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21\HCIWIN12-HCIWIN21-disk01.vhdx -ShareVirtualDisk -ControllerType SCSI -ControllerNumber 1 -ControllerLocation 0
Add-VMHardDiskDrive : The Update-ClusterVirtualMachineConfiguration command could not be completed.
At line:1 char:1
+ Add-VMHardDiskDrive -VMName 3753D-HCIWIN12 -Path C:\ClusterStorage\Vo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Add-VMHardDiskDrive], VirtualizationException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.AddVMHardDiskDrive

PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Get-VMHardDiskDrive -VMName 3753d-hciwin12

VMName         ControllerType ControllerNumber ControllerLocation DiskNumber Path
------         -------------- ---------------- ------------------ ---------- ----
3753D-HCIWIN12 SCSI           0                0                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                5                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                6                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           0                7                             C:\ClusterStorage\Volume01\imageStore\d...
3753D-HCIWIN12 SCSI           1                0                             C:\ClusterStorage\Volume03\SharedDisk-H...

PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Add-VMHardDiskDrive -VMName 3753D-HCIWIN21 -Path C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21\HCIWIN12-HCIWIN21-disk01.vhdx -ShareVirtualDisk -ControllerType SCSI -ControllerNumber 1 -ControllerLocation 0
PS C:\ClusterStorage\Volume03\SharedDisk-HCIWIN12-HCIWIN21> Get-VMHardDiskDrive -VMName 3753d-hciwin21

VMName         ControllerType ControllerNumber ControllerLocation DiskNumber Path
------         -------------- ---------------- ------------------ ---------- ----
3753D-HCIWIN21 SCSI           0                0                             C:\ClusterStorage\Volume03\Hyper-V\3753...
3753D-HCIWIN21 SCSI           0                1                             C:\ClusterStorage\Volume03\Hyper-V\3753...
3753D-HCIWIN21 SCSI           0                2                             C:\ClusterStorage\Volume03\Hyper-V\3753...
3753D-HCIWIN21 SCSI           0                3                             C:\ClusterStorage\Volume03\Hyper-V\3753...
3753D-HCIWIN21 SCSI           0                4                             C:\ClusterStorage\Volume03\Hyper-V\3753...
3753D-HCIWIN21 SCSI           1                0                             C:\ClusterStorage\Volume03\SharedDisk-H...

Screenshoot of Disk Manager from the VMs