Hyper-V 2019, on a R520

This is a follow up post to my several prior posts about both Hyper-V 2019 as an OS, using the Hyper-V hyper-visor for virtualization and my server hardware of choice the Dell R520.

This post will act as both re-write and follow-up to my previous post about Hyper-V 2019. I’m going to just leave the prior post there as something of reference. See the prior post for some explanations of some of the concepts mentioned here. See the bottom of this post for further references.

The real goal of the project is to be able to use my server for multiple virtual machines of various purposes and preferably be able do things like replace failed hard drives without losing all the data or having to re-install the OS. I would also like to set up a backup system just in case. That will have to wait for another post.

This is the best way I learn I have found: not by pre-planning ahead carefully and then implementing but by setting things up and very incrementally changing things and taking careful notes.

The status as of now:

  • As mentioned, this is the Hyper-V 2019 free-as-in-beer OS. I have installed WAC on it to make things a little easier.
  • all 8 hard drive slots are filled with a hard drive, albeit some of them low capacity
    • so far two of them are 10TB drives (out my total of five 10TB drives)
    • I also have two 8TB drives although one is still full of data
  • the drive pool and virtual disk have been created
    • I went with ReFS and 64K clusters since this will be entirely for VHDX storage
    • The virtual disk is “thin provisioned” with parity and 1 physical disk redundancy
    • I already set the virtual disk to 50TB even though I may or may not get to that volume size
    • The volume size is only (only?) 20TB but this also easy to make larger
  • I think I have a handle on safely removing one physical disk from the pool in favor of another
    • Since I have found server manager so unreliable for this task I have managed to perform most if not all the tasks with PowerShell
  • Even though I still have 3x 10TB drives to add to the pool I started experimenting with Hyper-V virtualization.
    • The last time I tried this I ended up locking myself out of the physical NIC and had to re-install the OS. I’ll try and avoid that this time. I probably could have fixed it with PS if I had bothered. I wasn’t patient enough.

I’m going to start by removing 3 small capacity disks, one at a time, and adding in the 10TB disk as a replacement. When this is accomplished I will expand the volume size to more closely match the max capacity of the virtual disk.

I’m going to do this while connected to the server by remote desktop. I could theoretically use WinRM but I don’t want to over-complicate any more than I have to.

The first step is to just run the get physical disk powershell command, Get-PhysicalDisk.

I manually sorted, formatted and filtered my current output. As you can see I have already manually set some friendly names to make this easier.

DeviceId        FriendlyName               Size
0               WDC WDS500G2B0A-00SM50     465.76 GB
1               10TB Slot ID1              9.1 TB
2               10TB Slot ID2              9.1 TB
3               ATA SAMSUNG HD103UJ        931.51 GB
4		ATA WDC WD10EARS-00Y       931.51 GB
5               1TB SN8792                 931.51 GB
6               2TB Hitachi                1.82 TB
7               1TB SN0079                 931.51 GB
8               8TBWD SNWKZZ               7.28 TB

I conveniently have some 1TB drives all in a row, in device IDs 3, 4 and 5.

I’m going to start by removing drive 3 from the storage pool, possibly correctly.

Upon looking at my prior post I don’t think I actually went over the actual commands for doing this. So I am going to be referring to this Microsoft documentation.

This particular document doesn’t say anything about taking the virtual disk offline or flagging the physical disk as “retired” or some other status prior to removing it. There’s only an example for removing it. So this is what I will try.

First, I will set a variable to the disk I want to remove:

$PDToRemove = Get-PhysicalDisk -Friendlyname "ATA SAMSUNG HD103UJ"

This can be verified by simply putting the variable name in PowerShell like a command. Should come back with the output of the Get-PhysicalDisk command.

Next is the actual physical disk removal command:

Remove-PhysicalDisk -PhysicalDisks $PDToRemove -StoragePoolFriendlyName "WinStorePool"

When I ran this I actually got back this prompt:

Confirm
Are you sure you want to perform this action?
Removing a physical disk will cause problems with the fault tolerance capabilities of the following storage pool:
"WinStorePool".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):

Which surprised me actually as I have no idea why this would affect fault tolerance. I also don’t think it matters since I’ll be replacing it shortly. So I pushed Enter for yes.

