blog.sachathomet.ch

Application virtualization, IoT and Cloud Computing, Blog of Sacha Thomet

Welcome to the Jungle … of the Citrix Display Modes

When I started to work with Remote Desktop stuff back in 2001 there was one thing definitely not possible, watch a video over a remote connection – not even with Citrix … in the last years a lot of things changed and Citrix improved their protocols and Video codecs from version to version. Today you can do awesome things over a remote connection with Citrix. There are many blogs and articles which shows what’s possible, also for GPU mapping 3D stuff and so on … this blog doesn’t describe how you can get the awesome 3D things out from your VDI. It’s more what if you don’t have special requirements for 3D, you don’t have time to test all possibilities, no time to tune, but you want have the best result according to the Pareto principle.

What do you configure? Nothing? Just default, because default is the setting which will fit for most Users?

 

Are you aware that default setting on XenApp/XenDesktop until VDA  7.9 was Thinwire with H.264 and since VDA 7.9 it’s Thinwire Plus (Compatibility Encoder)?
You need to consider this fact before you upgrade from 7.x to 7.9! Why they changed that? Is Thinwire Plus better? No! Is Thinwire H.264 better? No!
It’s just different! What are the differences? What I need to choose? It depends! But on what?

This blog post is mainly a comparison between Thinwire Plus and Thinwire H264 !

I’ve done a survey what is preferred for the codec on twitter, funny result 50% vs 50%:

Twitter-h264thinwire

I’ve started some tests, also with the Pareto principle, so no deep scientific background! I tested an internal video in our Intranet of 53 seconds and 1 minute of a YouTube video, Big Buck Bunny, with 25 fps,  set to 720p in YouTube. I had an eye on the user experience, means fragments, fluent movie, lip-sync and on the other side on the resource consumption like CPU and bandwidth.

(Advice if you like to do your own tests, Big Buck Bunny is nice to impress people but if you want test for lip-sync take an other movie … the Bunny doesn’t talk much …. )

 

RDAnalyzer14

For this tests I used the best, or the only one tool on the market to analyze remote display stuff, the Remote Desktop Analyzer from
Bram Wolfs and Barry Schiffer. In version 1.4 you can do some very helpful statistic reports:

 

I have tested with:

Virtual Desktop:

  • Windows 10, VDA 7.9, 2 vCPU, 4 GB Memory, virtualized on VMWare ESX.

Video Codecs:

  • Thinwire +
  • Thinwire with H264

Client:

  • Mac OSX
  • Windows 10
  • HDX Raspberry Pi

and thank you to René Bigler (Twitter @dready73 ) to test with those clients:

  • ChromeBook
  • Linux ThinClient (IGEL)

 

And this are our Results:

h264-twplus-Win10-corrected2

h264-twplus-OSX

h264-twplus-RaspberryPi

h264-twplus-iOS

h264-twplus-IGEL_IE h264-twplus-IE-ChromeOS

 

My personal conclusion:

If you have clients like ChromeBook or Windows who can manage H.264 this is your way to go. With limited H264 on the end device you run better with Tw+.

I work in a company which has internal only Windows 10 client devices but from external we have users with BYOD, and MacBooks are not a minority. For this reason I set a Citrix Policy which set all connection not coming over  Netscaler to Tw with H.264. So we have internal the best result and external still a good result over the average. What would be the best, is when it’s possible to set a Citrix Policy according to the Client OS which connects.

 

Recommended Links:

HDX Graphics Modes – Which Policies Apply to DCR/Thinwire/H.264 – An Overview for XenDesktop/XenApp 7.6 FP3: http://support.citrix.com/article/CTX202687

Citrix Display modes: How to configure, what to configure, when to configure: https://bramwolfs.com/2016/02/24/citrix-display-modes-how-to-configure-what-to-configure-when-to-configure

H.264 compression JUL 19 2013 A graphical deep dive into XenDesktop 7 https://bramwolfs.com/tag/h-264-compression

Update 23.9.2016:

