Yet another SQL Server DBA…

Just another SQL Server DBA blog

Merry Christmas to data professionals

Posted by Szymon Wójcik on December 25, 2012

Let me use this opportunity to wish all the best for all of you database professionals out there. Here is what you might want to find under the Christmas B-tree:

DBAs:
Let your backups run smooth and never get broken;
May your recovery never surprise you;
May the drives never break and SAN be always available;
Have licensing be no worry for you;
Let indexes never fragment and their maintenance be transparent to users.

Devs:
May your queries use the best indexes and never cause excessive locks;
May the data be normalized when possible, properly sized and typed;
Let the keys and constraints describe what needed;
May you use right tools for the job.

All the best in the coming 2013 to everyone!

Posted in SQL Server | Leave a Comment »

What I worked with in my life (in terms of computers)

Posted by Szymon Wójcik on December 5, 2012

OK, so this is mostly off-topic as the main course is concerned. Yet I thought I might share the list of stuff I worked with over the years.

I am in my thirties now and my first contact with computers was in late 80s, when I played the unforgettable “River Raid” on Atari 800 XL thanks to courtesy of my uncle. This Atari became later mine and I spent time first playing with it, but thanks to it my first non-gaming computer endeavours were about 20 years ago. I was 11 by that time and I first discovered Basic (which sucked on the Atari, especially if you had a tape drive) and then 6502 assembler. I even managed to create a simple game in the assembler (I was 13 or so).

Then came the PC. I had a 80486DX2 in 1995, which was a powerful machine then. Of course first steps were games (ID’s Doom and Doom 2, to be exact), but since I had only 4 MB of RAM (yes, memory was then counted in megabytes), I needed to squeeze every possible free byte in order to make the games run. This led me to batch files and multi-boot on MS-DOS 6.22 and further configuration topics like setting up EMS/XMS, UMB (anyone remembers those?). Then I came basic to Basic – Microsoft QBasic, which was included in MS-DOS – and tried to create a playable game. After all, QBasic turned out not to be the most friendly and performing and I got my hands on C handbook by Kerrigan/Richie. Using this and Borland C++ 3.1 compiler I made my first steps into programming. It was 1996.

Then I discovered 80386 assembler – I tried to code some graphic effects using it (up to some success, even). I ended up with almost complete River Raid clone with animations done in back buffer, most of it coded in C and graphic library in assembler. After that, in summer 1997 I got a quick job by an acquaintance for developing a search engine for website using Perl and text files (no one ever thought it’s NoSQL back then, heh). I saw Windows NT 4.0 and IIS for the first time.

