March 22, 2012 at 1:37 pm
I was wondering if anyone has attempted this? We are wanting to create a VM image with SQL already on it so when we create a new VM Server we don't have to go back and install SQL every time.. This would be a time saver more then anything else. Our standard is for to have a named instance.
If so how did you change the instance name to match the new VM server?
I know very little about VM machines so correct me if I say something stupid..
March 23, 2012 at 2:03 am
it is possible, but would involve a lot of reconfiguring I would think unless you design your template to have multiple vmdk's as standard and when its deployed all the drives are configured and such like so that you have multiple drives for the system databases, user data, user logs, backups and tempdb and if you can configure it so that on deployment all the mdf's and ldf's go to the right places successfully and that you change the service accounts running the server etc etc then you should be good to go (comes without testing as I always perfer to manually install as each server i have installed tends to need a slightly different config).
if all the above is do able in the template then you would want to look at this renaming a sql server
March 23, 2012 at 11:11 am
I could be wrong, but I don't think you can do this. SQL is more than an image. It has databases, system databases, that are required for it. If the databases (or services) are online when you do the VM, they'll be unreadable on the new box and you'll have to reinstall SQL anyway.
Even if they're not online, you have the issue of having to copy & move the dbs to their new home. Then fixing and updating any logins. And heaven help you if you cross domains with this VM. The domain logins tend to break across domains (even trusted domains) and require extra TLC.
If you manage to get this working, though, I would love to hear about the details. I like being proven wrong on stuff like this.
March 26, 2012 at 5:36 pm
>>I could be wrong, but I don't think you can do this. SQL is more than an image. It has databases, system databases, that are required for it. If the databases (or services) are online when you do the VM, they'll be unreadable on the new box
I think this is possible but it seems like voodoo. I know you can move a vm from one host to another and the end users may not notice. Or you can snapshot a vm and restore it. Or backup a vm and bring it up on another machine. All while the thing is online. I have always speculated that it captures the state of the memory as well as what is written to disk.
Another way to approach this is configuring a silent install with a configuration file that contains all the things that will change between installs.
http://msdn.microsoft.com/en-us/library/ms144259%28v=sql.105%29.aspx
March 27, 2012 at 6:54 am
itpcpro (3/22/2012)
I was wondering if anyone has attempted this? We are wanting to create a VM image with SQL already on it so when we create a new VM Server we don't have to go back and install SQL every time.. This would be a time saver more then anything else. Our standard is for to have a named instance.If so how did you change the instance name to match the new VM server?
I know very little about VM machines so correct me if I say something stupid..
WHY do you have the standard to have a named instance of SQL Server? Change that and you are good to go with very few hassles, at least from a SQL Server standpoint.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
March 27, 2012 at 8:28 am
TheSQLGuru (3/27/2012)
itpcpro (3/22/2012)
I was wondering if anyone has attempted this? We are wanting to create a VM image with SQL already on it so when we create a new VM Server we don't have to go back and install SQL every time.. This would be a time saver more then anything else. Our standard is for to have a named instance.If so how did you change the instance name to match the new VM server?
I know very little about VM machines so correct me if I say something stupid..
WHY do you have the standard to have a named instance of SQL Server? Change that and you are good to go with very few hassles, at least from a SQL Server standpoint.
+1
In this particular situation (essentially creating a "template" SQL Server VM), I'd also recommend using the default instance.
Rough steps to create the VM would be
0) Figure out how you're going to license your template, and each copy, under Microsoft licensing rules!
1) Create the VM template at an OS level with a known "do not use" IP address and hostname
2) Install SQL Server with no user databases (except your standard admin ones), with default maintenance setups, default sysadmins, etc.
3) Install antivirus, firewall, other security software with appropriate SQL Server exceptions
4) Patch and update
5) Goto 4) until there are no more patches, then goto 6)
6) Take the VM off the domain, shut down the VM, make a copy to use
7) At regular intervals, goto 4)
Rough steps to create a new install from the template would be
A) Figure out if this new install falls within the licensing model you've selected in 0)
B) Copy the template to the new host, reset the VCPU, RAM, Disk IO share, etc. settings as required
C) Start up the template without a network connection
D) Re-IP and rename the box and use sp_dropserver and sp_addserver to rename the SQL instance, change SQL Server memory and CPU limits, reboot
E) Start up the virtual network, add the machine to the domain
F) Patch and update
G) Goto F) until there are no more patches, then goto H)
H) Use your server
March 27, 2012 at 10:17 pm
I think most admins will use sysprep to get an image ready to use as a deployable template.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
April 2, 2012 at 3:34 am
If you use Ssyprep for building your OS images then take a look at SQL 2012 Sysprep build. This integrates with the OS sysprep process to allow you to quickly deploy a new server that has both the OS and SQL properly installed.
If you just clone your master disk image for a new server then I think that the SQL 2012 Sysprep will not be the tool you need.
Alternatively you can use FineBuild. This can be called as part of your server deploy process to install SQL Server to a pre-determined configuration in the shortest possible time.
Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.
When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara
April 4, 2012 at 4:48 am
I'm asking just for future reference, not because I'm building a VM image...
If I use a default instance of SQL Server in my image building, does SQL need to be online or offline in order for the image to take workable copies of the system databases? Or does it not matter because the image software (sysprep or whatever) accounts for the potential database corruption system?
I don't really understand the process and am asking from the POV of someone who knows you can't take backups / make copies of an online .mdf and have it readable or attachable to another SQL instance.
April 4, 2012 at 5:58 am
If you are cloning a system image, Windows would typically be stopped when the master image was made. A cloned image does not use Sysprep.
When you first boot a server based on a cloned disk image, you have to manually set the server name, domain, etc. There may be third-party programs that simplify some of this work, but you have to remember that all you have is a cloned disk image - and it can sometimes be difficult to make all the changes needed to SQL Server to cope with the new server and domain.
If you are using the Sysprep, then you are taking a Windows system and preparing it for use as a template system. When a new server is built based on a sysprep image is first booted there is a short question and answer dialogue built into Windows to set server name, domain, etc.
Unless you are using software with its own Sysprep install, such as SQL 2012, there should be no other software apart from Windows on the Sysprepped template.
Many installations find the cloning process is simpler and meets their needs. Others prefer to use Sysprep. You just need to fit in with what your Windows admin people do.
Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.
When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply