Pages

Thursday 24 March 2016

How to install and configure PVS 6.1 with XenDesktop 5.6- Part 3

Creation Of VDI Using XenDesktop DDC

In this step-by-step guide I will install and configuring Citrix XenDesktop 5.6 (FP1) on a Windows Server 2008 R2 using a Microsoft SQL 2012 database installed on a separate server.
I’ll show you how to setup XenDesktop Machine Creation Services (MCS), creating a streamed VDI Desktop Group (from Citrix Provisioning Services) and finally creating the User Assignments.

Preparations

Before starting with the installation en configuration of XenDesktop you need to do some preparations. If you want to register the Citrix XenDesktop Controller in Active Directory, you need to create an OU where you want to reside VDI’s. Optionally you can create an OU for each XenDesktop deployment group like “Assigned Desktops” and “Pooled Desktops” OR you can create OU for each vDisk (Call Center, Support Desk).
Prerequisites
The Citrix XenDesktop Controllers has the following prerequisites;
-       Microsoft .NET Framework 3.5 with Service Pack 1
-       Internet Information Services (IIS) and ASP.NET 2.0. IIS
-       Visual J# 2.0 Redistributable Package, Second Edition
-       Visual C++ 2008 with Service Pack 1 Redistributable Package
-       Windows PowerShell version 2.0
Desktop Director Prerequisites;
-       Microsoft .NET Framework 3.5 with Service Pack 1
-       Internet Information Services (IIS) and ASP.NET 2.0
-        Windows Remote Management (WinRM) 2.0
-        Adobe Flash Player 10 or higher

Installing Citrix XenDesktop 5.6

1
Start the setup and click Install XenDesktop
 2
Select “I accept the terms and conditions” and click Next
 3
I’m using a separate SQL server, license server and StoreFront server so I select only the XenDesktop Controller, Desktop Studio and Desktop Director. Click Next
4
Click Install
 5
Deselect “Configure XenDesktop after closing” and click Close. I’m using a separate Microsoft SQL Server 2012. Before configuring XenDesktop I need to update the SQL Shared Management Objects, otherwise XenDesktop will not connect to the database.

Installing Microsoft SQL Server 2008 R2 Shared Management Objects

6
Start the Microsoft SQL Server 2008 R2 Shared Management Objects setup and click Yes
 7
Click Next
8
Select “I accept the terms in the license agreement” and click Next
Click Next
10
Click Install
 11
Click Finish

Configuring Citrix XenDesktop 5.6


12
Start the Citrix Desktop Studio and click Desktop deployment
13
Enter the Site name (any name you like) and fill in the requested information for the database configuration.
In my case I let this XenDesktop configuration wizard create the database. Be sure that the user account under which you configure XenDesktop have DBCreator and SecurityAdmin rights on the Microsoft SQL server.. Click Test connection
 14
Click OK
 15
Click OK
16
Click Next
17
Enter your Citrix License server and select the correct License model. Click Next
 18
To add a Vmware esxi host , select Vmware Esxi as Host type and fill in the requested information about the host. Enter a Connection name (any name you like) and click Next
 19
Enter a Host name (any name you like) and click Next
 20
Select the storage you want to use for the virtual machines and click Next
 Click Finish
Register the XenDesktop Controller in Active Directory (optional)
21
On the left side on the screen select Desktop Studio, in the middle of the screen open the PowerShell tab, as a final step, at the bottom of the screen click Launch PowerShell
22
Run the following command “Set-ExecutionPolicy RemoteSigned”. When asking to execute policy, type “Y” and hit enter.
23
Go to the folder “C:\Program Files\Citrix\Broker\Service\Setup Scripts” and run the following command;
.\Set-ADControllerDiscovery.ps1 –on –ExistingOuDN “<OU Distinguished Name>”
For example;
.\Set-ADControllerDiscovery.ps1 –on –ExistingOuDN “OU=XenDesktop,OU=Citrix,OU=Servers,OU=PoC,DC=Hobo,DC=LAN”
After running this script, restart the Citrix Broker Service.
 24
In the OU specified in the previous step there is now a RegistrationServices Container, a Farm SCP serviceConnectionPoint and a Controllers Security Group where the XenDesktop Controller is member of.

Provisioning New VM

Now it’s time to start provisioning new VMs. In the PVS Console, right click on your site name and click “XenDesktop Setup Wizard…”
25
 Hit Next at the Welcome screen
26Type in the FQDN of only one of your DDCs and hit Next
27        
 Select the host you want to run your machines on and then hit Set Template to set the VM template.
28Type in credentials for your Host and hit Log On, you will see all the templates on the host. Choose the VM template you had created in the steps above and hit OK and then Next.
29
 Choose your Device Collection and vDisk
30
 Now you can create a new Catalog or use an existing catalog. In this example, I am going to use an existing catalog. Select your Admins and hit Next.