An excelent blog post here: Citrix HDX Just Got Smarter…Again https://www.mycugc.org/blog/citrix-hdx-just-got-smarter…again?source=6 a post about selective H264 with XenApp / XenDesktop 7.11

Use Octoblu with Amazon Echo as trigger to start A/C on Tesla Model S

It need’s a bit courage as a non native english speaker and with my hard swiss accent it’s maybe awkward … but I’ve done it … my first webcast … you cannot win without a risk 🙂

Goal: Use Amazon echo to start the Air Condition of the Tesla Model S.

21.6.2016, Update to this post:

It’s not so difficult to use Alexa without IFTTT in Octoblu, I just created a flow to ask Alexa what’s the battery level and she tell me the remaining battery in percent:

Details about how to integrate Alexa in octoblu look at this:  Use Alexa to kick off automations with Octoblu

By the way: If you don’t have a Tesla but you like to buy one,use my referral Link http://ts.la/sacha3162 and safe 1000.- !

sachathomet goes GitHub

Last 11 days I was in Las Vegas on the CTP meetings, Citrix Synergy and at the E2EVC. I get known a few new people and a bunch of ideas, some about Citrix but also how to continue with my Scripts and the community. (Other blog post will follow, maybe here or on the myCUGC site)

It’s not easy to manage all my Scripts, versions, bugs and feature request so I followed the hint of some people at Synergy and decided to push my larger Scripts to GitHub.
You can see now all my Scripts in GitHub repositories under https://github.com/sacha81 – feel free to contribute!

Currently I have started with my two most popular Scripts:

Please be gentle to me if you are more experienced with GitHub than me, what is for sure if you work already more than 5 days with GitHub…. I’m really not the Software developer so I’m making baby steps with this repository thing. Hint’s are always appreciated.

Please use from now for feature-requests and bug reports the GitHub (issues) and no more the comment function in the blog.

https://github.com/sacha81

victim of a good reputation – Low free pooled XenDesktops

The Citrix Director is not so bad, and with Version 7.7 it is still better because now it’s possible to send email alerts. But one problem I still have … our provided pooled XenDesktop which are used for remote access with private computers are victim of a good reputation … this means a good word-of-mouth advertising in our company more and more people are tempted to use it … and we need to know when the number of free pooled desktop is low. And no I won’t go the read the numbers every day in director or Citrix Studio.

So I created a small script which send me an email as soon a defined threshold of free desktops is reached:

low-free-desktop

The code is on GitHub:

https://github.com/sacha81/Citrix-XD-Alert-low-free-desktops

Avoid blanks and dots in StoreFront 3.5 farm names!

Last day’s I upgraded my existing Storefront 3.01 to StoreFront 3.5 and in some farms I had a very bad issue after the upgrade, it seemed that all is ok but users are no more able to start any application or desktop.

On the StoreFront server I saw an Warning Event 28 from Citrix Store Service “ Failed to launch the resource “Farm Name.ApplicationName” as it was not found.

SF35_blanks_error-event28

The issue was that a blank and a dot (.) was in my Farmname, seems this is a bug in SF3.5 that you can configure that but It won’t work!

SF35_blanks_error-config

after I changed the display name to something like xa65farm without blank and point all works well.

An awesome thing happened … I’m now a CTP

2 day’s ago I received a very pleasant email:

“Hello Sacha,
Congratulations! You have been selected to receive the Citrix Technology Professional (CTP) award! We’re thrilled to welcome you to this elite family group of technology experts!”

I’ve done in the last months and years some stuff for the Citrix community with this blog, with the participation on Twitter, Citrix Forums, and other Social media channels and I’m leading together with Stefan Beckmann the Swiss Citrix User Group Community. Also I participated on the development of the 1Y1-401 exam and I won the GeekOvation award 2015. Seem’s my passion for Citrix and contribution on the community get honored.

What is the CTP award?

This program is the highest recognition what a Citrix Expert can get and definitely a milestone in my career.

ctpMore information about the CTP Program you can get here: https://www.citrix.com/community/ctp.html