Once I did that I did the following three commands:

  • Get-PhysicalDisk
  • Get-StoragePool
  • Get-VirtualDisk

Drive 3 is now “True” under “CanPool”, the pool status is still “healthy” and the virtual disk still lists FaultDomainRedundancy as a 1. I’m just assuming FaultDomainRedundancy refers to fault tolerance as this makes sense.

So the next step is removing the physical disk and inserting a 10TB drive.

I powered down the server, removed the disk and inserted the 10TB disk and powered on the server.

As I learned from adding the first two 10TB drives, these 10TB drives come already formatted out of the box. So to make them available to be added into the pool I have to delete the partitions and convert the disks to as close to “raw” as I can.

Actually the first time I tried this I some how added the drive to the pool and had it as a separate volume at the same time. Really seems like that should not be possible. Apparently there are still many concepts I have yet to learn in regards to storage spaces.

As I figured the 10TB drive has shown up (I used Get-Volume) as a pre-existing drive which already has a drive letter. So lets look at the MS documentation. I know I could Server Manager but I’m trying to be all PowerShell right now.

Based mostly on the name, I’m going to try the Reset-PhysicalDisk cmdlet:

Reset-PhysicalDisk -FriendlyName "ATA WDC WD100EMAZ-00"

This ran without error but did not apparently do anything as the disk status has not changed.

The next cmdlet I found to try is Initialize-Disk. But it appears this one takes a disk number as a parameter. I think the best way to confirm disk numbers, which may or may not be the same as Device IDs, is through the cmdlet Get-Disk. Not sure why Get-Disk and Get-PhysicalDisk both exist. Seems a little strange. In any case Get-Disk indicated the 10TB drive is disk 3. So I’ll use this in my Initialize-Disk command:

Initialize-Disk -Number 3

This command didn’t run though as it is apparently only intended for use with disks that are already classified as “raw”. So I will come back to it. I think I what I need to do is delete the volume first.

I found a Remove-Partition but I don’t think this is what I’m looking for. Not sure why I’m so stuck on only using PS. I guess because it seems possible through Server Manager and keep viewing that as front end to some PS commands. In any case I could just as easily use diskpart so that is what I will use.

I went into diskpart, selected the volume 3 with select vol 3 then deleted the volume with del vol 3.

A subsequent look at volumes and disks through PS seems to indicate the disk is no longer a volume but it is still categorized as “false” in the “canpool” column. So I will try the Initialize-Disk command from above: this cmdlet is still not working. So I will also try Reset-PhysicalDisk from above and try that out:

Reset-PhysicalDisk -FriendlyName "ATA WDC WD100EMAZ-00"

This apparently did work and my 10TB drive is now flagged as “True” in the “CanPool” category.

That took a while but at least I’m learning and I assume the next disk will go that much faster. Right?

The next step I’m assuming is to add the disk to the storage pool. I’m going to go out on a limb here and assume cmdlet Add-PhysicalDisk can be used for that task.

I know there’s a one line version of doing this but I’m going to do it the two-command way anyway.

As above I first create a variable assigned to a Get-PhysicalDisk, then use that variable in the actual Add-PhysicalDisk.

$PDToAdd = Get-PhysicalDisk -Friendlyname "ATA WDC WD100EMAZ-00"
Add-PhysicalDisk -PhysicalDisks $PDToAdd -StoragePoolFriendlyName "WinStorePool"

I think I’ve learned the steps to doing this albeit amazingly slowly:

  • remove disk I don’t want via PS cmdlet
  • power down server/physically remove disk
  • insert replacement physical disk/power on server
  • if the new disk has an existing volume use diskpart to delete the volume of the new disk
  • use PS to “reset” the disk
    • confirm the disk has “true” for “CanPool”
  • Use the Add-PhysicalDisk cmdlet to add the drive into the pool

Now I’m going to try this again with disk number 4. Looking at the output table at the top of this post, it would appear that disk 4 is still disk 4 after all this disk swapping. I did apparently flag this disk as a “hot spare”. Though I haven’t been able to find a definitive explanation of what that means in this context (does it auto-take over for a failed disk? Or does it mean it can be removed without powering off the server? in either case a 1TB drive isn’t going to help).

This time I take the extra step and setting this “hot spare” to the same usage as the rest of the disks, which is “auto-select”.

