User guide
Synergy doesn't need extra tools to create VMs into the private or shared quota but they are created in the standard OpenStack way (i.e. shell and dashboard). For example:
# openstack server create <options>By default, the VMs are instantiated into the private quota. To select the shared quota, is needed to place special keys in the local user data file and pass it through the--user-data <user-data-file> parameter at instance creation:
# cat mydata.txt
quota=shared
# openstack server create --image ubuntu-cloudimage --flavor 1 --user-data mydata.txt VM_INSTANCEAnother way to select the shared quota is using Openstack --property parameter during instance creation:
# openstack server create --image ubuntu-cloudimage --flavor 1 --property quota=shared VM_INSTANCERunning automated tasks before VM termination
A virtual machine instantiated into the shared quota is deleted by Synergy when its time to live (TTL) is expired. A mechanism, based on TTL expiration, that allows you to execute automated tasks (i.e. exporting data, turning off services) in your instance before Synergy deletes it is provided through the following example.
This mechanism can be used with version greater or equal of:
Synergy version: service 1.5.3, scheduler 2.6.0
Operating Systems: CentOS 7, Ubuntu 14.04
OpenStack versions: Ocata, Newton
Example
Before you begin make sure you could access to the Internet from your virtual machine.
Creating personal script
Define in an executable bash script any actions you want to perform before your VM is deleted from the shared quota. Of course, script commands must be executable by the O.S. that will be installed on the virtual machine.
In this example my_script.sh simply mounts a volume and creates the synergy_test_result.txt file where it will be printed execution date and time of my_script.sh file.
Creating the wrapper script
This bash script creates the user data that will be used during VM contextualization phase (contextualisation phase configure a VM after it has been installed).
Create an executable bash script that contains the same content of generate_userdata.sh script.
Generating user data file
To generate user data file run the following command:
Specify how many minutes before TTL expiration your script will run (my_script.sh). The default value is 5 minutes.
Enter user data file name.
If everything is fine a .txt file (my_userdata.txt) in the current directory is created.
Creating a volume
To create the volume that will be mounted by the script my_script.sh run the following commands:
Creating Virtual Machine
To create a VM into the shared quota follow the paragraph "How to use Synergy".
Attaching a volume
Verify operation
Access to your virtual machine and check the log.txt file in the new directory /root/synergy_scripts. It should has a content like this:
In the example the user script (my_script.sh) was executed 5 minutes before the TTL expired and into the file /mnt/volume/synergy_test_result.txt was printed:
Last updated