Deploying incentive Social collaboration Software using SCVMM 2012 Service template Part 1

This blog will show you how to deploy web deployment package , SQL Service and Microsoft SQL Data-Tier Application (DAC) package  using System Center Virtual Machine Manager 2012 through Creating Service Templates using the VMM 2012 Service Template Designer. The resultant service template can be used to deploy service against direct host or Private cloud through Microsoft App controller  or System Center Virtual Machine Manager 2012 Console.

In my pervious blog post I have showed how to create a Microsoft SQL Data-Tier Application (DAC) Package and web deployment package for Social collaboration  incentive web Application  ,  in this post we will use these Files to deploy service in System Center Virtual Machine Manager 2012. The below step are for Creating Service Templates using the VMM 2012 Service Template Designer.

1. Prepared a syspreped VM templates Windows 20088R2SP1

  • Enable inbound File Sharing Firewall Rule
  • Enable remote management Firewall Rules

2. Prepared a syspreped SQL 2008 R2 VM templates Windows 20088R2 SP1 , see VMM 2012 SQL Server Profile technet blog post

  • Enable inbound File Sharing Firewall Rules
  • Create a inbound Rule for SQL at Port 1433 Firewall Rules
  • Enable remote management Firewall Rules

3. download MS SQL DAC Framework , create a folder in your SCVMM2012  library call it SQL2008R2_DAC_Framework_X64.cr

(e.g. \VMMLib\ApplicationFrameworks\SQL2008R2_DAC_Framework_X64.cr)

image

Create a patch file “InstallSqlDAC.cmd” to install the DAC Framework in the same folder, The content of the patch file is:

@echo off

echo Installing SQL 2008R2 DACFramework …
start /wait %windir%\system32\msiexec.exe /qn /i DACFramework.msi /l %temp%\DACFramework.log
if errorlevel 1 (
echo “SQL 2008R2 DACFramework installation failed. See log at %%temp%%\DACFramework.log for more details.”
exit 1
goto EOF
)
echo  DACFramework installed.

echo Installing SQL 2008R2 SharedManagementObjects …
start /wait %windir%\system32\msiexec.exe /qn /i SharedManagementObjects.msi /l %temp%\SharedManagementObjects.log
if errorlevel 1 (
echo “SQL 2008R2 SharedManagementObjects installation failed. See log at %%temp%%\SharedManagementObjects.log for more details.”
exit 1
goto EOF
)
echo  SharedManagementObjects installed.

echo Installing SQL 2008R2 SQLSysClrTypes …
start /wait %windir%\system32\msiexec.exe /qn /i SQLSysClrTypes.msi /l %temp%\SQLSysClrTypes.log
if errorlevel 1 (
echo “SQL 2008R2 SQLSysClrTypes.msi installation failed. See log at %%temp%%\SQLSysClrTypes.log for more details.”
exit 1
goto EOF
)
echo  SQLSysClrTypes installed.

echo Installing SQL 2008R2 TSqlLanguageService.msi …
start /wait %windir%\system32\msiexec.exe /qn /i TSqlLanguageService.msi /l %temp%\TSqlLanguageService.log
if errorlevel 1 (
echo “SQL 2008R2 TSqlLanguageService.msi installation failed. See log at %%temp%%\TSqlLanguageService.log for more details.”
exit 1
goto EOF
)
echo  TSqlLanguageService installed.

:EOF

4. Verify that you have the latest web deploy package. if you received the error “Deploying web application VMM 2012 fail with error ApplicationFrameworkNotInstalled;2.0.1070.” check this post

5. Create a folder in your SCVMM2012  library call it  “incentiveApp” Copy the incentive web deploy package and the incentive DAC package  that you have created following my pervious blog post to this folder.

6. Create SQL Script file “Createandenableuserincentive.sql “ in the same folder.

The script will create  the user “incentiveuser” login, set password and Bd_ownership on the application DB called “incentive” , the second part of the script is a copy of the prepare.sql script from the original package. it has the following content :

USE [master]
GO
CREATE LOGIN [incentiveuser] WITH PASSWORD=N’P@ssw0rd’, DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [incentive]
GO
CREATE USER [incentiveuser] FOR LOGIN [incentiveuser]
GO
USE [incentive]
GO
EXEC sp_addrolemember N’db_owner’, N’incentiveuser’
GO

