vRealize Automation SQL Database Installation

TIFY2018-12-07 00:47:58

        VMware vRealize Automation(vRA)時,你需要部署負責SQL Server的Windows Server。無論是小型,中型還是大型部署都無關緊要。所有部署都需要Microsoft SQLServer。Microsoft SQL Server是vRealize Automation IaaS組件的數據庫,負責維護有關其管理的計算機及其自身元素和策略的信息。

        在本文中,將自動/無人蔘與的PowerShell腳本來描述vRealize Automation SQL數據庫。本文主要關注IaaS數據庫部分,因此不會描述有關vRealize Automation組件安裝的其他信息。


要求

在運行腳本之前,需要執行以下項目:

  • 從Microsoft網站下載最新的Microsoft     SQL 2016 Server媒體。

  • 從Microsoft網站下載最新的Microsoft SQL Server Management Studio 。

  • 創建安裝了Windows Server 2016的虛擬機。

  • 安裝最新的Windows更新。

  • 配置靜態IP地址

  • 將服務器加入公司域。





環境

在我的實驗室環境中,我正在使用外部數據庫部署最小的vRealizeAutomation安裝。這意味著為vRealize Automation環境部署了以下虛擬機:

  • LAB-vRA-APP.Lab.local -     vRealize Automation Appliance

  • LAB-vRA-IAAS.Lab.local -     運行Windows Server 2016,負責vRealize     Automation IaaS組件

  • LAB-vRA-SQL.Lab.local -     運行Windows Server 2016,負責vRealize     Automation IaaS SQL數據庫

vRealize Automation - 最小化部署


注意

請記住以下項目:

  • 使用以下版本(2016 Non-SP / 2016 SP1 /     2016 SP2)測試Microsoft SQL Server的安裝代碼/腳本。毫無疑問,代碼將適用於較新的版本,但請確保在安裝後驗證所有設置。

  • 我不承擔任何責任,我對此代碼造成的任何損害不承擔任何責任。

  • 我沒有創建一個完全自動化所有內容的腳本。它基於具有完整配置的單行。這背後的原因是靈活性。每個環境都不同,每個客戶都不同。這樣可以對部分代碼進行小的調整,或者只使用代碼的各個部分。



視頻

為了顯示代碼的完整功能,請觀看視頻。你可以在下面看到最終結果。該視頻顯示單行的執行以及服務器的配置。視頻在要求之後開始相 完成了。



無人蔘與的安裝文件

因此,讓我們列出在新Windows服務器上執行的所有步驟,以便為存儲vRealize Automation IaaS數據庫做好準備:

  1. 格式化D驅動器並確保它使用64k分配單元大小來存儲數據庫

  2. 格式化E驅動器並確保它使用64k分配單元大小來存儲TempDB

  3. 格式化F驅動器並使用默認分配單元大小來存儲日誌文件

  4. 在服務器上分配兩個域服務帳戶本地管理員訪問權限(svc-IaaS的 /     svc-VRA- SQL)

  5. 創建Windows防火牆規則以允許網絡上的SQL流量

  6. 啟用多個Windows防火牆規則以允許Microsoft分佈式事務處理協調器(DTC)

  7. 安裝Microsoft SQL Server Management Studio

  8. 安裝Microsoft SQL Server 2016

  9. 重新啟動系統

  10. 配置Microsoft分佈式事務處理協調器(DTC)。

  11. 重新啟動系統

  12. 驗證SQL Server的系統和功能

可選的:

  • 在某些情況下, 存儲SQL備份需要額外的G驅動器。

PowerShellOne-Liners

此文件在“C:\ Temp”目錄中保存為“Microsoft SQL Server 2016 -Commands.ps1”。SQL Server介質安裝在B驅動器(CD-ROM)中。SQL Management Studio安裝文件位於“C:\ Temp”目錄中。

##### Files required

# - Microsoft SQL Server2016 Installation File

# - Microsoft SQLManagement Studio 2016 Installation File

 

##### Volume 1 - DB 64k

$Disk = Get-Disk -Number 1

Set-Disk -InputObject $Disk -IsOffline $false

Initialize-Disk-InputObject $Disk

New-Partition $Disk.Number -UseMaximumSize-DriveLetter D

Format-Volume -DriveLetterD -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel "DB" -Confirm:$false

 

##### Volume 2 - TEMP DB64k

$Disk = Get-Disk -Number 2

Set-Disk -InputObject $Disk -IsOffline $false

Initialize-Disk-InputObject $Disk

New-Partition $Disk.Number -UseMaximumSize-DriveLetter E

Format-Volume -DriveLetterE -FileSystem NTFS -AllocationUnitSize 65536 -NewFileSystemLabel "TEMP DB" -Confirm:$false

 

