100 days of code: Day 60

I am tracking notes on PowerShell in PS1 files on my git hub repository. You can see all 100 days of code entries on the blog category page.

Today I actually managed to get my server set up and going. Other than enable PS Remoting on it, this may or may not count as “coding” but I’m going to write about it anyway.

Over the last several years I start experimenting with Hyper-V Server. This is the free-as-in-beer version of Windows Server. Not a 180 day trial, no key of any kind required, it’s just free forever. The downside is there’s no graphics user interface. Even the login screen is some kind of CMD box. And there’s way to add a GUI either. It’s not an “optional GUI”. It’s just no GUI. Not like a Linux thing where you’re literally sitting at a CLI prompt. There’s still mouse support and some kind of foundations of a …I guess window manager? Anyway, it’s barebones to put it mildly.

Well a few years ago I started playing with Hyper-V Server 2016. In order to use this OS with literally any amount success you need to enable a few things:

  • remote desktop
  • Hyper-V manager (client side)
  • server manager (client side)
  • $ shares for the different volues (e.g. C$) as much for convenience as anything

And for whatever reason it took literally hours for me to get these all working on Hyper-V 2016. And I never knew why for instance Hyper-V manager started to work. It just did. Which makes it hard to reproduce.

So fast forward to a week or so ago when the “final” version of Hyper-V server 2019 came out (I’ve been waiting since September!). Naturally I wanted to install on my new server hardware.

As a side note, my new server hardware is hand-me-down from work: Dell R520 (2U) with a single Xeon (and a slot for a second) and 8 hard drive slots which I upgraded to 36 gigs of RAM, the boot drive to a 500 gig SSD and also I bought 6 more drive sleds so I could fill the whole thing with hard drives. I’m not using the onboard SAS/RAID controller. It also has two PSUs and two network cards. I when I got it there were only two drives and 4 gigs of RAM. They were enterprise grade drives and it was fancy ECC RAM though. Also, it’s extremely noisy. I don’t think I have any place I can put it my house where I can’t hear it on some level.

Anyway, for whatever reason I got all of my list setup and working in record time this time around. I’m not sure if I just lucked across some working commands or if 2019 is really so much way better.

I did all this for my real short-term goal: setting up a SpinRite server.

SpinRite – since I’m not sure how well known it is – is a hard drive utility for both regular maintenance and emergency recovery. You can use the exe to create an ISO for burning to a CD or it will write it to a USB thumb drive for you. It will then boot into DOS where you can configure it to run in whichever mode you want and off it will go.

Although you can “queue up” lots of drives, currently it only does one drive at a time. And since some drives can take 500 hours to complete if you have a stack of multi-terabyte drives this can be time consuming.

But someone figure out it’s possible to boot spinrite in a VM using the ISO, pointing the VM at an “offline” hard drive.

Which means I can now run spinrite on seven hard drives at once (can’t run it on the 8/boot drive). Which is much faster then one at a time. Although really I in the past I have maxed out however many desktop PCs I happen to have with as many drives as possible so at least I was doing 4 drives at once with several more queue’d per desktop PC.

So this is what I managed to do in one evening: configure Hyper-V 2019 so I could manage both it and the hosted Hyper-V VMs, also configuring remote desktop and the C$ share access for file transfers. And actually PS Remoting as well now that I know that’s a thing. Really it’s record time for me.

The slowest of the 7 drives looks like it’s going to finish in ~500 hours. It’s fine. I just won’t go in that room for a month. Or look at my electric bill.

Did I mention I have an enormous pile of HDDs, most of them SATA? Ya. Most. Can’t bring myself to throw out a working hard drive. Even if it’s not that much capacity.

Nice thing is I can keep using this server while it’s doing all that spinrite. Is spinrite a verb? I mean it should be. While everything is running I’ll try and use it with the remoting stuff and anything else that may come up in the book.

In case anybody is wondering I’m not listing the commands I used to make all this work because I’m not sure of which commands were necessary and the exactly steps to re-produce what I’ve done. I could create a VM to Hyper-V server. Although that would be a little…recursive? I could use Windows 10 Hyper-V VM. That could work. Or a laptop.

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