login vsi company logo login vsi company logo 250x40
header-02.jpg
  • Home
  • Blog
  • Login VSI
  • Scheduling automatic Login VSI performance tests for your virtualized desktop environment

Scheduling automatic Login VSI performance tests for your virtualized desktop environment

Scheduling automatic Login VSI performance tests for your virtualized desktop environment

Wouldn’t it be great to exactly know the maximum capacity of your virtualized desktop environment on a week-to-week basis? Recently a customer asked us if it is possible to schedule a Login VSI load test to automatically start running during the weekends. One of the reasons for this was that the company wanted to have a performance overview of the environment every Monday morning. Although we do not recommend simulating thousands of virtual users in your live production environment, it is not only possible to schedule tests but doing so can save you time while you regularly gauge performance.

In this example, I will configure Login VSI to run every Sunday at 4:00 a.m. I’m going to do this by using a PowerShell script. This script makes sure that all the launchers are running the launcher agent and will start the test by using the LoginVSICMD tool.

First we are going to create a configuration profile for the scheduled test.

  • Open the Management Console.
  • Configure Login VSI just as you would normally do.
  • Click on Save Profile when everything is set.
  • Enter a name for this configuration profile.

scheduling automatic login vsi performance tests for your virtualized desktop environment save profile

Now we are going to create the PowerShell script for the task scheduler.

  • Create a text file with the following code:
<#
This script will:
A. Makes sure the Session Monitor is running.
B. Connect to every launcher machine (by PSremoting) and logs off every user. Then logs on with the Launcher-v4 user account
    to make sure the launcher agent is running.
C. Start the actual test. 
Usage
1. Edit the variables under "Set variables".
2. Search for this part below and enter your launcher host names.
   
    # Launcher Workflow
    $launchers = @("Launcher01","Launcher02","Launcher03")
3. Search for this line below and adjust the fileserver and domain name. \\fileserver\VSIshare\_VSI_Binaries\Connectors\RDPConnect.exe /server $launcher /user domain\Launcher-v4 /password MySecretPassword /nowarning /display 1024x768. 4. Logon to your VSI fileserver to enable client-side CredSSP to allow user credential delegation to all computers in the domain run the command: Enable-WSManCredSSP -Role client -DelegateComputer * 5. Logon to your launchers to enable the server to accept delegated credentials: Enable-PSRemoting -Force Enable-WSManCredSSP -Role Server -Force 6. Reboot both the launcher and VSI fileserver. 7. Create a Scheduled task to run this script at you prefered interval. #> # Set variables $testname = Get-Date -Format yyyy-MM-dd-HHmm $profilename = "Weekly Sunday 4AM" $vsi_share = "\\fileserver\VSIshare" # Checking if Session Monitor is running. $ProcessActive = Get-Process SessionMonitor -ErrorAction SilentlyContinue if($ProcessActive -eq $null) { # Starting the Session Monitor. Write-host "Starting the Session Monitor." $SessionMointor = Join-Path -ChildPath \_VSI_Binaries\Launcher\SessionMonitor.exe -Path $vsi_share Invoke-Expression -Command $SessionMointor } else { # Session Monitor is already running. Write-host "Session Monitor is already running." } # Start Launcher Workflow $launchers = @("Launcher01","Launcher02","Launcher03") foreach ($launcher in $launchers) { # Connect to the launcher with PowerShell Enter-PSSession -ComputerName $launcher # Log off all logged on users. try { query user /server:$launcher 2>&1 | select -skip 1 | foreach { logoff ($_ -split "\s+")[-6] /server:$launcher } } catch {} Start-Sleep -s 2 # Close the connection to the Launcher. Exit-PSSession # Start a new RDP connection to trigger the launcher logon script. \\fileserver\VSIshare\_VSI_Binaries\Connectors\RDPConnect.exe /server $launcher /user domain\Launcher-v4 /password MySecretPassword /nowarning /display 1024x768 } # End Launcher Workflow # Starting the Login VSI test. \\DC01\VSIshare\_VSI_ManagementConsole\LoginVSICMD.exe -testname $testname -profile $profilename
  • Edit the variables under Set variables.
  • Add the launcher host names to match your setup.
  • Save the file as LoginVSIscheduledStart.ps1.
  • Log on to the VSI file server.
  • Start an elevated PowerShell console.
  • Enable client-side CredSSP to allow user credential delegation to all computers in the domain. This is because we connect to the launcher machine to logoff any logged on users.
Enable-WSManCredSSP -Role client -DelegateComputer *
  • Reboot the VSI file server.
  • Logon to every launcher machine.
  • Start an elevated PowerShell console.
  • Enable the server to accept delegated credentials:
Enable-PSRemoting –Force
Enable-WSManCredSSP -Role Server –Force
  • Reboot the Launcher machines.
  • Logon to the VSI file server.
  • Open the Task Scheduler
  • Create a new task. In this example I’ll call mine Login VSI weekly – Sunday 4am.
  • You can choose run whether user is logged or not. If you are going to test run the task in this case it runs in the background. To check if it is working it might be easier to set it to Run only when user is logged on.
  • Create a new trigger for this task.

scheduling automatic login vsi performance tests for your virtualized desktop environment new trigger

  • Then create an action. The argument is pointing to the PowerShell script you saved in a previous step.

scheduling automatic login vsi performance tests for your virtualized desktop environment edit action

  • Hit OK and manually kick off the task to see if everything works!

Conclusion

As you can see, it’s pretty straightforward to automatically schedule a Login VSI test with this Powershell script. Just configure it once and you’re good to go. Enjoy your weekend while Login VSI is automatically simulating thousands of virtual users for you. To your VSImax!

About the author

Jordi Volkers (@jordivolkers) joined the Login VSI team in 2015 as a Support Engineer. He is a real techie guy and loves to automate IT as much as possible to make life easier for our customers. Among his colleagues he is well known for his sense of humor. In his spare time he enjoys to watch TV shows and movies.


Tags: How-to, Login VSI, Load Testing, Support, Scripts

Start Delivering the Best End User Experience Today

Request a Demo

Login VSI, Inc.

3945 Freedom Circle
Suite 670
Santa Clara, CA 95054

Phone: +1 408 899 7418

300 Tradecenter
Suite 3460
Woburn, MA 01801

Phone: +1 408 899 7418

Login VSI B.V.

De Entree 85
1101 BH Amsterdam
The Netherlands

Phone: +31 20 705 1200