Saturday, January 26, 2008

Renaming SQL Server post-Sysprep

Sysprep is a very, very powerful tool. It's not a miracle worker, however, case in point, SQL Server. I always include the following SQL script in the image.


select @@servername
-- this script will rename a sql server
declare @new_name varchar(255)
set @new_name = '[new machine name]'
exec sp_dropserver @@servername
exec sp_addserver @new_name, 'local'
-- restart sql server
Then, I restart the SQL Server service (default name is MSSQLSERVER)
net stop mssqlserver
net start mssqlserver
UPDATE (4/21/2008)
If you've Sysprepp'd a machine with SQL Server Reporting Services installed, you'll need to reinstall it. SSRS holds onto either the original machine's SID or just the machine name. Either way, I haven't yet found out how to correct it.

Attachments:
SQL Rename.sql

Little Known Fact About Differencing Virtual Disks

It turns out that the size of Differencing Virtual Disks are directly affected by the size of the parent disk. I shall explain this through an example. If parent.vhd is a Fixed Size Virtual Disk type and it has 1GB of remaining free space, then so will any of its child differencing disk *.vhd's.

A colleague brought this fact to my attention, which at the time I didn't want to believe it but I found the following statements in the Virtual Server 2005 Administrator's Guide.

A differencing disk can can grow as large as the maximum size allocated for the parent disk when the parent disk was created. We recommend that you ensure you have enough storage before performing operations on the differencing disk that require a significant amount storage space, such as applying an operating system update.

Click here for an online version of the guide.