The recipe is the plugin mechanism used for adding new functionalities to the OnApp cloud. Each recipe is a set of instructions that triggers events at certain stages during the execution of certain services/event in the cloud. Essentially, recipes allow inputing code into virtual servers, appliances or the Control Panel server. This enables administrators to use recipes for configuring the server or report on it, thus providing advanced customization options in a standard environment.
Recipes run over SSH, and all commands triggered can run on virtual servers, appliances or the Control Panel server.
SSH connection is not required for running recipes on VMware virtual servers.
OnApp CP does not update the status of the recipe if it takes longer than 1 hour to complete the transaction. As a result, cPanel will complete the installation, but the task will be displayed as still running. This issue will be fixed in next releases.
Currently it is not possible to execute recipes using cPanel/CloudLinux template with the /tmp mounted as noexec.
Recipes allow admins to perform the following operations:
- Perform post script installation.
- Use post provision installation scripts for third party applications, agents, etc.
- Disk reclaiming.
- Update/modify virtual servers and Compute zones with script injection.
- Allow host to spin up custom virtual servers without requiring custom templates.
- Download, run and report audit tools.
Use of recipes brings cloud administrators more control over their cloud environment and allows them to self-maintain such tasks as custom template creation, etc.
You can use recipes for Unix (Linux and FreeBSD) and Windows virtual servers, smart servers, baremetal servers, virtual server templates, Compute zones and the control panel server. For details, refer to the relevant sections of the Admin guide:
- Template Recipes
- Virtual Server Recipes
- VMware Virtual Server Recipes
- Smart Server Recipes
- Baremetal Server Recipes
- Compute Zone Recipes
- Control Panel Recipes
To be able to use recipes in the cloud, you must enable recipe permissions first.
The recipes run when the appropriate events are triggered on the Compute resources, virtual servers or CP server. Depending on the object where the event occurs, the recipe runs on Compute resource/VS/CP and contains the variables for that object. When the recipe execution on Compute resource is triggered by the event happening on virtual server, then the recipe also contains the variables for the virtual server object. The same relates to CP server.
Here is the list of variables that you can define in recipes:
Compute resource variables
- IP_ADDRESS - Compute resource IP address
- VIRTUALIZATION - Compute resource virtuaization type; Xen, KVM or VMware
- SERVER_TYPE - server type: virtual, smart or baremetal
Virtual Server variables
- VM_IDENTIFIER - virtual server identifier
- IP_ADDRESS - virtual server IP address
- HOSTNAME - hostname of a virtual server
- ROOT_PASSWORD - server root password
- OPERATING_SYSTEM - virtual server operating system
- OPERATING_SYSTEM_DISTRO - virtual server OS distribution
- OPERATING_SYSTEM_ARCH - architecture of the operating system
- OPERATING_SYSTEM_EDITION - edition of the OS
All recipes have access to these variables:
- CP_ADDRESS - control panel server IP address
- RESPONSE_FROM_PREVIOUS - response from the previous recipe step