Jump to content
Welcome to our new Citrix community!
  • 0

VDAs being 'powered off' instead of restarted by reboot schedule


Chris Gundry

Question

Hi

 

Wondering if anyone has seen this?

 

We have a schedule set to reboot a catalog of around 25 Windows Server VDAs at 3-4am. Most of the VDAs get a 'Guest shutdown' and then a 'Power on' command in vSphere and everything is good. Every now and again a random VDA will get a 'Guest shutdown' and then a 'Power off' command instead, then will never get a 'Power on' command and will as a result remain off.

 

I have found this post by Dennis https://discussions.citrix.com/topic/362739-75-reboot-schedule-server-sometimes-remains-powered-off/page/2/

I am just curious if anyone has had this issue and has any further information before I test out his suggestion of removing both schedules and re-creating a v2 one only. I am hesitant to create a v2 one only because if I do then as Denis says it does not appear in the GUI, which is how most of our admins would view and configure the reboot schedule. So if I removed the GUI schedule they would think there was no schedule and likely set a new one via the GUI at some point, probably re-creating or making this issue worse...

 

ps. I have logged a case with support, but they are being beyond useless with it!

 

Thanks!

 

Link to comment

9 answers to this question

Recommended Posts

  • 1
On 11/29/2021 at 9:53 PM, Jeremy Hanson said:

Yes we have had this, I would definitely recommend you check out these timeouts if you have not done so already 

 

https://support.citrix.com/article/CTX237058 

 

Thanks for that link, I am not sure how that didn't show up in my searches, or why support have not shared it! That looks very likely to be helpful. Will report back!

  • Like 1
Link to comment
  • 0

hi,

 

We are using a script that we start every morning at 5 AM to start all VM's that failed the reboot.

 

Below is the script which runs on our delivery controller:

 

Asnp Citrix.* -ErrorAction SilentlyContinue
$logpath = "c:\scripts\logging.txt"

$loggingArray = Get-BrokerMachine
$serverArray = Get-BrokerMachine -InMaintenanceMode $False -PowerState Off


$date = get-date
Add-Content $logpath "---------------------------------------"
Add-Content $logpath $date 
Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Machine States before script execution:"
Add-Content $logpath "---------------------------------------"

foreach ($log in $loggingarray) {
Add-Content $logpath "Machine: $($Log.MachineName) - Powerstate: $($Log.PowerState) - Maintenace: $($Log.InMaintenanceMode)"
}

Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Switching on machines if necesary"
Add-Content $logpath "---------------------------------------"
Foreach ($vm in $serverArray){
    $vmName = $vm.MachineName
    
    if ($vmName -like "*MNT*") {
       Add-Content $logpath "Skipping because of match MNT: $vmName"
    continue
    }
    New-BrokerHostingPowerAction -Action Resume -MachineName $vmName 
 
    Write-EventLog -LogName Application -Source "Citrix Broker Service" -EventId 182 -EntryType "Error" -Message "$vmName failed to start, the machine is now started through a script." 
    Add-Content $logpath "Machine Switched On: $($vmName)"
}

if ($serverArray) {Add-Content $logpath "---------------------------------------"}
 

Link to comment
  • 0
20 minutes ago, Sjoerd Van den Nieuwenhof said:

hi,

 

We are using a script that we start every morning at 5 AM to start all VM's that failed the reboot.

 

Below is the script which runs on our delivery controller:

 

Asnp Citrix.* -ErrorAction SilentlyContinue
$logpath = "c:\scripts\logging.txt"

$loggingArray = Get-BrokerMachine
$serverArray = Get-BrokerMachine -InMaintenanceMode $False -PowerState Off


$date = get-date
Add-Content $logpath "---------------------------------------"
Add-Content $logpath $date 
Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Machine States before script execution:"
Add-Content $logpath "---------------------------------------"

foreach ($log in $loggingarray) {
Add-Content $logpath "Machine: $($Log.MachineName) - Powerstate: $($Log.PowerState) - Maintenace: $($Log.InMaintenanceMode)"
}

Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Switching on machines if necesary"
Add-Content $logpath "---------------------------------------"
Foreach ($vm in $serverArray){
    $vmName = $vm.MachineName
    
    if ($vmName -like "*MNT*") {
       Add-Content $logpath "Skipping because of match MNT: $vmName"
    continue
    }
    New-BrokerHostingPowerAction -Action Resume -MachineName $vmName 
 
    Write-EventLog -LogName Application -Source "Citrix Broker Service" -EventId 182 -EntryType "Error" -Message "$vmName failed to start, the machine is now started through a script." 
    Add-Content $logpath "Machine Switched On: $($vmName)"
}

