Quantcast
Channel: XenApp/XenDesktop – JGSpiers.com
Viewing all articles
Browse latest Browse all 85

Create multiple VDA restart schedules in XenApp & XenDesktop 7.12

$
0
0

Since the introduction of FMA, VDA restart schedules in Citrix Studio have been very limited allowing for one schedule either once weekly or else daily at one specific time with the option to restart half the Delivery Group between two different times.

Now with XenApp and XenDesktop 7.12+ we can use PowerShell to create multiple restart schedules. This is great because it gives us back most of the flexibility we had with scheduled restarts of machines back in XenApp 6.5 using Worker Groups for example. You may not want to restart all VDA’s in a Delivery Group every night or once weekly, so we can turn to PowerShell to configure it how we want. Another new feature of 7.12 called tag restrictions allows you to splice up Delivery Groups so that only certain machines are restarted during different times.

To read up on power managing VDA’s including powering off VDA’s after log off etc. see http://www.jgspiers.com/xendesktop-xenapp-power-management/

To configure restart schedules we use the RebootScheduleV2 PowerShell cmdlets which are new with XenApp & XenDesktop 7.12.

To get started using a Delivery Controller launch PowerShell and add the Citrix PowerShell snapins using command asnp citrix.*The Citrix.Broker.Admin.V2 module contains all the cmdlets we need to configure scheduled restarts. The cmdlets with V2 on the end are the new cmdlets we will use to confiure flexible restarts. The original commands (which Studio reads) are Get-BrokerRebootCycle for example. If you create a reboot schedue within Studio it simply runs the non-V2 cmdlets in the background. For an example, I have created a simply daily reboot schedule using Citrix Studio. When you run the Get-BrokerRebootSchedule command the schedule job appears including the Delivery Group (DesktopGroupName), the frequency of reboots and scheduled start time etc.When you run the new cmdlet Get-BrokerRebootScheduleV2 notice my reboot schedule appears here aswell but there are some additional parameters that can be used such as RestrictToTag. For now I will delete the current reboot schedule so we can start fresh.As mentioned before to get granular with reboot schedules we can use tags. You assign tags to one or more VDA machines, and then create reboot schedules within PowerShell and link the schedules to your tags. Right-click a VDA and select Manage Tags. No tags have been created yet so click Create. Enter a name and description then click OK. Your tags could be department tags or anything else that makes it easy for you to understand and identify. Click Save. Now that we have one VDA using the HR tag, I can create a reboot schedule. The command I am using is New-BrokerRebootScheduleV2  -DesktopGroupUid 1 -Frequency Weekly -Name WeeklyRebootSchedule-HR -RestrictToTag HR -StartTime 01:00:00 -RebootDuration 0 -WarningDuration 15 -WarningMessage “Please log off as this machine will restart in 15 minutes”.

This means any VDA with a tag of HR (VDA1) will restart weekly on a Sunday at 1AM. A warning message will be given 15 minutes before restart. No further warning will be given.

Note: To find out the UID of a Delivery Group run command Get-BrokerDesktopGroup | fl name, uidI have added a new machine (VDA2) to the same Delivery Group. This time I will use a different tag so click Create. Enter a name and description. Click OK. Click Save. This machine (VDA2) will have a tag of IT. You can see VDA1 and VDA2 with different tags. I will now create a reboot schedule for the VDA’s carrying an IT tag. This reboot schedule is daily at 3AM. When you look in Studio, nothing shows under Restart Schedule becaue Studio cannot read the V2 cmdlets (xxx-BrokerRebootScheduleV2). And that is us done. Using command Get-BrokerRebootScheduleV2 both reboot schedules show. VDAs within the same Delivery Group will now have their own restart schedules. When a machine restarts (reboot schedule in progress) the Active parameter changes to True. The Citrix Broker Service reports a successful power action was achieved for VDA2 during it’s scheduled reboot. The GroupReboot for Delivery Group NewWS2012R2 has successfully completed. Notice how only one machine was processed even though there are two machines in the Delivery Group. That is the power of tagging and restart schedules. Another example use case could be a situation where you do not want to restart all Delivery Group VDA’s once per week, and once per day is too often. Maybe you would like to restart every Monday and Friday. This is possible by simply creating two reboot schedules, one for Monday and one for Friday as shown below. I have not used tagging so these schedules apply to all Delivery Group members.

 


Viewing all articles
Browse latest Browse all 85

Trending Articles