XenApp Machine Power State Uknown or Incorrect

Issue: Citrix Studio showing the power state for a machine as Unknown or incorrect (i.e. Studio says the machine is On when it’s in fact powered off or vice versa) following a vcenter outage.

I have quite quickly found https://support.citrix.com/article/CTX131267?_ga=2.83298006.1304926953.1588149335-464024711.1570620116 and following the instructions established that the Machine IDs are mismatched between the Citrix and vCenter databases.

To check quickly check:

  1. On a Citrix Delivery Controller run the following in powershell:

    asnp Citrix*
    Get-BrokerMachine | Select-Object -Property MachineName, PowerState, RegistrationState, HostedMachineId

    This will give you details for each machine as they are in the Citrix database.

  2. Now run:
    Get-ChildItem -Path XdHyp:\ -force -recurse | ?{ $_.IsMachine } | Out-File –Filepath c:\xdhyp.txt

    This will give you details from vmware.

  3. Look up one of the problem machines in xdhyp.txt and compare the ID with the HostedMachineID from step 1. You should see that they are different.

The Citrix article would have you believe that you can change the ID in the Citrix database by running

Set-BrokerMachine -MachineName ‘MyDomain\MyMachine’ -HostedMachineId

However this will error with:

Set-BrokerMachine : The term ‘Set-BrokerMachine’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

To get around this you will need to edit the vmx files of the affected machines with the HostedMachineID from the Citrix Database.

This is fine if you only have a handful of machines to correct but otherwise it might be quicker to just delete those machines and create new ones. I’m not sure if editing the Citrix Database directly would also be an option.

Editing the vmx files:

  1. Shutdown the machine
  2. Browse the datastore the machine is on and download the machinename.vmx file.
  3. Open in notepad and search for “uuid.bios
  4. You should see this is different to the HostedMachineID you’ve got earlier and matches the ID from the xdhyp.txt file.

    “uuid.bios = “56 4d 01 d4 26 c8 9a bf-fa 27 b5 74 61 70 0e f2”

  5. Replace the uuid.bios value with the HostedMachineID making sure you follow the same format. For example if the powershell output looks like this:
    42061861-553b-950b-55a3-6da713ee701e
    edit it into the following format:
    42 06 18 61 55 3b 95 0b-55 a3 6d a7 13 ee 70 1e
  6. Save the vmx file.
  7. Remove the vmx file from the datastore (make sure you have a copy).
  8.  Upload the edited vmx file into the datastore.
  9. Power the machine back on and you should see the correct Power Status in Citrix Studio.

 

 

Advertisement

Test Checklist for Citrix XenApp Deployment

While this won’t fit the bill for all your Citrix XenApp deployments I wanted to share what I like to test at the end of a new deployment as I couldn’t find much online when I looked for guidance. I’d very much welcome any suggestions to make this more comprehensive and will add them to a future edits of this post.

For a bit of a background this deployment involved installing new HP Servers and  deploying VMWare ESXi. Hence the test sections relating to those. There was very minimal NetScaler Access Gateway reconfiguration to reference the new StoreFront servers.

System Testing

