Synergy on Juno-Ubuntu1404
How to install synergy on the controller:
cd /root/FOR_SCHEDULER
scp blade-03-06.pn.pd.infn.it:/tmp/synergy.tar .
cp synergy.tar /usr/lib/python2.7/dist-packages/.
cd /usr/lib/python2.7/dist-packages/
tar xvf synergy.tar
cd synergy
apt-get install python-mysql.connector
apt-get install python-dateutil
useradd -r synergy
cp script/synergy.conf /etc/init/synergy.conf
chmod a+r /etc/init/synergy.conf
cp scripts/synergy-server /usr/bin/synergy-server
chmod 755 /usr/bin/synergy-server
mkdir -p /etc/synergy/
chown -R synergy:synergy /etc/synergy/
mkdir -p /var/log/synergy/
chown -R synergy:synergy /var/log/synergy/
mkdir -p /var/run/synergy/
chown -R synergy:synergy /var/run/synergy/
chmod 755 -R /etc/nova/
cp config/synergy.conf /etc/synergy/synergy.conf
chown -R synergy:synergy /etc/synergy/synergy.conf (to be customized)
source /root/admin-openrc.sh
keystone user-create –name synergy –tenant service –pass synergy +———-+———————————-+
Property | Value |
+———-+———————————-+
enabled | True |
id | a440033c786541e88d934e742ab9b726 |
name | synergy |
tenantId | 7a61af419ac543a4800eb52ac41d4d3c |
username | synergy |
+———-+———————————-+
keystone user-role-add –user synergy –tenant service –role admin
root@egi-cloud:/usr/lib/python2.7/dist-packages/synergy# keystone service-create –name synergy –type management +————-+———————————-+
Property | Value |
+————-+———————————-+
description | |
enabled | True |
id | 090b366a63e5464e85900fa89c9752cb |
name | synergy |
type | management |
+————-+———————————-+
keystone endpoint-create –service 090b366a63e5464e85900fa89c9752cb –publicurl http://192.168.114.10:8051 –adminurl http://192.168.114.10:8051 –internalurl http://192.168.114.10:8051 –region regionOne
root@egi-cloud:/usr/lib/python2.7/dist-packages/synergy# update-rc.d
—
mysql -u root -p <xxx> (password)
mysql> CREATE DATABASE synergy;
Query OK, 1 row affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON synergy.* TO 'synergy'@'localhost' IDENTIFIED BY 'synergy';
Query OK, 0 rows affected (0.11 sec)
mysql> GRANT ALL PRIVILEGES ON synergy.* TO 'synergy'@'%' IDENTIFIED BY 'synergy';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'synergy'@'localhost' IDENTIFIED BY 'synergy';
Query OK, 0 rows affected (0.11 sec)
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'synergy'@'%' IDENTIFIED BY 'synergy';
Query OK, 0 rows affected (0.00 sec)
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
—
in /etc/nova/nova.conf add to the [DEFAULT] section, if missing, the following parameters:
notify_on_state_change = vm_state
notification_driver = nova.openstack.common.notifier.rpc_notifier
notification_topics = notifications
cpu_allocation_ratio = x (to set)
ram_allocation_ratio = y (to set)
—
cd /root
wget http://www.webwareforpython.org/downloads/DBUtils/DBUtils-1.1.tar.gz
tar zxvf DBUtils-1.1.tar.gz
cd DBUtils-1.1/
python setup.py install
cd /usr/lib/python2.7/dist-packages/nova/cmd/
—
root@egi-cloud:/usr/lib/python2.7/dist-packages/nova/cmd# vi conductor.py
change:
#server = service.Service.create(binary='nova-conductor', # topic=CONF.conductor.topic, # manager=CONF.conductor.manager)
with
server = service.Service.create(binary='nova-conductor', topic=CONF.conductor.topic + "_synergy", manager=CONF.conductor.manager)
—
now all is ready for synergy configuration:
cd /etc/synergy/
root@egi-cloud:/etc/synergy/# vi synergy.conf
—
[DEFAULT]
rabbit_host=192.168.114.10
rabbit_port=5672
rabbit_hosts=192.168.114.10:5672
rabbit_use_ssl=False
#rabbit_userid=guest
rabbit_password=<yyy>
[WSGI]
host=192.168.114.10
[MYSQL]
host="192.168.114.10"
[FairShareManager]
type=manager
driver=synergy.managers.fairshare.FairShareManager
dependences=QueueManager, QuotaManager
scheduler_topic=scheduler
autostart=True
rate=300
num_of_periods=3
period_length=7
decay_weight=0.5
vcpus_weight=10000
memory_weight=7000
#fairshare tenants
projects=batch-short, batch-long
#share
shares=batch-short=40, batch-long=10
#the default value
default_project_share=10.0
default_runtinme_limit=10
#lifetime in minutes for the VMs
dynamic_quota=batch-short=2, batch-long=10
#extended_quota=batch-long
[Keystone]
admin_user=synergy
admin_password=synergy
admin_project_name=service
#auth_url=https://192.168.114.66:5000/v3
auth_url=https://egi-cloud.pd.infn.it:5000/v3
Create dynamic tenants:
keystone tenant-create –name batch-short –description "FairShare short queue Tenant"
keystone tenant-create –name batch-long –description "FairShare long queue Tenant"
Create related networks:
neutron net-create int-batch-short –router:external=False –provider:network_type gre –provider:segmentation_id 108 –tenant_id $(keystone tenant-list | grep batch-short | awk '{print $2}')
neutron net-create int-batch-long –router:external=False –provider:network_type gre –provider:segmentation_id 109 –tenant_id $(keystone tenant-list | grep batch-long | awk '{print $2}')
neutron subnet-create int-batch-short 10.0.8.0/24 –enable-dhcp –dns-nameserver 192.84.143.16 –allocation-pool start=10.0.8.2,end=10.0.8.254 –gateway=10.0.8.1 –name int-sub-batch-short –tenant_id $(keystone tenant-list | grep batch-short | awk '{print $2}')
neutron subnet-create int-batch-long 10.0.9.0/24 –enable-dhcp –dns-nameserver 192.84.143.16 –allocation-pool start=10.0.9.2,end=10.0.9.254 –gateway=10.0.9.1 –name int-sub-batch-long –tenant_id $(keystone tenant-list | grep batch-long | awk '{print $2}')
neutron router-interface-add ext-to-vos int-sub-batch-short
neutron router-interface-add ext-to-vos int-sub-batch-long
—
change the /usr/lib/python2.7/dist-packages/oslo/messaging/localcontext.py file:
cd /usr/lib/python2.7/dist-packages/oslo/messaging
vi localcontext.py
def clear_local_context():
"""Clear the request context for the current thread.""" if hasattr(_STORE, _KEY): ### <--- to add this line with the if delattr(_STORE, _KEY)
—
Start services:
service nova-conductor stop
service nova-scheduler stop
service nova-scheduler start
service nova-conductor start
service synergy start
—
It is possible to use a synergy shell to get info about quota and priority
cd /usr/lib/python2.7/dist-packages/synergy/common/client
python shell.py get_priority
python shell.py get_quota