Then I went off the grid completely using computer only for recreational purposes until I started a computer science course on university in 2002. I had contact with many techs (most of them obsolete now, as they were those days as well) – Pascal, C/C++, C#, Java, sockets, assembler, Ada, SQL, even Novell Netware. In the mean time I picked up PHP, JavaScript and some Python, had some XML experience (XSD/XSLT, XQuery, XPath). This list will wrap up my last five years (more or less since I started my professional career):

  • server operating systems – everything Windows – Servers 2003/2008 (with or without R2) and 2012. I didn’t have much experience with NT/2000 though. I had an episode with Linux – Debian 4 – it did work, but that’s all.
  • client operating systems – mostly Windows – 2000/XP/7/8 (consciously skipping Vista). I also tried others – Ubuntu (didn’t like it) or Debian with a GUI (didn’t work for me).
  • virtualization:
    • platforms – Virtual Server 2005 R2 (yes, someone still uses it :P ), Windows Server 2008 R2 and 2012 w/Hyper-V and Windows 8 with Hyper-V Client. Hyper-V is cool, especially in version 3.0, can’t argue with that.
    • systems – SCVMM 2008 R2/2012 overseeing a home lab consisting of two Hyper-V hosts; it’s more than enough for a proof of concept :)
  • database servers – SQL Server from 2000 up and I feel best with 2005 or newer. I also tried Oracle 11 and have a prepared environment for playing with newest DB2 in home lab.
  • web servers:
    • IIS 6/7/7.5/8 – included in Server 2003/2008(R2)/2012. I successfully managed to make several classic ASP websites work with IIS 7.5, and it’s tough, IIS from 7 up brings many breaking changes to ASP, which need to be dealt with.
    • Apache 2.0/2.2 – did a pretty standard config, nothing out of ordinary. Most complex thing I did were rewrite rules.
  • application servers:
    • SharePoint – I know how to use it and I know how to install it. Installed WSS 3.0 on Windows Server 2003 R2 (that’s easy) and Windows Server 2008 R2 (that’s more difficult, since it’s not out-of-the-box), apart from that some lab installations of SharePoint Server 2010 and 2013. I might administer it but it would need a lot of motivation for me to think about becoming a SharePoint developer.
    • BizTalk – I tried to install 2010 in the lab but couldn’t make it work properly, still willing to give it another try, though :)
    • Tomcat on Windows – installed it but had absolutely no clue what to do it what it after that, so tossed it away.
    • SAP Business Connector (rebranded WebMethods Integration Server) - I did almost everything with it (versions 4.7/4.8), from installation through administration to development. Good points – it’s Java and it works; bad – it’s Java and sometimes it doesn’t work.
  • scripting:
    • VBScript – just a few maintenance scripts
    • PowerShell – even more maintenance scripts, but I’m all in for it
  • SAP:
    • I can read ABAP and most certainly I would be able to write but I didn’t
    • I know my way around PP/MM modules
    • I know just a bit about WM module
  • programming:
    • I wrote a few useless apps in C# to help me in the office
    • I refreshed my knowledge of JavaScript by getting to know AJAX and jQuery
    • Even tried to do some stuff in VBA for Excel/Access

What about future? Software world is constantly evolving and it’s speeding up year after year. You have to learn new things if you want to keep up with it. My resolution for next year is the following:

  • have a basic experience with analytics as BI will be more important wig Big Data gaining more and more
  • keep interest in cloud solutions
  • try out some NoSQL (anyone can recommend a product?)
  • work out on application design, including scalability and performance

Posted in Uncategorized | Leave a Comment »

How to get CLR file contents from database (and convert from varbinary to string)

Posted by Szymon Wójcik on October 26, 2012