HPE iLO and Hardware Status

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/HPE/001 From a PC connected to the internal data network login via http://ESX01-ILO.DOMAIN.LOCAL. Confirm login to iLO interface succeeds.
UAT/HPE/002 From a PC connected to the internal data network login via http://ESX02-ILO.DOMAIN.LOCAL. Confirm login to iLO interface succeeds.
UAT/HPE/003 From a PC connected to the internal data network login via http://ESX03-ILO.DOMAIN.LOCAL. Confirm login to iLO interface succeeds.
UAT/HPE/004 From a PC connected to the internal data network login via http://ESX04-ILO.DOMAIN.LOCAL. Confirm login to iLO interface succeeds.
UAT/HPE/005 On ESX01-ILO.DOMAIN.LOCAL confirm System Health displayed as OK and no hardware or configuration issues are shown.
UAT/HPE/006 On ESX04-ILO.DOMAIN.LOCAL confirm System Health displayed as OK and no hardware or configuration issues are shown.
UAT/HPE/007 On ESX03-ILO.DOMAIN.LOCAL confirm System Health displayed as OK and no hardware or configuration issues are shown.
UAT/HPE/008 On ESX04-ILO.DOMAIN.LOCAL confirm System Health displayed as OK and no hardware or configuration issues are shown.
UAT/HPE/009 On ESX01-ILO.DOMAIN.LOCAL launch remote console and confirm connection to the server.
UAT/HPE/010 On ESX02-ILO.DOMAIN.LOCAL launch remote console and confirm connection to the server.
UAT/HPE/011 On ESX03-ILO.DOMAIN.LOCAL launch remote console and confirm connection to the server.
UAT/HPE/012 On ESX04-ILO.DOMAIN.LOCAL launch remote console and confirm connection to the server.

VMWare

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/ESX/001 From a PC connected to the internal network browse to https://esx01.domain.local and confirm successful logon.
UAT/ESX/002 From a PC connected to the internal network browse to https://esx02.domain.local and confirm successful logon.
UAT/ESX/003 From a PC connected to the internal network browse to https://esx03.domain.local and confirm successful logon.
UAT/ESX/004 From a PC connected to the internal network browse to https://esx04.domain.local and confirm successful logon.
UAT/ESX/005 Login to https://vcenter.domain.local and confirm ESX01, ESX02, ESX03 and ESX04 are all being managed by vcenter.
UAT/ESX/006 While connected to https://vcenter.domain.local confirm no alerts which would indicate hardware or configuration issues are shown on cluster “XenAPP”. Success
UAT/ESX/007 While connected to https://vcenter.domain.local confirm virtual machine start up settings are set as expected. Success

NetScaler

The NetScaler tests are focused on newly configured functionality only such as NetScaler Gateway and load balancing virtual servers.

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/NS/001 Login via http://citrix.company.org.uk
UAT/NS/002 Launch published desktop via http://citrix.company.org.uk
Standard Desktop
Staging Desktop
Finance Desktop
IT Desktop
UAT/NS/003 Log off http://citrix.company.org.uk
UAT/NS/004 Disconnecting network on STOREFRONT01 results in requests being directed to STOREFRONT02
UAT/NS/005 Disconnecting network on STOREFRONT02 results in requests being directed to STOREFRONT01
UAT/NS/006 Browser requests sent to http://citrix.company.org.uk are redirected to https://citrix.company.org.uk/Citrix/company/PNAgent/config.xml. This is to allow for redirection of HP Thin Clients which can’t be reconfigured. I would normally test a simple http to https redirection
UAT/NS/007 Login via https://myoffice.company.org.uk  (from an external network)
UAT/NS/008 Launch published desktop via https://myoffice.company.org.uk (from an external network)
Standard Desktop
Staging Desktop
Finance Desktop
IT Desktop
UAT/NS/009 Log off https://myoffice.company.org.uk (from an external network)
UAT/NS/010 Configure an iOS device for https://myoffice.company.org.uk and launch desktop.
UAT/NS/011 Configure Citrix Receiver for Windows for https://myoffice.company.org.uk and launch desktop.
UAT/NS/011 From vSphere web client confirm NetScaler01 and NetScaler02 have been moved over to the new XenApp cluster.

Storefront

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/SF/001 Published desktops and applications enumerated as expected following logon to https://citrix.company.org.uk    
UAT/SF/002 Login to Desktop Appliance site https://citrix.company.org.uk/Citrix/StoreDesktopAppliance    
UAT/SF/003 Desktop is auto launched upon login to https://citrix.company.org.uk/Citrix/StoreDesktopAppliance    
UAT/SF/004 Log off from https://citrix.company.org.uk/Citrix/StoreDesktopAppliance    
UAT/SF/005 Confirm successful launch of Application1    
UAT/SF/006 Confirm successful launch of Application2    
UAT/SF/007 Confirm successful launch of Application3    
UAT/SF/008 Confirm successful launch of Application4    

