Testing Session management logic (both allocation and deallocation) for Non-Persistent Virtual Desktop Infrastructure (VDI) desktop pool, especially with large user sets, is very critical for uncovering bottlenecks at the early stages. Otherwise, any failures might result in huge revenue losses for the customers in production.
Irrespective of whether the VDI desktops are hosted on-premise, Cloud or an end user client, we need to test if the desktop session that is logged off by a user is available for other users or not?
Innominds has deep experience in testing the VDI Infrastructure and DaaS solutions. This includes End-to-End testing along with infrastructure set up and benchmarking the performance of VDI.
Typical Problems and Challenges
- Testing of concurrent sessions by simulating users in a real-time Non-Persistent Pool environment and identify the bottlenecks with desired number of concurrent users.
- Testing of Non-Persistent Desktops allocation/deallocation with different users at a rapid pace including the order of allocation like FIFO.
In terms of efforts, resources and feasibility, testing the above mentioned objectives manually could be a tedious task. An automation solution will not only help in achieving the above objectives quickly but also assist in accelerating the regression testing.
Solution
While there are few tools that are commercially available to perform this activity, implementation of a custom solution will help to reduce the complexity and keep the testing focused on the requirement.
To achieve the same, a launcher machine with Jmeter needs to be put in place, which, in turn, will be used to generate parallel threads to launch user sessions and control the allocation and deallocation of desktops in real-time.
Create VDI Template with Power Shell ‘PS-Remoting’
This will be done by enabling PS-Remoting using Power Shell script on the template. As we automate this process with no manual intervention to log off the connected user sessions, the desktops should allow the users to enter the logged-in sessions remotely using script to log off. If this feature is not enabled on the template, we have to ensure that PS-Remoting is enabled on every desktop in an alternative way.
Launcher Machine Set up
Launcher Machine is the machine from where JMeter script is executed and Non-Persistent desktops are launched from pool. Based on the availability of infrastructure and the number of VDI Desktops to be tested, one can decide on the number of launcher machines to be used for the testing. A client set up on launcher machine is required to simulate the remote login sessions. For example, I have used wfreerdp client to perform this action.
Design your own custom script to perform the following
- Create a JMeter script to concurrently launch multiple VDI Desktop sessions from a pool or with a random wait time based on your requirement.
This can be achieved in multiple ways, for example
(i) Based on the client that is used to launch desktops, write the command to launch the desktops from pool as bean shell code in JMeter as below. Runtime.getRuntime().exec(loginCommand);
(or)
(ii) Create a batch file upfront that launches desktops from the pool and call it from JMeter script Runtime.getRuntime().exec("C:/Windows/System32/cmd.exe /c loginScript.bat") - Verify the number of logged in user sessions along with the user details to confirm the above logins.
- After successful validation of the logged in sessions, create a Power Shell script at runtime from JMeter to logoff the logged in sessions based on the number of sessions to be logged off.
Make sure to ensure the following while creating Power Shell script to logoff the logged in user sessions:
(i) Enter in to logged in desktop as an admin
(ii) Get the session ID of each of the connected session
(iii) Logoff the session using above session ID
(iv) Exit the PSSessionFind the sample snippet for reference:
$MyDomain=’TestDomain’
$MyClearTextUsername=’TestAdmin’
$MyClearTextPassword=’password’
$MyUsernameDomain=$MyDomain+’\’+$MyClearTextUsername
$SecurePassword=Convertto-SecureString –String $MyClearTextPassword –AsPlainText –force
$MyCredentials=New-object System.Management.Automation.PSCredential $MyUsernameDomain, $SecurePassword
Enter-PSSession -ComputerName Desktop01 -Credential $MyCredentials quser /server:Desktop01
$sessionId1 = ((quser /server: Desktop01 | Where-Object { $_ -match 'TestUser1' }) -split ' +')[2]
logoff $sessionId1 /server: Desktop01
Exit-PSSession
- Run the above created Power Shell script from JMeter using ‘OS Process Sampler’ and ensure the sessions are logged off.
- The above mentioned launching and logoff sessions can be repeated multiple times or for specific duration based on the testing requirements.
This solution can assist in not only accelerating the VDI infrastructure testing to identify any bottlenecks with concurrent VDI sessions but also to test the session management effectively with minimal effort and resources.
Innominds is a dedicated product incubator for technology industry clients seeking help with Design, Technology and Quality Engineering solutions across all stages of their product life cycle. We have deep expertise in Quality Engineering with extensive experience in setting up dedicated and secured Offshore Development / Test Centers with replicated client environments for technology companies and Enterprises, ensuring Quality @ Speed.
Interested! For any demos or POCs, please write to us at marketing@innominds.com and know more about our offerings.