cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6377
Views
0
Helpful
7
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee

This could be executed as either a ssh or vix script in a post provisioning step after the VM or bare metal server has been deployed.

#
#

#

#
#

#
#
#

#

#

Powershell script:

#===========================================================================================

#  Microsoft PowerShell Script File

#  Name:  Install-SQLServer.ps1

#  Date:   3/1/2014

#  COMMMENTS:  Install SQL Server using unattend Configuration.ini file and customizing per customer

#

#

#

============================================================================================

param ($CustomerCode,$ConfigFile,$SAPassword)

$SQLConfig = Get-Content $Configfile

$SQLStartupUser = "$($CustomerCode)SQL_Startup"

$MKUserGroup = "$($CustomerCode)MK_Users"

New-Item -ItemType Directory "C:\temp" -ErrorAction SilentlyContinue

$BaseFile = "C:\temp\SQLConfiguration.INI"

$NewConfig = $SQLConfig | % {$_.Replace("[SAPASSWORD]",$SAPassword)}

$NewConfig = $NewConfig | % {$_.Replace("[SQL_Startup]",$SQLStartupUser)}

$NewConfig = $NewConfig | % {$_.Replace("[Mk_Users]",$MKUsersGroup)}

$NewConfig | Out-File -Encoding ASCII -Force $BaseFile

& Setup.exe /ConfigurationFile=$BaseFile

The INI file

===============

;SQLSERVER2008 Configuration File

[SQLSERVER2008]

; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will reflect the instance ID of the SQL Server instance.

INSTANCEID="MSSQLSERVER"

; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.

ACTION="Install"

; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, and Tools. The SQL feature will install the database engine, replication, and full-text. The Tools feature will install Management Tools, Books online, Business Intelligence Development Studio, and other shared components.

FEATURES=SQLENGINE

; Displays the command line parameters usage

HELP="False"

; Specifies that the detailed Setup log should be piped to the console.

INDICATEPROGRESS="False"

; Setup will not display any user interface.

QUIET="False"

; Setup will display progress only without any user interaction.

QUIETSIMPLE="False"

; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system.

X86="False"

; Detailed help for command line argument ENU has not been defined yet.

ENU="True"

; Parameter that controls the user interface behavior. Valid values are Normal for the full UI, and AutoAdvance for a simplied UI.

UIMODE="Normal"

; Specify if errors can be reported to Microsoft to improve future SQL Server releases. Specify 1 or True to enable and 0 or False to disable this feature.

ERRORREPORTING="False"

; Specify the root installation directory for native shared components.

INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"

; Specify the root installation directory for the WOW64 shared components.

INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"

; Specify the installation directory.

INSTANCEDIR="C:\Program Files\Microsoft SQL Server"

; Specify that SQL Server feature usage data can be collected and sent to Microsoft. Specify 1 or True to enable and 0 or False to disable this feature.

SQMREPORTING="False"

; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), Analysis Services (AS), or Reporting Services (RS).

INSTANCENAME="MSSQLSERVER"

; Agent account name

AGTSVCACCOUNT="Administrator"

; Auto-start service after installation.

AGTSVCSTARTUPTYPE="Manual"

; Startup type for Integration Services.

ISSVCSTARTUPTYPE="Automatic"

; Account for Integration Services: Domain\User or system account.

ISSVCACCOUNT="NT AUTHORITY\NetworkService"

; Controls the service startup type setting after the service has been created.

ASSVCSTARTUPTYPE="Automatic"

; The collation to be used by Analysis Services.

ASCOLLATION="Latin1_General_CI_AS"

; The location for the Analysis Services data files.

ASDATADIR="Data"

; The location for the Analysis Services log files.

ASLOGDIR="Log"

; The location for the Analysis Services backup files.

ASBACKUPDIR="Backup"

; The location for the Analysis Services temporary files.

ASTEMPDIR="Temp"

; The location for the Analysis Services configuration files.

ASCONFIGDIR="Config"

; Specifies whether or not the MSOLAP provider is allowed to run in process.

ASPROVIDERMSOLAP="1"

; A port number used to connect to the SharePoint Central Administration web application.

FARMADMINPORT="0"

; Startup type for the SQL Server service.

SQLSVCSTARTUPTYPE="Automatic"