if ($serverArray) {Add-Content $logpath "---------------------------------------"}
 

Thank you, I actually saw your script already, it is handy. We actually already have a process to handle the identification of VDAs that are down and alert/handle the power up if required.

 

I am really looking for an answer as to why it is happening in the first place, rather than a workaround. If you have any info about why then it would be good to know? The post I linked seems promising and I will investigate further if I don't get anything useful back from support.

 

Thanks

Link to comment
  • 0

Thanks for this script, I tested it in our test env and it worked great for powering on Virtual Apps systems. In our prod env we also have VDI systems that are not all on each morning. Wondering if there is a way to define just Virtual App systems that will start up if they are off in the script? Thanks

Link to comment
  • 0
On 11/23/2021 at 7:56 AM, Chris Gundry said:

Thank you, I actually saw your script already, it is handy. We actually already have a process to handle the identification of VDAs that are down and alert/handle the power up if required.

 

I am really looking for an answer as to why it is happening in the first place, rather than a workaround. If you have any info about why then it would be good to know? The post I linked seems promising and I will investigate further if I don't get anything useful back from support.

 

Thanks

 

On 11/23/2021 at 7:33 AM, Sjoerd Van den Nieuwenhof said:

hi,

 

We are using a script that we start every morning at 5 AM to start all VM's that failed the reboot.

 

Below is the script which runs on our delivery controller:

 

Asnp Citrix.* -ErrorAction SilentlyContinue
$logpath = "c:\scripts\logging.txt"

$loggingArray = Get-BrokerMachine
$serverArray = Get-BrokerMachine -InMaintenanceMode $False -PowerState Off


$date = get-date
Add-Content $logpath "---------------------------------------"
Add-Content $logpath $date 
Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Machine States before script execution:"
Add-Content $logpath "---------------------------------------"

foreach ($log in $loggingarray) {
Add-Content $logpath "Machine: $($Log.MachineName) - Powerstate: $($Log.PowerState) - Maintenace: $($Log.InMaintenanceMode)"
}

Add-Content $logpath "---------------------------------------"
Add-Content $logpath "Switching on machines if necesary"
Add-Content $logpath "---------------------------------------"
Foreach ($vm in $serverArray){
    $vmName = $vm.MachineName
    
    if ($vmName -like "*MNT*") {
       Add-Content $logpath "Skipping because of match MNT: $vmName"
    continue
    }
    New-BrokerHostingPowerAction -Action Resume -MachineName $vmName 
 
    Write-EventLog -LogName Application -Source "Citrix Broker Service" -EventId 182 -EntryType "Error" -Message "$vmName failed to start, the machine is now started through a script." 
    Add-Content $logpath "Machine Switched On: $($vmName)"
}

if ($serverArray) {Add-Content $logpath "---------------------------------------"}
 

Thanks for this script, I tested it in our test env and it worked great for powering on Virtual Apps systems. In our prod env we also have VDI systems that are not all on each morning. Wondering if there is a way to define just Virtual App systems that will start up if they are off in the script? Thanks

Link to comment
  • 0

I still have a case open with Citrix about this issue, but not getting anywhere fast...

 

But I did find that configuring the following registry entry resulted in the VDAs being started again, so no need for a script in our case:

Registry Path : HKLM\SOFTWARE\Citrix\DesktopServer\RebootSchedule
Name : ShutdownTimeoutRecovery  
Type : REG_DWORD
Data : 1

Link to comment
  • 0
12 minutes ago, Chris Gundry said:

I still have a case open with Citrix about this issue, but not getting anywhere fast...

 

But I did find that configuring the following registry entry resulted in the VDAs being started again, so no need for a script in our case:

Registry Path : HKLM\SOFTWARE\Citrix\DesktopServer\RebootSchedule
Name : ShutdownTimeoutRecovery  
Type : REG_DWORD
Data : 1

We have that key on all of our DDC's but we are still having random VDA's not start up when they are set for a scheduled restart. 

Link to comment
  • 0

I have an update on this case. Setting the registry key mentioned above meant that our VDAs did start up again after they randomly got the 'power off' after the 'guest shutdown'.

Citrix support were zero help and blamed VMware. VMware said it was nothing to do with them and were unable to help.

 

As part of unrelated work, we had planned to upgrade from 7.15 to 1912 CU5. After updating the infrastructure components to 1912 the issue remained. However, after updating the VDA image itself to 1912, the issue has resolved! We have not seen a VDA with 'power off' instruction for over 2 weeks now! So seems like it WAS a Citrix issue, but no idea why still and Citrix are basically saying that the issue is closed so we will close the case. Amazing support as usual!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...