Merged revisions 3049-3051,3053-3054,3058,3070,3074-3077,3082,3086-3088,3091-3092,3094-3095 from stable branch.
Added a example file for adding a VM with the remote API
VM module: Error in SQL query to select a template.