This command should work:

Set-PhysicalDisk -FriendlyName "ATA WDC WD10EARS-00Y" -Usage AutoSelect

Now, following my own steps from above, I’ll first set the variable and remove disk 4:

$PDToRemove = Get-PhysicalDisk -Friendlyname "ATA WDC WD10EARS-00Y"
Remove-PhysicalDisk -PhysicalDisks $PDToRemove -StoragePoolFriendlyName "WinStorePool"

One power down/disk swap/power up later…

Same as above, the first step is deleting the volume via diskpart…

Well I would say the next step is resetting the new disk as above except I have run into the same problem as my prior post: two of my 10TB disks have the same friendly name and Reset-PhysicalDisk only identifies disks directly via friendly name. Luckily via examples and experimentation on my last post I figured out how to identify the disk by serial number. But instead of simply resetting the disk I’m going to pause set a new friendly name for the disks that are currently identically named.

As above I set a variable to the output of a command that can identify a disk by serial number, Get-PhysicalDisk. I then use this variable as part of the Set-PhysicalDisk command and specify a new one. Since the first two 10TB disks are already identified by slot number I will continue this with the rest.

For what may or may not be necessary security I will be obscuring the actual serial numbers.

$DiskToChange = Get-PhysicalDisk -SerialNumber WD-xxxxxxxxx
Set-PhysicalDisk -InputObject $DiskToChange -NewFriendlyName "10TB Slot ID3"

I did this for both disk 3 and 4 (disk numbering starting at 1).

Resuming from before the slight detour…

I need to reset disk 4:

Reset-PhysicalDisk -FriendlyName "10TB Slot ID4"

As I was hoping, this disk is now add-to-pool friendly.

Now I just add it to the pool:

$PDToAdd = Get-PhysicalDisk -Friendlyname "10TB Slot ID4"
Add-PhysicalDisk -PhysicalDisks $PDToAdd -StoragePoolFriendlyName "WinStorePool"

Well this worked with one minor caveat: I set the friendly name of the disk then reset the disk. Resetting the disk reset the friendly name. So when I went to add the disk to the pool by friendly name…the command came up empty. Perhaps obviously: it’s important to reset a disk first and then set things like the friendly name. This shouldn’t come up too often unless you just happened to need to set a friendly name for some reason.

This appears to be getting easier. This time I will swap out disk 5 for a 10TB and not worry so much about the details.

One addition of a 5th 10TB drive later…

And with that I have 10TB x5 hard drives in my R520 server. I’m now I don’t know… 25% done setting up the server maybe?

For storage I would like to move the one 8TB drive currently present to slot 6 and rename accordingly. I think I can do that without having to remove it with PS first. Then set a good friendly name for it.

I would also like to copy the data from my second 8TB drive and add it to the pool. But that will have to wait until I have set up whichever virtual machine I’m going to use as file server. Or I could the second one as part of the back up solution.

What I should really do is order three more 10TB drives and use my left over drives in the second PC that will be for backup. The secondary PC won’t ever have the capacity of the R520 but it will be a fall back if something ever happened to the data on the R520. I will have to wait for Black Friday or some other sale for those additional 10TB drives.


Even though it wasn’t necessary in the list of tasks I wanted to accomplish for this post, I wanted to add some commands to re-size both virtual disk and the partition of the volume I have so it was all here in one place.

To get the friendly name of the virtual disk and its current capacity the obvious cmdlet works:

Get-VirtualDisk

In my case the friendly name is vdisk1.

From there it’s just a simple re-size disk command:

Resize-VirtualDisk -FriendlyName "Vdisk1" -Size (58TB)

To resize the partition, I first need to figure out which disk and partition (really it’s the volume) it is so the resize partition command knows what I’m talking about.

First use this

Get-Disk

To get all the drives on the system. In my case my virtual disk is named “vdisk1” and is disk number 9.

I then query that disk with get-partition:

Get-Partition -DiskNumber 9

This shows me both the drive letter and partition number of the partition I wanted to re-size. For me this was partition 2.

So to resize the partition to something larger:

Resize-Partition -DiskNumber 9 -PartitionNumber 2 -size (25TB)

I actually don’t know if the parenthesis are necessary it was just there in the examples.


References and Resources

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s