Since I transitioned all of my non-day-job stuff from SederSoftware to Division42 for BizSpark, at-home I thought I’d also update my “data center” to the latest (Windows Server 2012 R2), since the next server version isn’t coming out until late next year. I’ve been VERY happy with this setup, so I thought I’d share how:
this whole setup is to an IT professional (a systems manager or a developer). People have asked me about this setup before, but it was sort of complicated to explain in :30 seconds, so this post will serve to show my current setup for anyone who might be interested.
What are you talking about?
I’m talking about getting a VERY inexpensive, but potent server – putting an extra SSD in it, and some RAM (which is cheap nowadays) – and you can bring up many virtual machines on that one physical server using Hyper-V on Window Server 2012 R2.
First, you’d need software – hopefully you have an MSDN subscription. If you do, then you already have 5 or 10 licenses for EACH version of Windows Server. I wouldn’t recommend using Essentials for this project (use Standard for most, and Data Center if you run out of licenses), but here’s what that looks like now in MSDN:
With Windows Server 2012 R2, they seem to give out more product keys than with previous versions.
Next, in order to make them reasonably responsive, a fast hard drive makes a big difference – so putting the VHD’s on an SSD takes care of that. Then, how much RAM you get pretty much determines how many systems you can set up.
Keep in mind, my setup here is all Windows-based, but Hyper-V supports most major Linux distributions too (Ubuntu, Fedora, CentOS, Debian, openSUSE, etc), so you could do something similar with Linux too. See this somewhat-dated blog post for more details on running Linux in Hyper-V – as far as what works and what doesn’t.
So in my case, a year or two ago I picked up a ThinkServer for something like ~$230 (I think it was this T140).
I put in an old drive I had lying around, to boot to, but I also bought a larger SSD drive (240GB) for the VM’s and got more RAM, I believe I got 32GB for around $350-400. So basically for maybe $700 total, I have a server that can host MANY virtual machines. In this case, I mostly use them for servers – you could host test workstations, Linux machines, etc.
In short, the server has a quad-core CPU and 32GB of RAM, it boots onto a regular hard drive, with Windows Server running, hosting Hyper-V. All of the virtual machines use the SSD for their “C:” drive.
Here’s how my new setup is broken down, by RAM:
|SHFLVMHOST||4GB*||The physical host running Hyper-V, it will have at least 4GB dedicated for VM overhead.|
|SHFLPDC01||2GB||Active Directory primary domain controller + DNS + DHCP|
|SHFLBDC01||2GB||Active Directory backup domain controller + DNS + DHCP|
|SHFLDBD01||6GB||Database server for MongoDB and MySQL (development)|
|SHFLDBQ01||6GB||Database server for MongoDB and MySQL (QA)|
|SHFLWEBD01||6GB||Web/IIS server (development)|
|SHFLWEBQ01||6GB||Web/IIS server (QA)|
and here’s how that looks in the Hyper-V manager on the SHFLVMHOST machine:
Now, I turned on “dynamic memory” which means Hyper-V only gives as much RAM to the machine as it needs. So, after 5 minutes of having that initial amount of RAM, it frees it back up if it’s not needed:
And you’ll see in Hyper-V how much RAM these machines actually take (with an extra 20% cushion):
So even though 28GB is available to all of these servers, they all only need about 4.5GB right now!
Now, you’ll probably say: “Hey dum-dum, you can’t run that many VM’s, the server will choke!” I hear what you’re saying, but here is what performance looks like MOST of the time:
As you can see, the only thing that takes the hit is disk, and that is not anywhere near bad. Having used setups like this for a few years, I’ve learned that hosting VM’s is ALL ABOUT the disk. So SSD’s are the only way to go if you are going to host more than 1 virtual machine.
If you are still not convinced, if you RDP into a server or reboot it – it is extremely fast (if you have the virtual hard drive on an SSD). So, this has excellent, excellent performance for all of the VM’s. I wouldn’t even say that the performance is “acceptable” or “good”, I would say it’s “great!”
The CPU is a Xeon quad-core:
Why would you do this?
This is a totally fair question. This seems like a lot of work, right? Why the big nerd-out? Well for me, there are two very significant benefits in this “investment”:
- This gives me a complete non-production environment (Active Directory, DNS, DHCP, and then a dev, QA, and potentially more environments for web development). I use this for projects I’m working on, or to test how certain infrastructure things works. I set this up once and it’s always available to me.
- This keeps me current on the infrastructure side of my job. I create an Active Directory from scratch, set up web and database servers from scratch, and get them all working together.
Let me elaborate. For the first point, I have a full-on dev and QA environment for any kind of Microsoft-oriented web application. So, for side projects I work on, this is very useful – it’s a very stable environment, and it has the same value as it does at work. Dev is where I test code on the server in IIS, QA is where I can have a stable release and where I can stage before production. If I didn’t have this, then I’d be flying a little looser than I’d like. I don’t like being this guy:
Bottom line, sure it’s fun to set this stuff up – but there is a real, tangible benefit to my side work and my professional development, in my professional opinion.
DNS + DHCP for the house:
Now, you might think: “I get my DNS from my broadband connection, and my Linksys router gives out DHCP addresses! Why the extra complexity?” True. However, how difficult does it make it to find other devices on your network? If you want to connect to that laptop on the couch, can you get to it by name? Is there a common username that grants access to all of the machines in the house (if you choose to do that)? With the above setup, the answer is probably no.
If you have your own configurable DNS server AND DHCP server, then that changes everything.
If you bring your laptop to my house, my Windows-based DHCP server is going to give you these settings (as of this writing):
Well technically the PDC gives out one range and has itself as the primary DNS and WINS whereas the BDC gives out an additional range and it makes ITself the primary. So, depending on which DHCP server gave you the IP, you might see the DNS and WINS addresses flipped.
This is significant because now you are using the Windows-based DNS now too. You might recall I did a blog post about this, but when DHCP gives your laptop an address, it gets it’s name and puts it into the DNS immediately. So, I can refer to your laptop by name. I don’t have any other access to it by default, but at least now I have a network where I can reference computers, printers, devices by name.
As for other devices in my home, if I have them “join the domain”, then I can have one account which grants me access to every computer and device on the network that supports AD. This includes Linux too. You can use products like “samba” or “likewise” to do this pretty easily.
If you have children, imagine if their laptop was joined to the domain? You, as a Domain Admin would always have access to their machine – if your family monitors your child’s computer access. You don’t have to “ask them for their password”, for example.
By the way, when I was setting up the new domain, the old domain named after my city location was still in use, so “Hernando” is the county location of where the server is. That’s what that name means. I do this too because if I collaborate with another person, if needed, presumably they could set up their own sub-domain – and we could share an Azure-based Active Directory. That’s a blog post for another day!
Bottom line / call-to-action:
What if you wanted to do this? What does this cost? For me, here’s how this breaks down:
- Money: in present day, you could buy a server + SSD + 32GB of RAM for about $700-800 dollars (or cannibalize some hardware you already have). I’ve used a lot of different brands and I’m REALLY happy with the value proposition of ThinkServer’s – you get a lot of horsepower, for a modest amount of money. They run extremely quiet too.
- Time: well, I did this project last night. This is probably the 5th time I’ve done this sort of thing and it took me about 5-6 hours from start to finish. I killed two birds with one stone because I also wrote most of this blog post while I was waiting for things to download/install too! Anyhow, this effort included:
- Downloading the new Windows Server 2012 R2 image from MSDN
- Kicking off the install on 6 virtual servers in Hyper-V
- Setting up the primary domain controller (plus DNS, plus DHCP)
- Once set up, add backup domain controller, and add each machine to the domain
- Run Windows Update on all machines, reboot, and re-run Windows Update until it’s all patched
So, that is an investment in money, and an investment of time of a weeknight or weekend morning – and now you have a permanent environment available to you PLUS you will likely learn a lot. Imagine being able to confidently say that you know how to set up Active Directory, LDAP, DNS, DHCP, etc in an interview! Imagine how this might help you when you are troubleshooting a production outage when you have a deep understanding and familiarity with all of the technologies involved?
If you say “I don’t know how to do some of that stuff” – then you are exactly who should take on a project like this. Imagine the things you’d learn? Every single question or problem you’d have has an answer, and it’s only a google search away! You can also reach out to me – I’ll help out if I can!
So, instead of “why set this up?” – I ask “why NOT set up your own personal data center at your house?”