Jesse Boehm - Information Technology Consultant

If you are looking for Techstur.com we are currently closed for Interface Work.

Please contact Jesse for IT Consulting, Web Design, Online Marketing and Graphic Design.

This site is currently serves as Jesse's Resume & Article site

Citrix Provisioning Services 7.6 High Availability using DFS Replication

by – Jesse Boehm

A PDF version of this article is available the cost is $5.00





Citrix Provisioning Services High Availability Objectives:

  • SQL Database Mirror using Witness Server
  • DHCP High Availability
  • DFS Replication of vDisk Files using Full Mess Topology
  • Enable Provisioning Services Database Failover Partner
  • Enable Offline Database Support
  • Convert Full Mesh to Hub and Spoke Topology

Section 1
SQL Database Mirror using Witness Server

My Lab Setup

2 x 2012 R2 Server running SQL 2014 Standard 1 x 2012 R2 Server Running SQL 2014 Express (Witness Server)

Provisioning Services Database: LABPVS

Backup Directory: C:\mirror

Windows AD SQL Service User: JESSEBOEHMLABS\sqlsrv

Task 1 – Backup Database

Right click on database > Tasks > Backup

First I am going to take a Full Backup and save it to my backup location c:\mirror

Then I am going to repeat the step but this time select Transaction Logo and save it to my backup location.

Now that I have my Backup Files I am going to copy them in the mapped drive to the share I created when I setup my LAB for this article that is mapped to my Secondary SQL Server.

Now I have completed everything to backup my database

—-

Task 2 – Restore Database Right click on Databases and select Restore Database…

Choose Device as the Source and then browse to your file location, which in this case is c:\mirror, select the backup and transaction file from Task 1 and click OK.

Now under Options, THIS IS VERY IMPORTANT!

Set your Recovery state to: RESTORE WITH NORECOVERY

Then click OK

Database should be Restored and stuck in a Restoring… mode.

Now I have completed everything to restore my database

—-

Task 3 – Create Database Mirror

In this section I am going to include all the common errors I face when setting up a new Database Mirror in this scenario. In an environment that is already setup for this type of environment these issues will probably not present. But I include the errors and the fixes in this article to save you time in case they do.

Primary Database Server

Right click the database > Tasks > Mirror

Click Configure Security

Do you want to configure security to include a witness server instance?

Yes for my LAB I do

Keep Witness server instance checked

Principal Server Instance will be filled in. I have no changes, click next

Mirror Server Instance, select you server Instance. In this case LABSQLMR\PVS and click Connect. You will authenticate. Then click Next

Select our Witness Server Instance, in our case LABFS\PVS

First Error: Provider: SQL Network Interfaces, error: 28

I will say I am not sure if this error is unique to SQL Express as the Witness Server. But in any case I am going to move over to my Witness Server LABFS

Open SQL Server Configuration Manager > SQL Server Network Configuration > Click on Protocols for your Instance.

Named Pipes and TCP/IP are Disabled. Right click and Enable. You will get a Message about restarting the Service, click OK.

Open Services, right click SQL Server (INSTANCE)

Back over to our Mirror Setup, click OK to the Error. Click Connect again and now we are connected. Success to our first error.

At this point we want to click Next and not Finish as we need to enter our Service Account User Account in the next step.

I recommend keeping the username in a place where you can copy and paste it easily as you are going to go through this wizard a few times if you experience errors, which you will if you are setting up a new environment.

Click Next, then Finish.

Click Start Mirroring. I am expecting our next Error.

Second Error: Microsoft SQL Server, Error: 1418

From experience, there are a few things that are needed for this to work. The SQL Server Instance Service needs to run as the SQL Server User we are configuring for the Database. So I am going to say OK to this error as it is misleading and if you research this error you will find that we did everything correct.

Open Services on all 3 SQL Servers and set the SQL Server (INSTANCE) Log On As to the SQL Service User you are using for the Mirror.

Now that this is done, let’s run through the Mirror Wizard again

Third Error: Microsoft SQL Server, Error: 1478

So now the Database we restored is not in line with the primary database.

We need to Backup and Restore the Transaction Log

When Restoring the Transaction Log, it is VERY IMPORTANT under options to select

RESTORE WITH NORECOVERY or the same error will come up when you run the Mirror Wizard.

Re-run the Mirror Wizard.

Success!

We worked through all the errors, click ok

Now you can see the Database is (Principal, Synchronized)

If you look at the Database on the Secondary

You can now see the Database is (Mirror, Synchronized / Restoring…)

To test failover on the Primary Server

Right click the Database > Task > Mirror > Click Failover > Yes

And the Roles have switched

Database Mirroring is completed.

What I have learned from Database Mirroring is that they errors are misleading, but what needs to be done to setup Mirroring is pretty specific. Service Accounts needs to run SQL Service, the Transaction Log always needs to be restored a second time after you initiate the Mirror process. SQL Express always installs with hits 2 Services Disabled. Also if you are running Mirroring in another SQL Instance on a server with another Mirrored Instance running use another port.

—-

Section 2
DHCP High Availability

My Lab Setup

2 x 2012 R2 Server
Citrix Provisioning Servers 7.6
DHCP Installed on both servers
DHCP Scope configured on one server

Task 1 – Configure Failover

Select the Scope you want to configure.

Right click Scope > Configure Failover

Next

Choose Partner Server

Next

I am going to leave this at 50%/%50% Load Balancing

I am going to Uncheck Enable Message Authentication, as I don’t need it

Next

Finish

Close

On my Partner DHCP Server I am going to configure options 66 & 67 for PVS PXE Booting.

We have completed configuration of DHCP High Availability.

—-

Section 3
DFS Replication of vDisk Files