More about the CTP 2016 class here:
https://www.citrix.com/blogs/2016/02/04/welcome-ctp-class-of-2016 

I’m very thankful to be chosen as a CTP and I’m sure that people surrounding me are jointly responsible for my success!

I want to say THANK YOU!

  • To my Family
  • To my coworkers and my employer Die Mobiliar (a swiss insurance company)
  • To Citrix, especially Perrine Crampton
  • To the CTPs I met last year at the Citrix Synergy on the GeekSpeak-Tonight with the GeekOvation Award, especially Aaron Parker who supported me on my Presentation, but also Carl Webster who supported me later with PoSh stuff and of course Jo Harder, GeekOvation MC (Mistress of Ceremonies), who crowned me 🙂
  • To my current and former coworkers who supported me always to keep my Citrix heart beating
  • To all other which supported me in my doing and I missed here  (Sorry!)

And I won’t forget to congratulate to the other new 2016 CTPs

CTP2016

What next? 

Now I’m really feel obligated to give even more back to the community, of course I will continue to contribute on forums, write more posts on this blog. But I’m pretty sure I will have the chance to hold one or two technical presentations … Good chance to improve my english language … :-S

Happy New Script – PVS 7.7 HealthCheck

We are close to the New Year 2016 and I want to wish you all the best for 2016!
I’m already happy now, because I can publish some hours after the PVS 7.7 release from Citrix this Script:

Today Citrix released XenApp/XenDesktop 7.7 and Citrix Provisioning Services 7.7. There are a bunch of new features, but for me the most important thing, beside of the Win10 support, is
….  drum roll ….
the new PVS PowerShell API. PoSh with PVS 7.6 and below was a pain …  To know what else is new in PVS look here: PVS 7.7 New in this release

Now PVS comes with a real PoSh interface which gave more back than a bundle of strings. I had the chance to play around with PVS 7.7 Tech Preview and so here you have already the PVS HealthCheck Script for Version 7.7 in a complete new developed version:

pvs77

If you have a feature request or a bug report please post it direct on GitHub.

This version doesn’t work with PVS 7.6 and below, if you have an older version than 7.7 take this script: Citrix PVS HealthCheck 

Update 11.04.2016: Performance-Improvement, Change the order of the table, all the VDI status now at the end.
Update 09.05.2016: Bugfix & Input from Jay, get CPU/Memory/Disk usage of PVS.
Update 27.05.2016: Now my Script is on GitHub
I’m an absolute GitHub newbie … for this reason I leave it still also here as a download until I’m really comfortable with GitHub.

The code is on GitHub:

https://github.com/sacha81/citrix-pvs-healthcheck

Control MyStrom smart plug by a trigger (ifttt or octoblu)

mystromSome weeks ago I bought my first smart plug from MyStrom. If you are living  in Switzerland you have only a limited choice of smart plugs because of the non EU standard plug (T13).

MyStrom is pretty cool because it mets almost all my requirement, there is a possibility to measure to power consumption within two rates (day and night), it’s controllable with the mobile phone app and there is a nice web interface.

But one thing I miss, I cannot react to triggers and power of the smart plug on a defined event. Like already in an earlier post mentioned there is a REST API which allows to control the plug from the internal network. (See Another LaMetric IoT script – power control)

Last day’s I just found the API documentation which allows to control the MyStrom out of the cloud:
https://mystrom.ch/mobile/ 

So I have now all to connect this Thing to the Internet and react on a trigger.

Possibility 1: The everything imaginable way,
MyStrom and Octoblu

mystromlogo      +      ocoblu

If you are using Octoblu beta, which is currently available for everyone for free you can create very intelligent workflows to control your smart plug. You can react to twitter and power of or on depending what is twittered, you can power off your heater as soon a temperature is reached, you can stop charge as soon your device have a defined state of charge.

The Things you connect use with Octoblu are nearly infinite.

mystrom-octoblu