Desktop Delivery Controllers

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/DDC/001 Run Site configuration test in Citrix Studio and confirm no warnings or failed tests are identified.    
UAT/DDC/002 Run machine catalog test in Citrix Studio against each catalog (Standard Desktop, IT Desktop, Finance Desktop, Staging Desktop, Application delivery) and confirm no warnings or failed tests are identified.    
UAT/DDC/003 Run delivery group test in Citrix Studio against each delivery group (Standard Desktop, IT Desktop, Finance Desktop, Staging Desktop, Published Applications) and confirm no warnings or failed tests are identified.    
UAT/DDC/004 Sessions are distributed across session hosts.    
UAT/DDC/005 Correct license information is displayed for the farm in Citrix Studio (500 XenApp Enterprise concurrent licenses).    
UAT/DDC/006 Disconnecting network on CTXDEL01 results in requests being handled by CTXDEL02.    
UAT/DDC/007 Disconnecting network on CTXDEL01 results in requests being handled by CTXDEL02.    

Citrix License Server

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/LIC/001 XenApp Enterprise Licenses shown in License Administration Console.    
UAT/LIC/002 Users aren’t presented with any license related errors on logon.    
UAT/DC/003 Members of “Domain Admins” can successfully login to the License Administration Console. To be tested against Patrick’s logon.    

Terminal Services Licensing

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/RDS/001 Logon to lic01.domain.local, open RD Licensing manager and confirm Windows Server 2012 are present and license server activated.    
UAT/RDS/002 Logon to lic01.domain.local, open RD Licensing manager and confirm licenses are being issued by the server.    
UAT/RDS/003 Users aren’t presented with any license related errors on logon on to session host servers.    
UAT/RDS/004 Run gpresult on a session host and confirm License servers to use is set to LIC01.    

Citrix Director

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/DIR/001 Members of Domain Admins can login to Citrix director at http://ctxdir01.domain.local/director/  to be tested with Patrick’s account.    
UAT/DIR/002 All session hosts are visible to from Citrix Director.    
UAT/DIR/003 Confirm successful session shadowing.    

Local Host Cache

The Local Host Cache (LHC) feature allows connection brokering operations in a XenApp or XenDesktop Site to continue when site database outage occurs. To simulate an outage the SQL instance sql01\CITRIX will be stopped.

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/LHC/001 Verify a new connection can be made to the farm by launching published desktop.    

Client Testing

This section covers connectivity to the new Citrix XenApp 7.15 site from a variety of clients.

Internet Explorer Browser

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/IE/001 Login to https://citrix.company.org.uk. Confirm successful logon.    
UAT/IE/002 Confirm desktops/applications are listed as expected.    
UAT/IE/003 Launch publish desktop and confirm successful launch.    
UAT/IE/004 Log out from desktop without errors.    
UAT/IE/005 Log out from Storefront without errors.    

IGEL Thin Client

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/IG/001 Login to https://citrix.company.org.uk. Confirm successful logon.    
UAT/IG/002 Confirm desktops/applications are listed as expected.    
UAT/IG/003 Launch publish desktop and confirm successful launch.    
UAT/IG/004 Log out from desktop without errors.    
UAT/IG/005 Log out from Storefront without errors.    

HP Thin Client

Task ID Task Description Result (Success/Fail) Remedial Action Required / Notes
UAT/HP/001 Login to https://citrix.company.org.uk/Citrix/StoreDesktopAppliance. Confirm successful logon.    
UAT/HP/003 Confirm desktop is auto launched as expected.    
UAT/HP/004 Log out from desktop without errors.    
UAT/HP/005 Log out from Storefront without errors.    

User Testing

The client would normally define their testing criteria.

Overall Test Result PASS/FAIL
All tests have been carried out successfully.  
Test Plan results verified with  
Customer Contact Signature  
Date