Pools

Server allocation by tags

You can use tags in the EnginFrame VDI configuration of interactive services (Edit service -> Click on Launch -> Action Script) to control allocation of servers. Here are some examples:

vdi.launch.session --submitopts "tag:pool=’pool3’"
vdi.launch.session --submitopts "tag:gpu=’RTXA5000’ or tag:gpu=’RTXA6000’"
vdi.launch.session --submitopts "server:Hostname=’myhost1’ or server:Hostname=’myhost2’"
vdi.launch.session --submitopts "server:Host.CpuInfo.NumberOfCpus >= 4"

Tips:

  • The tag prefix must be “tag:”.
  • The server properties prefix must be “server”.
  • “()” are allowed to build “and” and “or” operations. For example:
    (tag:gpu='RTXA5000' or tag:gpu='RTXA6000') and (server:Host.Os.Family='windows' and server:Host.CpuInfo.NumberOfCpus >= 4)

The supported server properties are:

  • Id
  • Hostname
  • Version
  • SessionManagerAgentVersion
  • Host.Os.BuildNumber
  • Host.Os.Family
  • Host.Os.KernelVersion
  • Host.Os.Name
  • Host.Os.Version
  • Host.Memory.TotalBytes
  • Host.Memory.UsedBytes
  • Host.Swap.TotalBytes
  • Host.Swap.UsedBytes
  • Host.CpuLoadAverage.OneMinute
  • Host.CpuLoadAverage.FiveMinutes
  • Host.CpuLoadAverage.FifteenMinutes
  • Host.CpuInfo.Architecture
  • Host.CpuInfo.ModelName
  • Host.CpuInfo.NumberOfCpus
  • Host.CpuInfo.PhysicalCoresPerCpu
  • Host.CpuInfo.Vendor

If you want to use with DCV SM cluster, please acho check this guide.

Pool allocation by user or group

You can execute specific sessions for users or users groups. As the Action Script (from services) is actually a bash script, you can customize the launch sessions using tags, server properties, user and group.

Here is an example of Action Script for a VDI service:

#!/bin/bash

# The EF_USER variable contain the username of the current EnginFrame session (the username used to login in the current session)
# if you logged as "francisco" in EnginFrame, the EF_USER will have "francisco"in the variable.

# Get the user's groups
user_groups=$(id -Gn "$EF_USER")

# if one of the groups of the current logged user is poweruser
if echo $user_groups | grep -iq "poweruser"
then
  vdi.launch.session  --submitopts "server:Host.Os.Family='windows' and server:Host.CpuInfo.NumberOfCpus >= 24"
  exit 0
fi

# if one of the groups of the current logged user is 3ddev
if echo $user_groups | grep -iq "3ddev"
then
  vdi.launch.session  --submitopts "(server:Host.Os.Family='windows' and server:Host.CpuInfo.NumberOfCpus >= 24) and (tag:gpu='RTXA5000' or tag:gpu='RTXA6000')"
  exit 0
fi

# if two of the groups of the current logged user is 3d and architect
# the first grep will return true if have 3d, and the second will return true if have architect. Then, as "true and true" is true (truth table), the condition will match
if echo "$user_groups" | grep -iq "3d" && echo "$user_groups" | grep -iq "architect"
then
  vdi.launch.session  --submitopts "(server:Host.Os.Family='windows' and server:Host.CpuInfo.NumberOfCpus >= 48) and (tag:gpu='RTXA5000' or tag:gpu='RTXA6000')"
  exit 0
fi

# we recommend to have a fallback option, if the user does not match with any previous condition
vdi.launch.session  --submitopts "tag:gpu='nogpu' and (server:Host.CpuInfo.NumberOfCpus >= 4 and server:Host.Os.Family='windows')"

Note: If you do not put exit 0 inside of the if, then multiple vdi.launch.session will be executed. You need to take care of that.