Imagine following situation – you have a procedure that uses CLR function to perform some data manipulation. You suspect the CLR function to be sub-optimal, but don’t have the source and cannot confirm your claim. If you are lucky, you can get its contents by scripting whole assembly – if it’s in a DLL, you might try to reverse-engineer it using .NET Reflector (if you have a DLL file). If it’s a separate file (in C# for example), it is scripted in binary format and you have to unscramble it. This is my method of doing it:

;WITH s AS (SELECT 'here comes binary representation of file' s),
num AS (
SELECT v1.number + v2.number * 100 + v3.number * 10000 + v4.number * 1000000 number from master.dbo.spt_values v1 CROSS JOIN master.dbo.spt_values v2 CROSS JOIN master.dbo.spt_values v3 CROSS JOIN master.dbo.spt_values v4
WHERE v1.number < 100 AND v1.type = 'P' AND
v2.number < 100 AND v2.type = 'P' AND
v3.number < 100 AND v3.type = 'P' AND
v4.number < 100 AND v4.type = 'P' ),
ch AS (
SELECT CHAR(CONVERT(int, CONVERT(VARBINARY, '0x' + SUBSTRING(s, 3, 2), 1))) ch, 0 AS i FROM s
UNION ALL
SELECT CHAR(CONVERT(int, CONVERT(VARBINARY, '0x' + SUBSTRING(s, 3 + 2*(i+1), 2), 1))), i + 1 from s INNER JOIN ch ON 1 = 1 WHERE 2 + 2*(i+1) < LEN(s))
SELECT REPLACE(REPLACE(REPLACE(ch,'</ch><ch>', ''), '</ch>', ''),'<ch>', '') from ch FOR XML PATH('')
OPTION (MAXRECURSION 0)

You may also try this when facing a task of conversion from varbinary to string. Example – binary string is 0xEFBBBF7573696E672053797374656D3B0D0A7573696E672053797374656D2E446174613B0D0A7573696E672053797374656D2E446174612E53716C436C69656E743B0D0A7573696E672053797374656D2E446174612E53716C54797065733B0D0A7573696E67204D6963726F736F66742E53716C5365727665722E5365727665723B0D (a snippet of actual C# code), so running this query

;WITH s AS (SELECT '0xEFBBBF7573696E672053797374656D3B0D0A7573696E672053797374656D2E446174613B0D0A7573696E672053797374656D2E446174612E53716C436C69656E743B0D0A7573696E672053797374656D2E446174612E53716C54797065733B0D0A7573696E67204D6963726F736F66742E53716C5365727665722E5365727665723B0D' s),
num AS (
SELECT v1.number + v2.number * 100 + v3.number * 10000 + v4.number * 1000000 number from master.dbo.spt_values v1 CROSS JOIN master.dbo.spt_values v2 CROSS JOIN master.dbo.spt_values v3 CROSS JOIN master.dbo.spt_values v4
WHERE v1.number < 100 AND v1.type = 'P' AND
v2.number < 100 AND v2.type = 'P' AND
v3.number < 100 AND v3.type = 'P' AND
v4.number < 100 AND v4.type = 'P' ),
ch AS (
SELECT CHAR(CONVERT(int, CONVERT(VARBINARY, '0x' + SUBSTRING(s, 3, 2), 1))) ch, 0 AS i FROM s
UNION ALL
SELECT CHAR(CONVERT(int, CONVERT(VARBINARY, '0x' + SUBSTRING(s, 3 + 2*(i+1), 2), 1))), i + 1 from s INNER JOIN ch ON 1 = 1 WHERE 2 + 2*(i+1) < LEN(s))
SELECT REPLACE(REPLACE(REPLACE(ch,'</ch><ch>', ''), '</ch>', ''),'<ch>', '') from ch FOR XML PATH('')
OPTION (MAXRECURSION 0)

will give

using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;

If you have any questions/suggestions, please let me know.

EDIT:
It’s worth to read Books Online. On the CAST and CONVERT reference page, example H, there is exactly the same example of conversion from binary to string and they do it ine one line:

SELECT convert(varchar(max), binary_string, 0)

Thank you and good night. :)

Posted in SQL Server | Tagged: , , , , , , | Leave a Comment »

SQLCMD how-to

Posted by Szymon Wójcik on September 6, 2012

Just a quick note – if you ever need some reference on SQLCMD syntax visit http://www.simple-talk.com/sql/sql-tools/the-sqlcmd-workbench/, great summary by Robyn Page and Phil Factor.

Posted in Uncategorized | Tagged: | Leave a Comment »

How to check estimated finish time for some queries

Posted by Szymon Wójcik on July 1, 2012

As I am waiting for a backup to complete I decided to do something useful. Here’s a short query that shows running queries and displays estimated finish time:

set nocount on
select er.session_id, er.start_time, st.text, er.percent_complete, dateadd(ms, datediff(ms, start_time, getdate()) * 100 / percent_complete, start_time) ETA
from sys.dm_exec_requests er
cross apply sys.dm_exec_sql_text(sql_handle) st
where er.percent_complete > 0

I saw it in once in Jack Vamvas’s blog, but couldn’t find it, so I decided to write my own version.
Right now I am running it in a loop (using WAITFOR DELAY and GO 1000) to pass the time quicker while backup is finishing. One word of notice – it does not apply to all queries, only to those that report progress in percent_complete column of sys.dm_exec_requests – so there’s no way for any of DML queries to show there. I use it for rough progress estimate of backups/restores/DBCC.

Posted in SQL Server | Tagged: , , , , | Leave a Comment »

List all contents of path in PowerShell

Posted by Szymon Wójcik on June 22, 2012

And now for something completely different… This little PowerShell script might be useful when trying to locate the biggest files on your hard drive (I’m always low on disk space).

Get-ChildItem d:\ -recurse | where {$_.Length -ge 0} | sort -Property Length -desc | select Length, Directory, Name, LastAccessTime, Mode | ogv 

It takes all contents of D:\ (Get-ChildItem d:\ -recurse), looks for files of specific size ($_.Length -ge 0), orders them by size descending (sort -Property Length -desc) and outputs interesting information to the Out-GridView. If you want to see it in Excel instead, replace ogv with Export-Csv and then import it to Excel (or use method described here).

Posted in Power Shell | Tagged: , | Leave a Comment »

Building a clustered test lab with Windows Server 2012 RC and SQL Server 2012 RTM Evaluation

Posted by Szymon Wójcik on June 14, 2012

I have already described what my test lab at home looks like, however I find it interesting enough to provide details how to set it up. This post will be first in series and will cover planning and preparing the environment. Next posts will be about:

  • installing Windows Server 2012 in a VHD and enabling Hyper-V role
  • preparing virtual machine template and setting up virtual machines
  • preparing environment for setting up failover cluster 
  • installing SQL Server on 2-node cluster

I am using concepts shown in a blog post by Jose Barreto describing this setup with Windows Server 2008 R2 and SQL Server 2008 R2. We will use Windows Server 2012 and SQL Server 2012 but main idea is the same. To build this lab you require:

  • a PC which:
    • has a CPU that supports virtualization in hardware (for Intel you want a CPU supporting VT-x technology, for AMD – AMD-V) – most non-low-end CPUs do
    • has minimum of 4 GB RAM (8 GB or more recommended)
    • has 50 GB free HDD space (up to you)
  • some software – all available for free:
    • Windows Server 2012 RC or Hyper-V Server 2012 RC installation media (I will use “full” Windows Server as I didn’t do it using command-line/PowerShell in Hyper-V Server) – I don’t recommend using VHD provided by Microsoft since it expands from 8 to 40 GB during boot time and you’d need lots more disk space ;
    • SQL Server 2012 Evaluation - valid from 180 days, but it’s more than enough for start (you might try Developer Edition if you have one – you don’t have to worry about expiration then)
  • whole procedure takes about 8 hours (depends on your system speed, mainly I/O, so if you’re blessed with RAID 0 on SSD drives you might actually do it much faster) – be warned!

What we’re going to do is we will install fresh Windows Server 2012 operating system in a VHD (so as not to mess with existing setup – you may install on a physical disk if you don’t mind, performance-wise it’s negligible) – I assume that a main OS on the PC we’re using is Windows 7/Server 2008 R2 or newer, because XP does not support native-boot from VHD (not sure about Vista/Server 2008, but does anyone use it anymore? :P ). Within this newly installed Server 2012 we will enable Hyper-V role and set up 4 virtual machines using one base template and four differencing disks. Then we will configure those machines like this:

  1. First machine is a domain controller and a DNS server – clustering requires a domain and Active Directory requires DNS.
  2. Second machine is storage controller – in the post by Jose (mentioned above) separate download of iSCSI Target is required for Windows Server 2008 R2, however it’s incorporated in Server 2012 – we don’t have to install anything, only enable additional OS features and configure them.
  3. Third machine is an active node of SQL Server failover cluster.
  4. Fourth machine is a passive node of SQL Server failover cluster.
  5. You may add more nodes to the cluster or consider setting up AlwaysOn.

This makes our lab completely standalone, so it can operate even if there is no connection to the outside. If it’s not required to have it this way, for example – you have a domain controller – you may skip creation of first VM. If you have a NAS/SAN, you may use it and skip the second machine. You may also consider combining first two machines into one (if you’re low on resources and don’t want to spawn a horde of machines). AD services in case of a domain so huge as this one will not be very demanding, definitely we’re not going to have a workload on storage impact a domian controller significantly. On the other hand you may also try setting up additional machines to see how it works – I made some with System Center 2012 RC, but you can also build a load-balanced SharePoint farm with a clustered database engine.

When it comes to network – no additional configuration will be done as clustering in Windows Server 2008 removed the need for dedicated heartbeat, so as long as our VMs see each other it will be fine (you may try to include DHCP server in this setup but remember to keep it contained so that it does not try to provide addresses in every network it may find). Just remember – live system may not have exactly the same architecture and whatever works for our homemade cluster may not be enough when it’s deployed into production (but hey, that’s a lab we’re building!).

When it comes to resource assignment for VMs I use the following pattern (I have Phenom II X4 CPU and 16 GB in my rig):

  1. For domain controller – 2 CPUs and 768 – 1024 MB RAM.
  2. For storage server – 2 CPUs and 768 MB RAM.
  3. For SQL Servers – 4 CPUs and 2048 – 3072 MB RAM.
  4. Rest – whatever I feel like/need.

When I’m setting this on a laptop where I have memory limitations (4 GB RAM) I cut down first two VMs to 512 MB RAM and SQL Servers to 1024 – 1280 MB. This allows me to remain operable, however sacrificing a lot of performance. Therefore 8 GB RAM is recommended.

And this concludes our preparation. Next post will get us through host setup – we will install Windows Server 2012 in a VHD and make it bootable so stay sharp!

Posted in SQL Server, Windows Server | Tagged: , , , , , , , | Leave a Comment »

SQL Server 2012 – 70-461 and 70-462 exams passed

Posted by Szymon Wójcik on June 13, 2012

Yesterday I found some interesting information on Prometric site – I passed 71-461 and 71-462 exams (will count as regular 70-461/462). I don’t know the exact scores, but I did it and I am really happy about it. I only wish now that I didn’t take more of the beta exams – I might as well be an MCSA/MCSE at the moment.
Results will appear on my transcript later, probably by the time I get the official confirmation e-mail from Microsoft, which takes up to few weeks.
Time to prepare for 70-463 and then upgrade to MCSE: DP – I wonder if it’s possible to do it this way – upgrade my MCITP DBA from SQL Server 2005 to 2008 (70-453), then earn MCSA: SQL Server 2008 (70-448), pass 70-463 to get MCSA: SQL Server 2012 and finally upgrade MCITP to MCSE: DP with 70-459.

Posted in SQL Server | Tagged: , , , , , , , , | 7 Comments »

SQL Server upgrade from 2005 to 2008 R2 – more notes

Posted by Szymon Wójcik on May 30, 2012

I have already put down some notes about upgrading SQL Server from 2005 to 2008 R2, but since it’s been a few weeks I gained some useful experience. I’ll divide it into two parts – what works and what doesn’t, so it’s pretty much like a standard lessons learnt document. It’s all pretty fresh – I had two upgrades in May, both successful, but not without hassle (self-inflicted, of course).

What works:

  1. Copying installation source locally instead of installing from a network share – network disruptions have no impact on upgrade. I had my upgrade at the same time as LAN maintenance and it had a minimal impact on SQL Server upgrade.
  2. Having a local account with administrative rights – in case you can’t use built-in Administrator account you might consider creating a local account and adding it to local Administrators group as it will free you from network/login issues. Just remember to clean up afterwards.
  3. Upgrading from SQL Server 2005 databases in a compatibility level 90 – straightforward, never met a single one that had problems after setting compatibility level to 100.
  4. Migrating of Reporting Services between SQL Servers (both 2005) by means of backup\restore – yes, but in 2005 I had to install SSRS, initialize its database and overwrite it on restore. Never tried it in 2008+, but I presume it works exactly the same. When I tried to restore to a new database, and then reconfigure SSRS, it wasn’t able to initialize. However, there’s a trick with deleting encryption keys which might also work in this case – worth checking in free time.

What doesn’t work

  1. Upgrading a read-only database – renders it unusable. I did it (nothing to be proud of) and to fix it I had to put it in emergency mode, detach, reattach and set it back to read-only. Please note it’s what I did and worked for me  – checked with DBCC CHECKDB afterwards and the database was fine. Why emergency mode, you might ask – the database startup fails during recovery phase, because it requires to be upgraded as server version has changed while it’s read-only. So it leaves you with a 2008 R2 server using databases with internal version 661, but a read-only database remains with internal version 611 (because it’s read-only), so the server issues an error that data files are inaccessible and you can’t even detach it. The emergency mode is used here to suppress recovery and allow detaching – I wasn’t brave enough to try setting the database to read-write after emergency mode on – also worth checking in free time if it works and what happens to the database. Alternative – restore latest backup (since the database ia read-only, it should not change) to another SQL Server 2005 box, set it to read-write and copy to 2008 R2 instance. Lucky me as the whole database was read-only – if it were only a filegroup inside, that would be a bigger issue (see Paul Randal’s post at SQLMag.com about it).
  2. Upgrading SQL Server 2000 databases to 2008 R2 – some of them contain some deprecated features like old-style joins and it turns out that you can upgrade the server, but have to leave the database on compatibility level 80. I’ve seen this happen a few times, and the only solution is to review database structure and remove all the deprecated features. The thing is – you might not always have time or resources to do it, but it’s where SQL Server Upgrade Advisor comes in, the reports can help you track where the problems can be.
  3. This is me grumbling about a thing that is by design – a number of restarts required to upgrade your SQL Server, especially on Windows Server 2003. If you didn’t reboot since last patching session, restart. If you don’t have Windows Installer 4.5 (and I don’t since I’m starting from 2005), next restart. Upgrade SQL Server, next restart. After Service Pack, another restart. Now multiply it by a number of instances on the server that are upgraded, add some time for some preparations before, clean up after, plan for some contingency, and you can barely squeeze two instances in 6 hours. Luckily this isn’t one of the new HP ProLiant DL380 G7 servers that take 10 minutes to reboot, spending 9 minutes on power and thermal calibration. This is also an important point – when planning your maintenance window, consider all the activities. If the installation takes 30 minutes and updates another 15, both require a restart which takes 15 minutes, plus one upfront, then your downtime is not 45 minutes, but 90! It is crucial because if you miscalculate, you might not fit in the maintenance window and then you have a service down, not to mention that if something goes wrong, you need some time for rollback plan (which cannot fail – but imagine that tape drives are busy with your 70%-completed Exchange backup with still 2 TB to go and you have to wait till it’s done to restore 10 GB database).

Now, I might have another set comments pretty soon – a round of upgrades is waiting for me in June plus a retirement. If you have any comments or questions, feel free to share.

Posted in DBA stories, SQL Server | Tagged: , , , , , , | Leave a Comment »

My home lab and virtualization challenges

Posted by Szymon Wójcik on May 24, 2012

This time I’m going to write about something less SQL Server related. It’s about my home lab and I’m planning to do with it in the next couple of weeks.
First few words about the hardware. Since I’m always tight on budget, I’m on AMD team since 10 years and as they have been doing some marvellous job in Athlon XP and Athlon 64 era, last five years are completely dominated by Intel. The only field where AMD remained competitive is price – past tense is not by accident, because I consider last year’s release of AMD FX CPUs (also known as Bulldozer) as marketing move without necessary (or promised) technical advantage. I use 3-year-old Phenom II X2 550 with 4 cores unlocked and I’m extremely satisfied with performance of this little 100$ worth CPU. However, if I were to buy a new computer at the moment, I would definitely go for Intel’s i5-2500 or i7-3770 – their performance is simply mind-blowing, not to mention their overclockability (they easily reach 4,5 GHz). Looking at the performance charts (for example at hwbot.org) you will see that today’s desktops have higher performance ratings than three year old dual socket servers.
The Phenom II uses AMD AM3 socket which backwards compatible with AM2+ motherboards, therefore the CPU has two integrated memory controllers – one for DDR2, second for DDR3. I tested both and found that two sticks of DDR2 and DDR3 are no problem for it, however it has some issues with 4 DDR3 sticks – requires dropping down memory frequency and loosening tmimings to work correctly. I use 16 GB (4×4) of DDR3 RAM and I’m quite happy about it – it really allows to have fun with virtualization.
Speaking of virtualization, I use virtual machines a lot thanks to wonderful guide by Jose Barreto – before reading it I had three separate machines creeping in size and hardly manageable. After reading and utilizing techniques inside I became resource-hungry since my VMs started to consume all RAM I had, so I expanded in one year from 4 to 16 GB. It also helped me get some basic acquaintance with Active Directory, clustering, DFS and System Center. I recommend setting your own environment like this one to every Windows administrator – fantastic educational purposes. It really does not cost you a lot – you might consider using your laptop for it and if you don’t like to mess with another OS on it – install Windows Server 2008 R2 on USB drive or even flash stick (I used PWBoot together with Windows image – confirmed to work with Windows 7, Windows Server 2008 R2 and Hyper-V Server 8 Beta).
In short how this environment looks like – you need Windows Server 2008 R2 SP1 Enterprise or Datacenter Edition – you may even use Evaluation which is available for free from Microsoft. SP1 is highly recommended – it extends significantly Hyper-V role features giving it for example Dynamic Memory option. You install in on a physical machine, configure to get it working, apply necessary patches and enable Hyper-V role. Inside Hyper-V, you require one base virtual disk for each operating system you are going to use and a number of differencing disks relating to base drives. Base virtual is obtained by using following procedure:

  1. Create a new machine with an empty dynamically expanding VHD
  2. Adjust VM parameters as needed (CPU, RAM), mount OS image and install it
  3. Apply latest Service Pack and security updates
  4. Perform sysprep with generalize option and shutdown the machine

After those steps the base VHD is ready and you can start spawning VMs by creating differencing VHDs linking to this one. Then you create virtual machines, assign an empty differencing VHD to each VM, configure parameters (CPU, RAM, network) and start it. This way you can have 5 new VMs operable in about an hour – it saves a lot of time if you install the OS only once. By the way, sysprep is supported for each system since Windows NT 4.0, so if you want to do a lot of experiments you can build your base virtual disks library by expense of less than 100 GB and then just create ready-to-use VMs with a few mouse clicks.
My home lab contains following VMs at the moment:

  1. Domain controller
  2. Storage server – using iSCSI Target
  3. 2 clustered file servers
  4. 3 clustered SQL Servers (using 2008 R2 and 2012 RTM – it’s a multi-instance cluster)
  5. System Center Virtual Machine Manager 2012 RC
  6. System Center Operations Manager 2012 RC

I rarely have all of them running – no need for that, but this setup fits just fine in 16 GB – if I wanted to add more VMs to this, I would definitely require more RAM or build another Hyper-V host and play with Quick/Live Migration.
Since there are two factors limiting me at the moment – RAM and disk space – I’m thinking of doing something spectacular with this but don’t have too many options. At first, I considered building a massive NT 4.0 environment, but since NT 4 allows only 2 servers to be grouped in a cluster, it’s not that interesting (on the other hand, spawning 50 NT 4s in an hour seems feasible with help from SCVMM, but it’s of little use, apart from pure fun). I might also consider using Windows 2000 but Advanced Server requires 128 MB RAM, the same as Windows Server 2003 Enterprise Edition. So it needs to be decided – maybe 8-node failover cluster of SQL Server 2005 on Windows Server 2003 is not that far away.
Definitely I need a facelift for this lab – upgrade from Windows Server 2008 R2 to 2012 once RC comes out end of June. This will also allow me to rebuild whole environment since it’s got a bit messy during last year. I might scrap SCOM in favor of Sharepoint 2010 and have some fun with new BI features of SQL Server 2012. I’m also considering playing with big data by distributing the load between a number a virtual computers.
Well, that’s it for now, so if you have some comments on a home lab design or want to ask something, please comment, I’m awaiting responses.

Posted in Windows Server | Tagged: , , , , , , , , | 1 Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 45 other followers