31
Choose the number of VMs to create. I will choose 5 in this example. Leave the default of creating new AD computer accounts.
32
Choose the OU you want your new VMs to be put in. You can also choose the naming scheme for the new VMs at this point.Hit Next.
33
You will see the Summary screen. Hit Finish and your VMs will start to be created. The progress bar will show you the progress but you can also go to VCenter and watch the VMs beign created. They will not be powered on by default since you haven’t instructed your DDC to do so yet.
34
Now go to your DDC and open up Desktop Studio. Under Machines, you will see your catalog and it will show there are 5 free machines that have not been assigned.
 35
 Double click on the catalog and you will see the 5 machines but their SIDs since they have not been powered on yet.
36
 Click on Assignments in the left and create a new Desktop Group
37
 Choose your Catalog, add all 5 machines, and hit Next
38
Add your users and hit Next
39
 Admins should already be selected so hit Next
40
 Choose a Display Name and Desktop Group Name. The Display Name will be shown to the end user in the Web Interface. The Desktop Group name is for within Desktop Studio. Hit Finish.
41
Now go to your Web Interface (or the DDC itself in this example). Login using an account you have assigned one of your VMs to. If it’s the only thing on your WI, the desktop will start booting up immediately.
42  Log into your new VM and create and you will see the Welcome message.
 43
Create a new text document on the desktop. Then log off.
44Click the desktop icon again on the WI and it will launch the VM again. It will likely be another VM entirely you will be logging onto, but of course it will look the same. You will notice your text document is gone now. Exactly as expected.
45
That’s it! You are now up and running with your first provisioned desktops. Now you can create copies of the VHDs and begin customizing your images for different departments. Make sure the disks are in private mode when making your changes. You can also use the versioning feature for little changes to the images like Windows Updates.
SETTING UP WRITE CACHE
So Write Cache is that big scary thing that can make or break your PVS implementation. Where you put it makes a world of difference. There are several options available where write cache can be stored. Most people opt for caching on a hidden local drive on the VM i.e. on your Host local disks or direct attached storage on the Host. It’s cheap and it works well for most implementations.
Keep in mind it is not shared when you do this. Citrix has a good article called “How to Add a Persistent Volume to Your Provisioned Virtual Machine in XenServer” located here:
And another excellent blog post here on PVS write cache size considerations:
1.Go to your Store, copy the .vhd file, paste it in the same location. Call the new VHD file whatever you like.
In the PVS Console, right click Store and click “Add or Import Existing vDisks. Search the store and add the vDisk you just created.
46
2.Under properties, make sure to enable “Enable Active Directory machine account password management” and KMS Service because they will likely not be checked when importing just the vhd.
3.Make sure the vDisk is in private mode
4.Go to your device collection and assign the vdisk to a device. You can use the original VM you were using to build out the Windows 7 image. Make sure it is set to boot from vDisk.
5.Go to VM Edit Settings in Vcenter, , and hit Add for new Hard disk . You can name it something like “Win7MSDNBaseISO-WC”. We will leave the size as 10 GB. That’s a pretty decent size for a Windows 7 box rebooted once a week. Then hit Add.
6.Ensure the new disk was created with position 1. Position 0 should be your c: drive.
7.Now power on the VM, booting from the DVD and with the PVS boot disk in the drive. You will notice that Windows has detected a new drive under Disk Management. Initialize it.
8.Right click the new disk, New Simple Volume, choose the full size of the drive, assign it z:, and format it as NTFS, label the volume “Write Cache”, then hit Finish on the confirmation page to format it.
9.Shut down the VM. Detach the c:, leaving only the 10 GB z:. Copy it. Rename it to a template name, then hit Convert to template.
10.Go to your PVS console, under Store, and switch the vDisk to Standard Image and under Cache type, switch it to “Cache on device hard drive” and hit OK.
11.Go to your Site in the PVS Console and run through the XenDesktop setup wizard again like you did before but using your new template. Also go to your DDC and setup your desktop group, assignments, etc. like before but create a new desktop group so you know which ones are the new “local write cache” machines.
12.Launch one of your new VMs. You will see the Z: now called “Write Cache”. Also on the  VM Summary, you will see 10 GB drives created for all your VMs.

How to install and configure PVS 6.1 with XenDesktop 5.6–Part 2

 Preparation of Golden image (vDisk) for Citrix Provisioning Server
 
Since you now create one base image, and after creating the vDisk you start to make it “private” or as you want to publish it.That will speed up the process of creating new Vdisk’s for new users
Step-1 Create a Golden Image
A golden image is the image that is going to be streamed to the various VMs that the end users connect to.
1. Install the host operating system to the virtual machine (VM).
2. Add all the various applications that required by the end-user.
3. Do not install the VDA Agent.
4. Once the image is created with VMTools and installed minus the VDA agent, install the Provisioning Server Target Device Software. Once installed, shut down the VM and proceed to Creating the vDisk File.
Step-2 Creating the vDisk File in the Console
To create a new vDisk file in the Console.
  1. In the Console tree, right-click on the vDisk Pool in the site where you want to add those vDisks, then select the Create vDisk menu option. The Create vDisk dialog appears.
