sched_requirements and custom attributes

I’m having trouble getting sched_requirements to work with my custom attributes. what am I doing wrong here?

Here is the log entry form /var/log/one/sched.log:
Thu Apr 21 16:46:38 2016 [Z0][SCHED][D]: Match-making results for VM 241:
Cannot schedule VM. Error in SCHED_REQUIREMENTS: ‘CLUSTER_ID = 100 & !(PUBLIC_CLOUD = YES) & ( LOAD15 < MAX_CPU )’, error: syntax error, unexpected STRING, expecting INTEGER or FLOAT at line 1, columns 55:62

Thu Apr 21 16:46:38 2016 [Z0][SCHED][D]: Match-making results for VM 241:
Cannot schedule VM, there is no suitable host.

Here is my custom script that adds the LOAD-attributes:
#!/usr/bin/ruby
loadavg = File.read(’/proc/loadavg’)
loads = loadavg.scan(/\d+.\d+/)
onemin = loads[0].to_f
fivemin = loads[1].to_f
fifteenmin = loads[2].to_f
printf(“LOAD1=%d\nLOAD5=%d\nLOAD15=%d\n”, (onemin100).to_i, (fivemin100).to_i, (fifteenmin*100).to_i)

Here is the host information:

onehost show 0 | head -n 60

HOST 0 INFORMATION
ID : 0
NAME : node01
CLUSTER : dc01
STATE : MONITORED
IM_MAD : kvm
VM_MAD : kvm
VN_MAD : ovswitch
LAST MONITORING TIME : 04/21 16:45:27

HOST SHARES
TOTAL MEM : 251.8G
USED MEM (REAL) : 7.8G
USED MEM (ALLOCATED) : 512M
TOTAL CPU : 4800
USED CPU (REAL) : 0
USED CPU (ALLOCATED) : 100
RUNNING VMS : 1

MONITORING INFORMATION
ARCH="x86_64"
CPUSPEED="1489"
HOSTNAME="node01"
HYPERVISOR="kvm"
IM_MAD="kvm"
LOAD1="4"
LOAD15="36"
LOAD5="25"
MODELNAME="Intel® Xeon® CPU E5-2680 v3 @ 2.50GHz"
NETRX="1199403926447"
NETTX="1243839796855"
NUM_NODES=“3"
RESERVED_CPU=”“
RESERVED_MEM=”"
VERSION="4.14.2"
VM_MAD="kvm"
VN_MAD=“ovswitch”

Here is my template:

onetemplate show 16

TEMPLATE 16 INFORMATION
ID : 16
NAME : ubuntu14_tmpl
USER : oneadmin
GROUP : DEVOPS
REGISTER TIME : 04/14 13:18:13

PERMISSIONS
OWNER : um-
GROUP : um-
OTHER : —

TEMPLATE CONTENTS
CONTEXT=[
CHEF_BOOTSTRAP=“true”,
DHCP=“true”,
NETWORK=“YES”,
SET_HOSTNAME="$NAME",
SSH_PUBLIC_KEY="$USER[SSH_PUBLIC_KEY]" ]
CPU=“1"
DISK=[
IMAGE=“os_ubuntu_v1.0-copy”,
IMAGE_UNAME=“oneadmin” ]
GRAPHICS=[
LISTEN=“0.0.0.0”,
TYPE=“SPICE” ]
HYPERVISOR=“kvm"
MEMORY=“512"
NIC_DEFAULT=[
MODEL=“virtio” ]
OS=[
BOOT=“cdrom,hd” ]
RAW=[
DATA=””,
TYPE=“kvm” ]
SCHED_RANK=”- RUNNING_VMS"
SCHED_REQUIREMENTS=“LOAD15 < MAX_CPU”

oh, i figured out that I can’t use math in the requirements… so I moved it to a script on each host and then just eval the string… SCHED_REQ… = MY_VAR = 1