; Level to enable FILESTREAM feature at (0, 1, 2 or 3).

FILESTREAMLEVEL="0"

; Set to "1" to enable RANU for SQL Server Express.

ENABLERANU="False"

; Specifies a Windows collation or an SQL collation to use for the Database Engine.

SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"

; Account for SQL Server service: Domain\User or system account.

SQLSVCACCOUNT="Administrator"

; Windows account(s) to provision as SQL Server system administrators.

SQLSYSADMINACCOUNTS="WIN-ABCDEF\Administrator"

; The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication.

SECURITYMODE="SQL"

; Provision current user as a Database Engine system administrator for SQL Server 2008 R2 Express.

ADDCURRENTUSERASSQLADMIN="False"

; Specify 0 to disable or 1 to enable the TCP/IP protocol.

TCPENABLED="1"

; Specify 0 to disable or 1 to enable the Named Pipes protocol.

NPENABLED="0"

; Startup type for Browser Service.

BROWSERSVCSTARTUPTYPE="Disabled"

; Specifies how the startup mode of the report server NT service.  When

; Manual - Service startup is manual mode (default).

; Automatic - Service startup is automatic mode.

; Disabled - Service is disabled

RSSVCSTARTUPTYPE="Automatic"

; Specifies which mode report server is installed in.

; Default value: “FilesOnly”

RSINSTALLMODE="FilesOnlyMode"

----------------------------------------------------------------------------------------

;SQLSERVER2008 Configuration File

[SQLSERVER2008]

; Specify the Instance ID for the SQL Server features you have specified. SQL Server directory structure, registry structure, and service names will reflect the instance ID of the SQL Server instance.

INSTANCEID="MSSQLSERVER"

; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.

ACTION="Install"

; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, and Tools. The SQL feature will install the database engine, replication, and full-text. The Tools feature will install Management Tools, Books online, Business Intelligence Development Studio, and other shared components.

FEATURES=SQLENGINE

; Displays the command line parameters usage

HELP="False"

; Specifies that the detailed Setup log should be piped to the console.

INDICATEPROGRESS="False"

; Setup will not display any user interface.

QUIET="True"

IACCEPTSQLSERVERLICENSETERMS="True"

; Setup will display progress only without any user interaction.

QUIETSIMPLE="False"

; Specifies that Setup should install into WOW64. This command line argument is not supported on an IA64 or a 32-bit system.

X86="False"

; Detailed help for command line argument ENU has not been defined yet.

ENU="True"

; Parameter that controls the user interface behavior. Valid values are Normal for the full UI, and AutoAdvance for a simplied UI.

; UIMODE="Normal"

; Specify if errors can be reported to Microsoft to improve future SQL Server releases. Specify 1 or True to enable and 0 or False to disable this feature.

ERRORREPORTING="False"

; Specify the root installation directory for native shared components.

INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server"

; Specify the root installation directory for the WOW64 shared components.

INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server"

; Specify the installation directory.

INSTANCEDIR="C:\Program Files\Microsoft SQL Server"

; Specify that SQL Server feature usage data can be collected and sent to Microsoft. Specify 1 or True to enable and 0 or False to disable this feature.

SQMREPORTING="False"

; Specify a default or named instance. MSSQLSERVER is the default instance for non-Express editions and SQLExpress for Express editions. This parameter is required when installing the SQL Server Database Engine (SQL), Analysis Services (AS), or Reporting Services (RS).

INSTANCENAME="MSSQLSERVER"

; Agent account name

AGTSVCACCOUNT="Administrator"

; Auto-start service after installation.

AGTSVCSTARTUPTYPE="Manual"

; Startup type for Integration Services.

ISSVCSTARTUPTYPE="Automatic"

; Account for Integration Services: Domain\User or system account.

ISSVCACCOUNT="NT AUTHORITY\NetworkService"

; Controls the service startup type setting after the service has been created.

ASSVCSTARTUPTYPE="Automatic"

; The collation to be used by Analysis Services.

ASCOLLATION="Latin1_General_CI_AS"

; The location for the Analysis Services data files.

ASDATADIR="Data"

; The location for the Analysis Services log files.

ASLOGDIR="Log"

; The location for the Analysis Services backup files.

ASBACKUPDIR="Backup"

