Tuesday, June 9, 2009

Converting Disks in Hyper-V

I recently have been running into space issues. I had a four hundred gigabyte hard drive that had almost not space remaining. It stored 8 running servers with dynamically expanding disks that had a maximum size of 40 gigabytes (on the host it was almost 42 gigabytes). I also had to store a backup server image (sysprepped) for copying to quickly create a new server if needed. Additionally, one of the hard drives was 70 gigabytes, not 40. All around, the total came to 459 gigabytes if each hard drive expanded to its largest.I suggested to my boss that we should convert each disk to fixed rather than dynamic disks to improve performance. He agreed and I began my search for how to convert disks. Much to my delight, converting a disk is a relatively painless (albeit slow) process.
Here's how:

For starters, open up the Hyper-V Manager. If you have been working with Hyper-V for any amount of time, you should know where this is. If you're totally new to this, Hyper-V Manager should be located in Administrative Tools. If you can't find it there, open a run window (Windows Key + R) and type mmc. From the window that comes up, Click File -> Add/Remove Snap-in... From the window that comes up, scroll down in the Available snap-ins list and double click Hyper-V Manager. Click OK.

*NOTE* A server must be either off or paused to convert the disk (I chose off for my conversions)

Alright, now that that's out of the way, right click the server you want to convert.

From there, click settings. In the window that comes up (Settings for ), click the hard drive you want to convert. In my case I only had one hard drive 'attached' to my servers.
From here, click Edit











The window that comes up (Edit Virtual Hard Disk Wizard) will start on the "Locate Disk" step but should continue to the next step automatically in a few seconds. On the "Choose Action" step, check the radio button next to the "Convert" option (second down from the top).













Click Next. This will take you to the "Convert Disk" step. Here you need to set the destination filename for the conversion. In my case, I just selected the old file from the browse window and added a "_fixed" at the end of the filename. Any naming scheme works though of course.

Click Next yet again. This will bring you to the summary window. Make sure everything you entered is correct and click Finish.







From here, just sit back and relax.


The conversion speed at the beginning can be a little deceiving. Mine got almost 25% done in the first five minutes. It actually took it about an hour to complete for forty gigabytes though. Reminds me of a cell phone. It reads full battery power until it has none left and then it says it has none five minutes before turning off.


Thursday, June 4, 2009

SQL Server 2008 Memory Management

Once again, hello all:

Recently I had a problem with SQL server. I was sifting through the processes in Task Manager a few days ago ordered by memory consumption. At the top of the list for memory consumption was SQL Server (sqlserver.exe) weighing in at 200 megabytes of memory. I decided to look past that one since 200 megabytes isn't too unreasonable for SQL, especially when it's hosting the data for quite a few SharePoint web applications.

Today, I checked again. After my server had been online for two and a half days, SQL server had grown to over 650 megabytes of memory (653,224 KB specifically). Seeing as how I have not made any changes to my local SharePoint environment in that time (I'm currently developing a non-SharePoint related project), I decided to look into putting a cap on the memory consumption of SQL. Originally I had 2 gigabytes of ram for my server. I added an extra gigabyte to that and SQL took up the additional space.

As it turns out, one can put a maximun and a minimum limit on SQL. Here's how.

*NOTE* This is done in SQL Server 2008 so the specified actions may not be available if you are using an older version such as 2003.

- Open up SQL Server Management Studio 2008

- Type in the information to connect to the server that has SQL server running on it and click connect.

- Right click the server name

















- Click Properties
- Select Memory on the left side of the window that comes up


















- Under Server Memory Options, adjust the minimum and maxiumum memory settings to what you need.
*NOTE* If you are running a 32-bit operating system and need to allocate more than 4 gigabytes of RAM to SQL, be sure to check the "Use AWE to allocate memory" checkbox.

- Click OK

- Right Click the server name again

- Select Stop from the menu
- Click necessary buttons to get through the prompts

- Right Click the server name yet again

- Select Start from the menu

- Click the necessary buttons to get through the prompts


And that's it. Mine (as in the screenshots) has yet to go over 300 megabytes of memory consumption.
Thanks for reading.

Aaron Ball

Saturday, May 30, 2009

SQL 2008 Re-install Errors

Hello again all,

Recently, after the server build was 'finished', I discovered that the SQL install was not configured to use the proper authentication method or service accounts (oops) and without mixed mode authentication enabled, windows authentication could not be used to log in to sql to fix these things. That being said, I had to uninstall SQL 2008 (standard edition) and do a reinstall to correct these issues. Time to grab some popcorn and a drink and sit back to watch that entertaining progress bar as it slowly creeps across the tiny 800x600 virtual console window.

I configured the SQL install and ran into an ambiguous error (how typical).
"This access control list is not in canonical form and therefore cannot be modified."

How quaint. Thankfully, after searching for a few minutes with our friend Google, I stumbled upon a Microsoft feedback article that seemed to contain my answer.

Here's what needs to be done.
Navigate in an explorer window to
C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\

The link at the end of this post to the Microsoft feedback article says that from there you open up the "details.txt" file. I found that that folder actually contained 11 folders (from the current install and the previous install) and a file called "summary.txt". I found the right "details.txt" file in the most recently created folder.

Once you've located the right "details.txt" file, open it up in notepad (or your editor of choice) and scroll to the end of the file (it's pretty big so use the scroller bar). Near the end, you should see some text that looks similar to...

2009-05-30 18:02:40 Slp: Sco: Attempting to set directory full path
2009-05-30 18:02:40 Slp: Sco: Attempting to normalize directory path C:\Program Files\Microsoft SQL Server\100\COM\
2009-05-30 18:02:40 Slp: Sco: Attempting to check if directory C:\Program Files\Microsoft SQL Server\100\COM\ exists
2009-05-30 18:02:40 Slp: Sco: Attempting to set security descriptor for directory C:\Program Files\Microsoft SQL Server\100\COM\, security descriptor D:(A;OICI;FRFX;;;S-1-5-80-3263513310-3392720605-1798839546-683002060-3227631582)
2009-05-30 18:02:40 Slp: Sco: Attempting to check if directory C:\Program Files\Microsoft SQL Server\100\COM\ exists
2009-05-30 18:02:40 Slp: Sco: Attempting to normalize security descriptor D:(A;OICI;FRFX;;;S-1-5-80-3263513310-3392720605-1798839546-683002060-3227631582)
2009-05-30 18:02:40 Slp: Sco: Attempting to replace account with sid in security descriptor D:(A;OICI;FRFX;;;S-1-5-80-3263513310-3392720605-1798839546-683002060-3227631582)
2009-05-30 18:02:40 Slp: ReplaceAccountWithSidInSddl -- SDDL to be processed: D:(A;OICI;FRFX;;;S-1-5-80-3263513310-3392720605-1798839546-683002060-3227631582)
2009-05-30 18:02:40 Slp: ReplaceAccountWithSidInSddl -- SDDL to be returned: D:(A;OICI;FRFX;;;S-1-5-80-3263513310-3392720605-1798839546-683002060-3227631582)
2009-05-30 18:02:40 Slp: Prompting user if they want to retry this action

The text you're looking for is the directory path listed after the text "Attempting to normalize directory path".
Open up another explorer window and navigate to (not inside) the directory that is specified after the previous quote. Right click the directory (in this case, the directory is COM within the directory 100) and select "Properties". From within the Properties window, click the "Security" tab. Windows should give you an error that says something along the lines of the permissions being out of order and might not be effective (sorry...I forgot to copy that error).

Please note right now that this is done in Windows Server 2008 and the specified buttons/tabs to click won't be the same in Server 2003 from this point.

Click "Edit" near the middle of the window. Windows should then throw up another dialog box saying that the permissions are out of order and need to be fixed. Click "Okay" and Windows will automatically fix the problem for you. Just click "Okay" in the window that comes up. Click "Okay" in the "Security" window to close it out as well.
Go back to your installer now and click "Retry" on the error window.

I had to fix two directories. The guy in the Microsoft feedback article said he had to fix five directories. That being said, this may need to be done more than once.

That about sums this up. The article I found that helped me get started fixing this can be found here:


Aaron Ball

Tuesday, May 26, 2009

Hyper-V and Vista

Hello again all,

Today I built out 8 more servers for our dev team. We have a blade server hosting all of this with Hyper-V. Here's what my picture looks like...
I log into my Vista work machine, use terminal services to log into the blade and open up Hyper-V Manager. From there I connect to the machine via Hypervisor console.
Essentially, I have a remote window inside of a remote window. Naturally, mouse and keyboard key sends are at less-than-desireable speeds. My hopeful solution: Hyper-V management console on Vista.

Over the last year or so I have been hearing talks about how one could not install Hypervisor on Vista so naturally my hopes were already somewhat crushed. Despite the dire situation, I started the search (thanks Google) and much to my suprise, with Vista SP1 Microsoft released a patch (KB952627) to install the Hyper-V Console through Windows Update (thank you Microsoft).

Here are the links (Windows authenticity check required)

Vista x64


Once the management console is installed, you should be able to remotely connect to your server with Hyper-V.
Once again, thank you Microsoft for a very satisfying product.

Regards,
Aaron

Friday, May 22, 2009

Sysprepping Server 2008

Hello all,

This my first post on this blog (if it wasn't obvious enough), but I'm going to spare you all the boring 'welcome to the blog' and get down to business before I forget what I am blogging about here.

I do need to mention a few things before getting started though

My name is Aaron Ball and I work at the College of Business at Colorado State University, specifically on their web development team. I program for SharePoint but also enjoy building and maintaining servers. My current project is to build and maintain ten virtual (Hyper-V) Server 2008 development servers for the team. Each team member needs a semi-isolated development environment with a unique SharePoint instance so if their tests crash it, it does not affect any other people.

Alright, now that that's out of the way, here's the good stuff...

Now, continuing along the same lines as the subject of this post, I have been researching the unattend.xml file for sysprepping a system for the last week in an effort to find a template I could fill out for our latest Server '08 builds. A guy from another section of our IT department has a sysprep file from Windows XP, which apparently doesn't work for Server 2008 (well...it was worth a try though).

All week I have been Googling things like 'create unattend.xml', 'generate unattend.xml', 'sysprep unattend.xml', 'sysprep unattend file', and various other searches that escape me now. Today I thought I'd try sysprep.xml because I recalled seeing that somewhere. Low and behold, I discovered (as the first search result), the exact website I needed. It has a template sysprep.xml file that was actually designed for my exact circumstance (incredible, yes?).

Here's the link:

To use the sysprep.xml file, I have a batch file I created that runs the command...
C:\Windows\System32\sysprep\sysprep.exe /oobe /generalize /shutdown /unattend:C:\ProgramData\sysprep\sysprep.xml

/generalize
removes all unique identifiers of the machine.
/shutdown
specifies that the machine shutdown after the sysprep process rather than restarting
/unattend:
specifies the sysprep.xml file to use to guide the machine when it goes through the setup process after reboot.


Many thanks Brian. You brought my seemingly endless search for a sysprep template file to an end.

To end on an even more positive note, after sysprepping the server build, I did not have to respond to a single prompt with the exception of logging in as Administrator. It did everything for me.


Regards,
Aaron Ball