1
2. If you accessed this dialog from the site’s vDisk pool, in the drop-down menu, select the store where this vDisk should reside. If you accessed this dialog from the store, from the drop-down menu, select the site where this vDisk should be added.
3. In the Server used to create the vDisk drop-down menu, select the Provisioning Server to create the vDisk.
4. Type a filename for the vDisk. Optionally, type a description for this new vDisk in the description textbox.
5. In the Size text box, scroll to select the appropriate size to allocate for this vDisk file.
2
6. In the VHD Format text box, select the format as either Fixed or Dynamic .( Set the size for the vDisk. Normally I have enough of 30 to 50 gb, depending on the installed applications on the server. Set VHD type to Dynamic which means that only the space that is really needed will be used for storing the vDisk)
7. Click Create vDisk, a progress dialog opens. Depending on the disk size and other factors, it might take several minutes to create the vDisk. After the vDisk is successfully created, it displays in the Console’s details pane and is ready for formatting.
8. Right-click on the vDisk in the Console, then select Mount vDisk. The vDisk icon appears with an orange arrow, if mounted properly.
Step-3 Formatting a vDisk
For a target device to access the new vDisk, after you have created and allocated space for the vDisk file on the Provisioning Server, you must format the vDisk.
To format a mounted vDisk from the Console
In the Console, the vDisk should appear as a removable disk to the operating system.
1. Open a Windows Explorer window (click My Computer on the Desktop or on the Start Menu).
2. Right-click on the vDisk, then select Format.
3. Create a descriptive name for the volume label for the vDisk.
4. Click Start. Then click OK on the warning message that appears.
5. After formatting, close Windows Explorer and unmount the vDisk.
To unmount a vDisk
To unmount a vDisk and make it available to target devices, in the Console, right-click on the vDisk, and then select the Unmount vDisk option.
Step 4 – Create Target Device within PVS for the “Master Server”
1. Within the Provisioning Services Console, under Device Collections, create a Device Collection with the name Masters (or anything you like). This is not a required step but is recommended because it is easier to manage later.
3
2.Right click the “Masters” Device Collection and click on Create Device.
4
3.On the General tab, enter the name of the Master server. Select to Boot from Hard Desk and fill in the MAC address of the primary NIC of the Master Server (the NIC the Master server boots from).
4.On the vDisk tab, Add the vDisk created in step 2 and click OK
5
Installation of Provisioning Server Target Device Software and VDA on Golden Image
1. Go to Vsphere and start the base machine and make the required changes in the machine and then install the Provisioning Services using Provisioning Services installation media and select Install Target Device for 64 bit Platform
6
2. Click Install
7
3. Finish
8
4. Select Yes to restart the Master Image
9
5. Start the Provisioning Services Imaging Wizard
10
6. Click Next
11
7. Enter the server name of the Provisioning Services server where you stored the vDisk and click Next
13
8. Select Use existing vDisk and select the vDisk created in step 2
14
(When receiving the error “There are no vDisks available that are in Private mode and not locked accessible by the Server specified” make sure there is no Lock on the vDisk, you can remove the Lock in the PVS console by right-click the vDisk and click on the option “Manage Locks”)
9. click Next
10.Click Autofit and then Next
The errors in this dialog means that the target vDisk is smaller than the local hard disk in the Master Server. If you get this errors you have to click on Autofit.
11. Click Next
12. Click Next
13. Select Finish
14. Click on Optimize for Provisioning Services
What to optimize depends on your environment, for example in most cases the Windows Auto-update services can be disabled (also recommended sins the vDisk is read-only). But if System Center 2012 Endpoint Protection is used in the environment, the Windows Auto-update services is needed for the anti-virus updates. Apply what is applicable for your environment and click OK.
15. Click Finish
16. Click Yes to reboot the server.
17. After the reboot, log on with the same user account. Vmware Esx will automatically start to convert the files from the local hard drive to the vDisk.
18. Click on Finish
Step 5 – Configure the Master Server to boot from vDisk
1. Within the Provisioning Services Console open the properties of the Master Server.
2. On the General tab and change “Boot from” to vDisk. Click OK
Step 8 – Deploying the vDisk
Within the Provisioning Services console, open the properties of the vDisk.
Change “Access mode” to Standard Image (multi-device, read-only access) and select the place where you want to store the cache files. Enable Active Directory machine account password management.
If you have more Citrix Provisioning Services servers in your environment, right-click the vDisk and click on Load Balancing
Select Use the load balancing algorithm and Rebalance Enabled. Click OK
Open Windows Explorer and copy the vDisk to the other servers