; The location for the Analysis Services temporary files.

ASTEMPDIR="Temp"

; The location for the Analysis Services configuration files.

ASCONFIGDIR="Config"

; Specifies whether or not the MSOLAP provider is allowed to run in process.

ASPROVIDERMSOLAP="1"

; A port number used to connect to the SharePoint Central Administration web application.

FARMADMINPORT="0"

; Startup type for the SQL Server service.

SQLSVCSTARTUPTYPE="Automatic"

; Level to enable FILESTREAM feature at (0, 1, 2 or 3).

FILESTREAMLEVEL="0"

; Set to "1" to enable RANU for SQL Server Express.

ENABLERANU="False"

; Specifies a Windows collation or an SQL collation to use for the Database Engine.

SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"

; Account for SQL Server service: Domain\User or system account.

SQLSVCACCOUNT="Administrator"

; Windows account(s) to provision as SQL Server system administrators.

SQLSYSADMINACCOUNTS="WIN-P4S9EJOHD58\Administrator"

; The default is Windows Authentication. Use "SQL" for Mixed Mode Authentication.

SECURITYMODE="SQL"

; Provision current user as a Database Engine system administrator for SQL Server 2008 R2 Express.

ADDCURRENTUSERASSQLADMIN="False"

; Specify 0 to disable or 1 to enable the TCP/IP protocol.

TCPENABLED="1"

; Specify 0 to disable or 1 to enable the Named Pipes protocol.

NPENABLED="0"

; Startup type for Browser Service.

BROWSERSVCSTARTUPTYPE="Disabled"

; Specifies how the startup mode of the report server NT service.  When

; Manual - Service startup is manual mode (default).

; Automatic - Service startup is automatic mode.

; Disabled - Service is disabled

RSSVCSTARTUPTYPE="Automatic"

; Specifies which mode report server is installed in.

; Default value: “FilesOnly”

RSINSTALLMODE="FilesOnlyMode"

IIS install

========

http://www.iis.net/learn/install/installing-iis-7/installing-iis-from-the-command-line

Below VIX workflow example on executing BAT file via VMware tools in UCSD.

Comments
dnguyen03
Community Member

Noticed in this workflow that there was no command to mount an MS SQL iso.  Is it assumed that the iso/executable is already on the target server?

tcerling
Level 4
Level 4

Pretty old version of SQL, also.  Versions 2012 and 2014 have since been released, and 2016 is just around the corner.

I'm curious why not use UCSD PowerShell Agent instead ssh or vix?  Seems like that is what the agent is designed to do.

Orf Gelbrich
Cisco Employee
Cisco Employee

If you have a new version of silent install to share I can post it. VIX is an interesting alternative to SSH or Powershell since the VM after install does not have to be reachable by UCSD to drive change to the VM.

tcerling
Level 4
Level 4

I don't have a new unattended installation of SQL.  Microsoft has come up with a newer technology called Desired State Configuration.  This allows a SQL installation definition to be defined once and then machine can be configured to either pull the configuration or have the configuration pushed to them.  They can even be configured to automatically re-configure themselves if their configuration is altered from the accepted configuration.  Microsoft has not yet released their SQL configuration routines yet, though they are working on this for all their products.  But the open source community has already done it and made it available.  chef-cookbooks/sql_server · GitHub

And, it shouldn't take much to convert your current installation to 2012/14/16.  You are just performing a default, local node installation, and though the answer file changes slightly, it would not take much to update for later versions.

dnguyen03
Community Member

I am unsure if I follow clearly, so it looks like the silent install of MSSQL 2k12 or 2k14 should be done through Windows PowerShell or combination of that and VMware PowerCLI VIX scripting?

And in regards to automating MS SQL with chef, how would you integrate that into UCSD from a workflow execution perspective?

Orf Gelbrich
Cisco Employee
Cisco Employee

We do have puppet integration on the community site.

https://communities.cisco.com/docs/DOC-58262

The chef integration would probably look not all that different.

tcerling
Level 4
Level 4

The DSC resource for SQL Server can be found here - https://github.com/PowerShell/xSQLServer

Orf, Chef is actually working with the Microsoft community to work hand-in-hand with DSC - https://www.chef.io/blog/2014/07/24/getting-ready-for-chef-powershell-dsc/

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links