##### Volume 3 - Logs 4k

$Disk = Get-Disk -Number 3

Set-Disk -InputObject $Disk -IsOffline $false

Initialize-Disk-InputObject $Disk

New-Partition $Disk.Number -UseMaximumSize-DriveLetter F

Format-Volume -DriveLetterF -FileSystem NTFS -NewFileSystemLabel "Logs" -Confirm:$false

 

##### Make the serviceaccount member of the local administrators group

Add-LocalGroupMember -Group"Administrators" -Member "svc-vra-iaas"

Add-LocalGroupMember -Group"Administrators" -Member "svc-vra-sql"

 

##### Windows Firewall

 

    ### Windows Firewall -Allow Microsoft SQL Port 1433 TCP

    New-NetFirewallRule -DisplayName "Microsoft SQL Server2016 - SQL - TCP" -Direction Inbound -LocalPort 1433 -Protocol TCP -Action Allow

 

    ### Windows Firewall -Enable rule for RPC for DTC

    Enable-NetFirewallRule -DisplayName "DistributedTransaction Coordinator (RPC-EPMAP)"

 

    ### Windows Firewall -Enable rule for Incoming DTC

    Enable-NetFirewallRule -DisplayName "DistributedTransaction Coordinator (TCP-In)"

 

    ### Windows Firewall -Enable rule for Outgoing DTC

    Enable-NetFirewallRule -DisplayName "DistributedTransaction Coordinator (TCP-Out)"

 

##### Microsoft SQLManagement Studio

C:\Temp\SSMS-Setup-ENU.exe/install /passive /norestart

 

##### Microsoft SQL Server2016

B:\Setup.exe/ConfigurationFile="C:\Temp\Microsoft SQL Server 2016 - Configuration.ini"

 

##### Reboot the server

shutdown -r -t 0

 

##### Configure theMicrosoft Distributed Transaction Coordinator (DTC)

Set-DtcNetworkSetting-DtcName "Local" -RemoteClientAccessEnabled:$true -RemoteAdministrationAccessEnabled:$false -AuthenticationLevel "Mutual"-InboundTransactionsEnabled:$true -OutboundTransactionsEnabled:$true -XATransactionsEnabled:$false -LUTransactionsEnabled:$true -Confirm:$false

 

##### Reboot the server

shutdown -r -t 0

GIT存儲庫: MicrosoftSQL Server 2016 - Commands.ps1

SQL配置文件

此文件在“C:/ Temp”目錄中保存為“Microsoft SQL Server 2016 -Configuration.ini”。

;************************************************************************************************************************

; Author:       M. Buijs

; Version:      1.0

; Date:         2018-09-26

;

; Information:

; This configuration fileis created to install the Microsoft SQL Server 2016 software for VMwarevRealize Automation.

;

; VMware Requirements:

; - Enable TCP/IP protocolfor SQL Server.

; - The MicrosoftDistributed Transaction Coordinator Service (MS DTC) is enabled on all SQLnodes in the system. MS DTC is required to support database transactions andactions such as workflow creation.

; - If you have a firewallrunning between the database server, Web servers or IaaS servers, deactivatethe firewall or open the ports needed (MS SQL server uses port 1433 and MS DTCrequires the use of port 135 over TCP and a random port between 1024 and 65535).

; - The database serviceaccount needs to be local administrator on the server (svc-vra-sql).

; - The IaaS serviceaccount needs to be local administrator on the server (svc-vra-iaas).

; - Set up Microsoft SQLserver with separate OS volumes for SQL Data, Transaction Logs, TempDB, andBackup.

; - The NTFS drive whereSQL Server is installed has a file allocation unit (cluster) size of 64 KB.

;************************************************************************************************************************

 

[OPTIONS]

 

; SQL Server - Workflow

   

    ; Setup Workflow(Install/Uninstall/Upgrade)

    ACTION="Install"

 

    ; SQL Server - Accept License Agreement(True = Automatically accepted / False = Users needs to accept)

    IACCEPTSQLSERVERLICENSETERMS="True"

 

    ; Specify that SQL Server feature usagedata can be collected and sent to Microsoft. 

    SQMREPORTING="False"

    ERRORREPORTING="False"

 

; SQL Server - Unatteded

 

    ; Parameter that controls the userinterface behavior.

    ; UIMODE="Normal"

   

    ; Setup will not display any userinterface.

    ; QUIET="True"

   

    ; Setup will display progress only, withoutany user interaction.

    QUIETSIMPLE="True"

 

    ; Specifies that the detailed Setup logshould be piped to the console.

    INDICATEPROGRESS="False"

 

    ; Specify if errors can be reported toMicrosoft to improve future SQL Server releases. 

    ERRORREPORTING="True"

 

    ; Displays the command line parametersusage

    HELP="False"

 

    ; RSInputSettings_RSInstallMode_Description

    RSINSTALLMODE="DefaultNativeMode"

 

