How to Configure LHC to use Custom Port
book
Article ID: CTX250134
calendar_today
Updated On:
Description
The FMA services in XenDesktop 7.x use port 80 for communication by default. For security reasons, Customers may want to change the default use port (80) of Citrix Broker Service and Citrix High Availability Service to custom port.
Instructions
Follow below steps to configure Citrix Broker and Citrix High Availability services to use custom port.
• Modify the default storefront port of Citrix Broker service via cmd or PowerShell by using below command

• Modify the storefront port of High Availability service to be same as that of Broker service. Although SF port for this gets updated automatically but still change it explicitly by using below command.

• Launching Citrix studio will prompt you for "Automatic Site Upgrade" and continuing with the upgrade should update the broker service port changes returning with 1 successful task.

• Follow the above steps on all the delivery controllers and complete automatic site upgrade via Citrix studio.
• Run
netsh http show urlacl on all the DDCs and ensure you see Reserved URLs of all the broker WCF endpoints for CitrixHighAvailabilityService and they are in 'Listening' state.
Example:

• Modify the Storefront GUI port via SF console to match with the Storefront port configured for Citrix Broker and Citrix HA services.

• Validate and confirm, you are able to enumerate and launch applications successfully.
• Switch to LHC outage mode and monitor the events on DDC to confirm secondary broker service has taken over to serve user requests.
• Validate and confirm, you are able to enumerate and launch applications successfully in LHC outage mode.
LHC Outage Mode:During the period directly after the database connection is lost, resource (Application/Desktop) enumerations in StoreFront and Session launches may fail. In practice it takes ~2 minutes before the site starts working (Resources enumerating and session launching). The site will not be fully functional until all the machines have re-registered which may take up to 10 minutes (You can decrease this interval via registry) . Recovery from the outage follows a similar flow.
Step | Timeline | Description |
1 | 0 seconds | DDCs lose connectivity to the Site Database. |
2 | 0 - 60 seconds | Services are unable to contact site database and report errors in the event log. |
3 | 120 seconds | Broker Service hands over the XML communication to the High Availability Service (Secondary Broker). |
4 | 120 seconds | StoreFront is no longer able to communicate with the Secondary DDCs. All Enumerations are going to the Primary DDC. |
5 | 120 – 600 seconds | VDAs begin to register with the Secondary Broker on the Primary DDC. |
6 | 120 - 600 seconds | Site is ready. |
| | |
The process of exiting outage
Step | Timeline | Description |
1 | 0 seconds | DDCs gain connectivity to the Site Database. |
2 | 0 - 60 seconds | Services connect to the Site Database and report connection in the event log. |
3 | 120 seconds | High Availability Service (Secondary Broker) hands over the XML communication to the Broker Service. |
4 | 120 seconds | StoreFront is able to communicate with all the DDCs |
5 | 120-600 seconds | VDAs begin to register with the Broker Service a DDC in their List of DDCs. |
6 | 120-600 seconds | Site is ready. |
Environment
The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
Additional Information
https://support.citrix.com/article/CTX130002 - How to Change the Virtual Desktop Agent Registration Port in XenDesktop for Desktop Delivery Controller and Virtual Desktop Agent
Was this article helpful?
thumb_up
Yes
thumb_down
No