——————————————-
— insert everyone group and anonymous user
—————————————–
SET IDENTITY_INSERT [dbo].[UserGroup] ON
INSERT [dbo].[UserGroup] ([ID], [Name], [Email], [DistinguishedName], [NetworkGuid], [Description], [Type], [Created], [Modified]) VALUES (-1, N’Everyone’, null, null, null, null, 0, CAST(0x00009881010D19E1 AS DateTime), CAST(0x00009AA300FFAA93 AS DateTime))
SET IDENTITY_INSERT [dbo].[UserGroup] OFF
GO
USE [incentive]
GO
SET IDENTITY_INSERT [dbo].[User] ON
INSERT [dbo].[User] ([ID], [Name], [Email], [DistinguishedName], [NetworkGuid], [NetworkUsername], [Username], [Password], [Type], [Created], [Modified], [IsAdmin], [Enabled], [LastLogin], [ContentID]) VALUES (-1, N’Anonymous’, NULL, NULL, NULL, NULL, N’anonymous’, NULL, 0, CAST(0x00009AF000EEB432 AS DateTime), CAST(0x00009AF000EEB432 AS DateTime), 0, 1, NULL, NULL)
SET IDENTITY_INSERT [dbo].[User] OFF
GO

image

7. In SCVMM setting , create the needed Run AS accounts for this deployment

image

  • SQL Authentication SA Account
  • SQL windows authentication SA Account
  • Local Administrator Account
  • Domain Account with local Administrator permission and permission to Join computer to domain
  • SQL Service Account ( you can have one account for all services or create account for each service)

image

8. in SCVMM Library Create SQL Profile , with the following settings

Instance Name Should read: MSSQLSERVER

Instance ID ”the ID you used during SQL Sysprep installation” : SQLSYSPREPED

Installation Account: Account with Local Administrator permission

image

The Media source should point to the SQL installation CD

image

The Account under witch SQL Services will Run.

Note: you can Create a separate for each service or use one account for all services.

image

9. Create Application Profile for The web Application Deployment , in General tab call it “ Incentive web Application” , select OS compatibility for this Application profile

image

10. Select Application Configuration –> Add web application –>Select web Application and assign it a name “incentive web Application”

image

Click Browse and select the incentivewebapplication.zip package

image

12. in the setting section Double click the MSSQLConnectionString type in the name of The SQL Server instance that will be deployed for this application “ISQL01”  then Click Ok, if you want to change the password or user name you will need to modify the corresponding SQL Script.

NOTE: connection string cannot contain at sign (“@”); to express literal at sign (“@”), use double at sign (“@@”). This is true for most of templates setting is SCVMM , the @ is used to define service setting , for more information about service setting check this post SC VMM 2012 Service Settings

server=ISQL01;database=incentive;user=incentiveuser;password=P@@ssw0rd

image

13. Click ADD Button and select script ( this script will install web deploy package to your web server)

Script command type: Preinstall

Executable Program: cmd.exe

Parameters: /q /c installwebdeploy.cmd

script resource package: Webdeploy package

Run as Account : Account with Administrative privilege

image

NOTE: Patch file name in parameters is coming from VMM library web deploy package folder

image

Click OK.

14. Create Application Profile for incentive DAC package, call it Incentive DAC Package in general , select SQL Server Application Host in the compatibility Drop box.

image

15. Select Application configuration , click Add and Select SQL server Data-tier Application , Select check boxes for OS compatibility.

image

16. Select the SQL server Data-tier Application , Give it a Name (incentive SQL Server Data-Tier) ,

click Browse and Select you’re the incentive.dacpac package .

SQLDAC Instance Name:Incentive

Authentication type: windows Authentication

SQL deployment Account: SQL Windows Authentication SA Account

image

Note: The SQLDAC Instance Name will be used as the DB Name in SQL

17. Select SQL Server Scripts click Add , in the SQL Script details

SQL Server  Script type :Post-Install

Data Base name:

SQL Server Authentication type: windows Authentication

SQL Server Script:Createdandenableuserincentive.sql

log file path:c:\windows\temp\sqlscript.txt

Deployment Run as Account: SQL Windows Authentication SA Account

image

18. Click OK  –> Ok

Move to Part 2 Of This Blog.

Advertisements

About Hikmat Kanaan

I’m big fan of technology; I have worked almost with every MS windows OS up to Windows 8 and server 2012 including OS deployment, AD and almost every MS OS service included major MS products ISA ,TMS, Exchange, System center ,Sharepoint ,SQL , Storage system, Networking, security, Cisco, HP, and Checkpoint products. Designing and Architecting IT solutions and infrastructure . I do admire automation and working based on best practices toward building highly reliable solution that provide the required services to Business. I also run the Jordan IT professionals user Group http://www.jitpros.net
This entry was posted in Private cloud, VMM2012 and tagged , , . Bookmark the permalink.

3 Responses to Deploying incentive Social collaboration Software using SCVMM 2012 Service template Part 1

  1. kirpal Singh says:

    Thanks a Lot.. Kirpal Singh

  2. Pingback: Deploying MS PetShop 4 using SCVMM 2012 service template | Private Cloud & Virtulazation

  3. Decent internet page. Very nice blog position relating to Deploying incentive Social collaboration Software using SCVMM 2012 Service
    template Part 1 | Private Cloud & Virtualization.
    You definitely have the blueprint for fulfillment taking place right here.

    For certain I will take note of your web-site and come back subsequently.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s