; SQL Server -Installation Features

 

    ; Specifies features to install, uninstall,or upgrade.

   FEATURES=SQLENGINE

 

    ; Language Pack (English / United States)

    ENU="True"

 

; SQL Server - Updates

 

    ; Specify whether SQL Server Setup shoulddiscover and include product updates.

    UpdateEnabled="True"

 

    ; Specify the location where SQL ServerSetup will obtain product updates (MU = Microsoft Update).

    UpdateSource="MU"

 

; SQL Server -Installation Directory

 

    ; Specify the root installation directoryfor shared components. 

    INSTALLSHAREDDIR="D:\ProgramFiles\Microsoft SQL Server"

   

    ; Specify the root installation directoryfor the WOW64 shared components.

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

 

    ; Default directory for the Database Enginebackup files.

    ;SQLBACKUPDIR="<InstallSQLDataDir>\<SQLInstanceID>\MSSQL\Backup"

   

    ; Default directory for the Database Engineuser databases.

    SQLUSERDBDIR="D:\Database"

   

    ; Directory for Database Engine TempDBfiles.

    SQLTEMPDBDIR="E:\TempDB"

 

    ; Default directory for the Database Engineuser database logs.

    SQLUSERDBLOGDIR="F:\Logs"

   

; SQL Server - Instance

 

    ; Specify a default or named instance.MSSQLSERVER is the default instance for non-Express editions and SQLExpress forExpress editions.

    INSTANCENAME="MSSQLSERVER"

   

    ; Specify the Instance ID for the SQLServer features you have specified.

    INSTANCEID="MSSQLSERVER"

 

    ; Specify the installation directory.

    INSTANCEDIR="D:\ProgramFiles\Microsoft SQL Server"

 

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

    SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"

 

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

    FILESTREAMLEVEL="0"

 

; SQL Server - SA Account

 

    ; Specifies the password for the SQL ServerSA account.

    SAPWD="VMware1!"

 

    ; Specifies the security mode for SQLServer.

    SECURITYMODE=SQL

 

; SQL Server - ServiceAccess

 

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

    SQLSYSADMINACCOUNTS="Lab.local\Administrator""BUILTIN\Administrators"

    

    ; Provision current user as a DatabaseEngine system administrator for SQL Server 2012 Express.

    ADDCURRENTUSERASSQLADMIN="False"

 

; SQL Server - ConnectionSupport

 

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

    TCPENABLED="1"

   

    ; Specify 0 to disable or 1 to enable theNamed Pipes protocol.

    NPENABLED="0"

 

    ; CM brick TCP communication port

    COMMFABRICPORT="0"

   

    ; How matrix will use private networks

    COMMFABRICNETWORKLEVEL="0"

   

    ; How inter brick communication will beprotected

    COMMFABRICENCRYPTION="0"

 

    ; TCP port used by the CM brick

    MATRIXCMBRICKCOMMPORT="0"

   

; SQL Server - AgentService and Service Account

 

    ; Auto-start service afterinstallation. 

    AGTSVCSTARTUPTYPE="Manual"

 

    ; Specifies the account for the SQL ServerAgent service.

    AGTSVCACCOUNT="NTAUTHORITY\SYSTEM"

 

    ; Required Specifies the password for SQLServer Agent service account.

    ;AGTSVCPASSWORD=""

 

; SQL Server - BrowserService and Service Account

 

    ; Startup type for Browser Service.

    BROWSERSVCSTARTUPTYPE="Disabled"

 

; SQL Server - ServerService Account

 

    ; Startup type for the SQL Server service.

    SQLSVCSTARTUPTYPE="Automatic"

 

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

    SQLSVCACCOUNT="Lab.local\svc-vra-sql"

 

    ; Specifies the password for SQLSVCACCOUNT.

    SQLSVCPASSWORD="heT5S-AbEsagu7ad"

 

; SQL Server - ReportServer Service and Service Account

 

    ; Specifies how the startup mode of thereport server NT service.

    RSSVCSTARTUPTYPE="Manual"

 

    ; Specifies which account the report serverNT service should execute under. 

    RSSVCACCOUNT="NTAUTHORITY\SYSTEM"

 

    ; Specifies the password for the startupaccount for the Reporting Services service.

    ;RSSVCPASSWORD=""

GIT存儲庫: MicrosoftSQL Server 2016 - Configuration.ini

 


閱讀原文

TAGS: