Showing posts with label Citrix. Show all posts
Showing posts with label Citrix. Show all posts

Monday, October 29, 2012

Disable Windows Error Recovery - Windows Server 2008 / Windows 7 / Etc.

We have Citrix XenApp servers that boot from an HP Lefthand P4500 SAN volume and for some reason during scheduled reboots on the weekend they would hang on the stupid "Windows Error Recovery" about 50% of the time.  Selecting "boot windows normally" would boot the server just fine - but it was always a manual operation.  So this would leave these production servers in a downed state until someone manually intervened.

To fix this problem I used the following command (from a command prompt):


bcdedit /set {current} bootstatuspolicy ignoreallfailures


To check to see if it is set you can simply use BCDEDIT by itself to display the settings.  For example:


C:\Users\administrator>bcdedit
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {E54e3a5f-48ad-11df-ae93-ced11e86b19d}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows Server 2008 R2
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {E54e3a63-48ad-11df-ae93-ced11e86b19d}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {E54e3a63-48ad-11df-ae93-ced11e86b19d}
nx                      OptOut
bootstatuspolicy        IgnoreAllFailures

If the setting has not been applied you will not see "bootstatuspolicy" in the list.   

Now upon reboot it does not stop and wait.  I know this has been helpful as we had to repair the boot info on a one of the servers and it started doing it again afterwards (after 8 months of smooth reboots.)   This setting got wiped-out when we did the repair so I had to set it again.  


Friday, October 19, 2012

Was my PC or Server Cloned and SysPrepped?

To find out if a server was cloned check out this registry key (this is for Windows Server 2008 R2 but I would image would be the same or similar for most flavors of Windows):

HKEY_LOCAL_MACHINE\SYSTEM\Setup\CloneTag

CloneTag will actually tell you the date and time when SysPrep was run on it.


Now if you want to check the SID values (perhaps with the source to make sure they are in fact different) use the PsGetSid utility.  You can just run PsGetSid from a command prompt to get the SID from your local PC or use "\\" to get the SID of computers connected to your LAN.

The output would be similar to this from my two Citrix servers (and this tells me my SIDs are different):
--------------------------------------------------------------------------------------------------

C:\PSTools>psgetsid \\lan-citrix1

PsGetSid v1.44 - Translates SIDs to names and vice versa
Copyright (C) 1999-2008 Mark Russinovich
Sysinternals - www.sysinternals.com

SID for \\lan-citrix1:
S-1-5-21-2052776799-13871689-1737724133


C:\PSTools>psgetsid \\lan-citrix2

PsGetSid v1.44 - Translates SIDs to names and vice versa
Copyright (C) 1999-2008 Mark Russinovich
Sysinternals - www.sysinternals.com

SID for \\lan-citrix2:
S-1-5-21-3592252623-8394611391-4172714545



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



Now does any of this really matter?  Ask Mark Russinovich (or at least check out this blog entry of his:)

The Machine SID Duplication Myth (and Why Sysprep Matters) 



** On a side Note - if you do Clone Citrix servers and you use the Citrix Gateway, you need to edit the STA ID for each clone acting as a Secure Ticket Agent. **


This applies to Presentation Server or XenApp.  XenApp 6.x in my case.
To change the STA ID edit the CtxSta.config file.
This can be found here:  %ProgramFiles(x86)%\Citrix\system32\CtxSta.config
Open the file with Notepad.
Simply change the STA ID value with anything you like and save. I just tweaked one number.

For example - in the file:
GlobalConfig
UID=STAD8D1856594FF <= change this to something unique.



Friday, January 7, 2011

How to Change Citrix License Server Name on a XenApp 6 Server

I'm posting this article because when I was searching for this answer it was hard to find anything that did a good job explaining exactly what needed to be done.  This article specifically explains how to tell a XenApp 6 server to point to a different Citrix License Server for its licensing requirements.  These instructions may apply to older versions of XenApp also.  