My Lab Setup

2 x 2012 R2 Server
Citrix Provisioning Servers 7.6
DFS-R Installed on both servers
Folder (vDisks): vDisks Production
Folder (Staging): vDisks Staging
Those folders exist on both servers in the root of E:\

Task 1 – Create DFS-R Group

Select New Replication Group

Set the name of the Replication Group

Next

Select your Provisioning Servers (I am using Two Servers in this Article)

Next

I am using Full Mesh since I am using Two Servers

Next

I want Continuous Replication

Next

Set the Primary Member

Next

Select Folder: E:\vDisks Production

Next

Edit

Select Folder: E:\vDisks Production

I don’t want it to be Read Only since I want to make changes on either PVS Server

OK, Next, Create

Close

Click OK to the Replication Delay Message

That completes creating Replication Group

Task 2 – Edit DFS-R Group

Under Memberships Tab

Right click Primary Member and select Properties

Staging Tab

Set path to: E:\vDisks Staging

I set the Quote to 40 Gig which is my Max Hard Drive Size in my LAB

Click OK

Do the Same for the Secondary Member

Under Replicated Folders

Right Click the “vDisks Production” Folder

Need to add an entry for “*.lok” in the File Filter. This way DFS-R will not Replication LOK files between servers.

Click OK

Restart the DFS-R Services on both Servers for the changes to apply.

This completes editing the Replication Group

Task 3 – Testing Replication

Going to do a simple test by creating a text file on server 1 and seeing it show up on server 2, then delete on server 2 and see delete on server 1

Success

Task 4 – Replication vDisk

Now that replication is working. I want to replication my vDisk

So I am going to remove my vDisk from my Target Device in PVS and then Delete my vDisk from PVS. BUT NOT DELETE THE FILES!!!!

Make a BACKUP!!

Then I am going to copy the *.VHD and *.PVP in to the E:\vDisks Production Folder and then you wait.

The only think you can do at this point is make sure that the file shows up in the Staging Folder.

Take a break!

Hung out with my daughter, took a nap, came back and replication finished

Added the vDisk to Provisioning Services and to my Target Device

Started my Server and everything came right up

Check my vDisk Replication Status

Note the time 10:29 AM

Now I am going to Add a Version and let it replication and check the replication status

Version Replicated in seconds. Obviously there is no data in the Version yet. But between the two images I updated the article and took the screenshot and checked replication status.

So everything is working as I would like it.

We now have automatic two-way continuous replication of Citrix Provisioning Services 7.6 using Microsoft DSF-Replication.

—-

Section 4
Enable Provisioning Services Database Failover Partner

Task 1 – Provisioning Services Configuration Wizard

Launch the Provisioning Services Configuration Wizard

Next, Next,

Join and Existing Farm, Next

Check: Specify database mirror failover partner

Enter: LABSQLMR

Enter: PVS

Next

Select Farm Name

Next

Existing Site

Next

Existing Store

Next

User Account

This is very important. Here you need to specify the user account that you used for the SQL Service Account. If you leave this as Network Service Account the Services WILL FAIL.

Next, Next, Next, Next,

Finish

If successful click Done.

If this process fails. You may need to manually start the three services with the new service account and rerun the process and you should be set.

Launch the PVS Console and make sure everything looks good.

Complete the same steps for the Second Server

Configuring Provisioning Services Database Failover Partner is complete.

—-

Section 5
Enable Offline Database Support

Task 1 – Enable Offline Database Support

Last step of our High Availability Provisioning Services Environment

Right Click the farm name > Options > Check: Enable offline database support

Click OK

You will get a message about Restarting the Provisioning Services Stream Service. Restart the Service.

Repeat on the Second Server.

High Availability Provisioning Services Environment Setup is completed

—-

Section 6
Converting DFS Replication from Full Mesh to Hub and Spoke

Change I have made to my environment:

I have brought a 3rd Citrix Provisioning Services 7.6 server online.

I installed the server into my Farm with Mirror Database Support

I have Installed DFS Replication Role from Server Manager (Not Configured)

I have added a 150 Gig E:\ Partition

I have created the E:\vDisks Production and E:\vDisks Staging Folders

Task 1 – New Group Member

Add New Member to Group

Add connections

Next through Schedule

Next

Edit, Set Path: E:\vDisks Production

Next, then Create

Close

New Group Member has been added

Task 2 – Edit Group

Right-click on the server under Memberships and select Properties

Set Staging Path and Disk Quota

Staging Path: E:\vDisks Staging

Quote: 40 Gig

Group has been edited

Task 3 – Convert Full Mesh to Hub and Spoke

Right-click Group > New Topology

Warning Message about Existing Connections being deleted, select Yes

Select: Hub and Spoke

Select Hub Member: LABPVS1

Next

Full Bandwidth

Next

Select Hub Member: LABPVS1

Next

Full Bandwidth

Next

Create

Now the Replication waiting begins again

The waiting didn’t take very long at all

Full Hub and Spoke Replication

Let’s time Version replication between the Hub and two Spokes

Creating Version 2 on Hub at 7:20PM

Finished Version 2 Replication on Spokes at 7:21PM

This completes the Hub and Spoke Conversion from Full Mesh.

Hub to Spoke 1 < – > Spoke 1 to Hub

Hub to Spoke 2 < – > Spoke 2 to Hub

No communication between Spoke 1 to Spoke 2

This completed my article

Thank you for taking the time to read and I hope you found this helpful

Jesse Boehm

jesse@jesseboehmconsulting.com

logo image
RSS
Follow by Email
Facebook
Facebook
Twitter
Visit Us
SHARE
PINTEREST
PINTEREST
LinkedIn
Instagram