Octoblu is for advanced use, and to be honest I’m also on the learning phase! I do not describe here more details for this case. There are a lot of sample blueprints on https://www.octoblu.com .  Octoblu was acquired by Citrix in 2015.

Possibility 2: The easy way,
MyStrom and IFTTT

 mystromlogo      +      iftttlogo

This way is suitable for “Home use” and for people who only want to create a simple workflow where a trigger initiate for example a Power On or Power Of of the smart plug.

All what you need is a Control-Script on a Webserver with PHP on the Internet, and a IFTTT account.

How it works: The script is very simple, it just handle the  authentication process on the API, read the AuthToken out of the JSON answer and Push out the payload with the AuthToken. IFTTT just take the trigger and call the script with the username, passwort and the payload which you can build from the API

Example: I want to control my smart plug by twitter, if I twitter #lightsoff

Step 1:

Take this script and put it on your webserver:

<!--?php 



/*
V0.1 by Sacha Thomet, www.appcloud.ch, 12-2015



This script can be used to control the MyStrom power outlet with IFTTT.
In IFTTT you need to take the MAKER component to make a web request.



The script must be called with 3 parameters:
- Your MyStrom username (email)
- Your MyStrom password
- the decided payload
 e.g. ../device/switch?on=true%id=64002D012305 to turn on your device with Mac 64002D012305



 Documentation of all API calls: https://mystrom.ch/mobile/
 Attention! You need to replace in your payload all "&" with a "%" !!



 Example:
 myStromAuthenticator.php?email=joe.doe@gmail.com&password=mysecreatword&payload=https://mystrom.ch/mobile/device/switch?on=true%id=64002D012305



*/



//create variables from parameter
$email = ($_GET["email"]);
$password = ($_GET["password"]);
$payload = ($_GET["payload"]);



//myStrom host with the parameters to gather the AuthToken
$host = "https://mystrom.ch/mobile/auth?email=$email&password=$password";
$filestring = file_get_contents($host); 



//format the AuthToken that only the token remain from the JSON Answer
$startpos = 0;
while($pos = strpos($filestring, "authToken", $startpos))
{
 $string = substr($filestring, $pos, strpos($filestring, "name", $pos + 1) - $pos); 



 //echo $string. " ";
 $newstring = str_replace("authToken","","$string");
 $newstring2 = str_replace('"',"",$newstring);
 $newstring3 = str_replace(":","","$newstring2");
 $authCode = str_replace(",","","$newstring3");



 echo " AuthCode is $authCode 
" ;



 $startpos = $pos + 1;
} 



// Because & cannot submitted in a $_GET we subsitute it with a %
$correctpayload = str_replace("%","&","$payload");



echo "Full payload is: $correctpayload&authToken=$authCode";



$fullpayload = "$correctpayload&authToken=$authCode";
$payloadString = file_get_contents($fullpayload); 



?-->

Step 2:

Create a recipe on IFTTT, use Twitter as Trigger and Maker as Action. In maker you create your request:

[yourwebserver]myStromAuthenticator.php?email=[youraccountemail]&password[yourpassword]&payload=[yourpayload]

e.g. the payload to turn of the device with Mac 64002D012325 is: https://mystrom.ch/mobile/device/switch?on=false%id=64002D012325

The result should be that:

mystrom-ifttt-572x1024

You create 2 of those recipies, one to Power On and one to Power Off

Now you can twitter you defined hashtags to control your smart plug.

Another LaMetric IoT script – power control

Because I have currently holiday here is another post which is not related to virtualization …

I combined my new “gadgets” the LaMetric time and my new wifi Smart-Plug from MyStrom. The goal was to report the current power consumption of power plug and the possibility to control the plug with the smart ticker.

MyStrom has a very straight forward API (https://mystrom.ch/en/mystrom-api), and the possibility to create apps for LaMetric is pretty easy what I’ve already mentioned in an past blog post.

All what is needed to implement this solution is:

  • a web server which can parse PHP
  • two small scripts
  • and a private app for LaMetric

This is the script to see the current power consumption:

{
    "frames": [
        {
            "index": 0,
            "text": " <!--?php //$host = "http://192.168.1.59/report"; //Call with parameter, e.g.: http://192.168.1.20/LaMetric/myStrom.php?host=192.168.1.59 $host = "http://" . $_GET["host"] . "/report"; $filestring = file_get_contents($host); $startpos = 0; while($pos = strpos($filestring, "\"power\"", $startpos)) { $string = substr($filestring, $pos, strpos($filestring, ",", $pos + 1) - $pos); //echo $string. " "; $newstring = str_replace("\"power\": ","","$string"); echo round($newstring, 2); $startpos = $pos + 1; } ?--> Watt",
            "icon": "i1692"
        }
    ]
}

I just read the content from the API, which is already in JSON format, but I reformat it that it is in that way which I need to bring it to the LaMetric.
This is the script to control the power outlet:

<!--?php $host = "http://" . $_GET["host"] . "/report"; $filestring = file_get_contents($host); $startpos = 0; while($pos = strpos($filestring, "relay", $startpos)) { $string = substr($filestring, $pos, strpos($filestring, "}", $pos + 1) - $pos); $newstring = str_replace("relay\": ","","$string"); //echo $newstring; $startpos = $pos + 1; } $newstring = str_replace(chr(13), "", $newstring); if ($newstring == "false ") { echo "Ist ausgeschaltet, wird nun eingeschaltet"; $URL = "http://" . $_GET["host"] . "/relay?state=1"; $data = file_get_contents($URL); } else { echo "Ist eingeschaltet, wird nun ausgeschaltet"; $URL = "http://" . $_GET["host"] . "/relay?state=0"; $data = file_get_contents($URL); } ?-->

And the LaMetric private app:

This simple poll app call the script on the webserver (192.168.1.20) with the parameter of the MyStrom plug (192.168.1.59).

On button action the controller script is launched with change the status (off to on or visa verse)

myStromApp-mini

(192.168.1.59 is the ip of my Power outlet. 192.168.1.20 is the address of my web server, this can be a raspberry pi or a Synology.)

Monitor you Profile directories

Since I had worked as a Citrix administrator the size of the profile directories was always a contemporary issue. It’s a fact that with new technologies like Citrix User Profile Manager the possibilities are grown and the life is easier with exclusion lists and profile streaming features. But it’s still a topic to consider if you are a Citrix admin or system engineer. I worked in former company with tools like TreeSize (https://www.jam-software.com/treesize/) or WinDir Stat (http://windirstat.info). But in some company they wont to spend money for tools which is only usable for one administrator or they don’t trust to OpenSource software (TreeSize).

I have the approach to solve every possible problem with on-board tools. So I created now a small script what give me the possibility to check my Profile directory with one recursive level so that I get each Size of a Profile within his subdirectories.:

#==============================================================================================
# Created on: 10.2015 Version: 0.3
# Created by: Sacha Thomet
# Filename: GetSubdirSizes.ps1
#
#
# Description: Collect Size of Dir's and Subsirs
#
# Prerequisite: None
#
# Call by : Manual
#
# Change Log:
# V0.1 first version
# V0.2 only 1 recursive subfolder
# V0.3 corrections of calculation
#
#==============================================================================================

$path = "\localhostC$tempprofiles"
$top = "4000"
$outputpath = "C:tempSubdirSize-Report.txt"

Function Get-FolderSize
{
 $Sizes = 0
 ForEach ($Item in (Get-ChildItem $Path))
 {
 If ($Item.PSIsContainer) {$Sizes = (Get-ChildItem $path"$Item" -recurse | Measure-Object -property length -sum).sum}
 Else {Write-Host "No Subfolder"}

 $SizeFormated = "{0:N2}" -f ($Sizes/1MB)
 New-Object PSObject -Property @{'Folder'=$Item;'Size'=$SizeFormated }
 }
}
$outfile = Get-FolderSize $path | sort -property Size –Descending |select -first $top
$outfile | out-file $outputpath
echo $outfile