The proper way to do this is to create (or modify) a XenApp computer policy. You will need to add (or modify) the following setting "License Server Host Name" with the appropriate name of the new license server.
  1. Open the Citrix Delivery Services Console
  2. Drill down into XenApp, then your farm, then click on POLICIES.
  3. Click on the COMPUTER tab within the Policies pain
  4. Depending on your situation you may need/want to create a new policy for this, or you can just edit the "Unfiltered" policy.  I'm assuming if you are reading this you are fairly new to XenApp and are not dealing with a large number of servers, so just using the Unfiltered policy is fine for you.
  5. If you already have the "License Server Host Name" policy, simply change the server name value to what you want.  Otherwise you will need to add the policy with the appropriate server name.  Make sure you can ping the name of the license server, exactly how you are entering it, from the XenApp server.  Use the fully qualified DNS name for best success.  If it is beyond a firewall (or has local firewall settings) that don't allow ping replies then obviously you may not be able to ping it.  Just make sure it has the appropriate ports open (typically the range 27000 -27010)
  6. Save the policy and make sure it is enabled.
  7. From my experience you will need to reboot the XenApp servers for it to take affect quickly.




HOWEVER - I also figured out that sometimes the servers didn't comply to that policy during a reboot - see my article on that issue here. So to ensure it always points to the correct license server I would suggest also changing the following registry settings with the appropriate server name for the license server.  I will assume if you are reading this you know how to do this via REGEDIT.  The XenApp policy does NOT updates these settings and they will retain the old license server name unless you change it.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\LSName 
and
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\Licensing\MFCM_LSHostName

If XenApp can't find the Citrix license server then your users will not be able to log on!!


Alternate search terms to help people find this article:
  • Change XenApp licensing server
  • Point XenApp to different license server
  • Update Xenapp License server name
  • Control which Citrix License Server is queried by XenApp
  • How to modify XenApp License Server Host Name
  • Citrix XenApp cannot contact the license server 

Thursday, January 6, 2011

Citrix XenApp 6 servers keep reverting to old license server name

When setting up our new Citrix XenApp 6 server for initial testing we installed the license server on itself (call it CITRIX1). As we were nearing the time to move it into production I wanted to move the license service to another non XenApp server (call it XENAPP-LS).  I did so and migrated our MetaFrame Presentation Server licenses to it.  I wasn't exactly sure how to tell the CITRIX1 XenApp server to point to the new XENAPP-LS license server so did some Google searches.  I figured out you have to create a XenApp Computer Policy and add the following setting "License Server Host Name" with the appropriate name of the new license server (i.e. XENAPP-LS.mydomain.local).  Did a reboot and bingo, good to go!  It starting use the new licenses.  I removed the license server off of CITRIX1.

Problem
Well, as I was installing things I needed to do a reboot.  On the next reboot it popped up a message saying "Citrix License Error : Citrix XenApp cannot contact the license server CITRIX1".  Say what?  I checked my XenApp computer policy and it still said the license server was XENAPP-LS.   Rebooted again and this time it did not complain and was working fine.  Fast forward a few days, now the server is in production.  After one of the 3am reboots we perform each night it reverted back to looking for CITRIX1 as the license server.  No one could log on that morning!!  Another reboot fixed it.

Apparently if the server can not communicate with the SQL XenApp datastore at a magical moment during boot up, it looks in the registry and does not apply the policy.  It seems like it would eventually re-check and then apply the policy but that apparently does not happen (since it was 4 hours since the 3am reboot before the first user tried to log on and would not let anyone on).

Solution
You need to edit the registry on your XenApp server(s) to manually change the license server name to what it needs to be.

Checkout:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Citrix\LSName 
and
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\Licensing\MFCM_LSHostName

These still had the CITRIX1 value in there.  I changed it to XENAPP-LS.mydomin.local and have not since had the problem.

About Me

My photo
Science Fiction Author / Vice President of Technology for The Christman Company