Recipes are a powerful tool in the Zumiv Cloud control panel which allow you to automate server tasks using step-by-step programmed actions.

 

In this article, we’ll show you how to use recipes with your Zumiv Cloud server.

Creating A Recipe

Go to your Control Panel > Cloud > Recipes menu. Click the “+” button to add a recipe:

Screen Shot 2020 10 30 at 2.09.00 PM

From there, fill in the recipe creation form:

Screen Shot 2020 10 30 at 2.10.03 PM

Label -give your recipe a label

Description – provide a short recipe description (optional)

Compatible with – choose if this recipe can be assigned to Unix or Windows virtual servers. For Windows compatible recipe, specify the script type. You can select the following script types:

BAT
VBS
PowerShell v1.0

Click Save.

After that, you’ll be redirected to the recipe details screen where you can add steps to this recipe.

See Also: Experience Our for Free VPS Hosting: Enjoy a 30-Day Trial with Risk-Free Servers

Create Recipe Steps

To create a new recipe step click the “+” button in the upper right corner of the Steps screen:

Screen Shot 2020 10 30 at 2.11.45 PM

In the pop-up window, specify step details as required:

Screen Shot 2020 10 30 at 2.11.53 PM

Script – input the recipe code.

Result source – specify the step result source:

Exit Code – an exit code, for example, 0 is the default value returned on success.

To use exit code in the VBS or PowerShell scripts, you have to specify it directly in the script. For example:

VBS
Script:
WScript.Echo “test”
WScript.Quit 95

PowerShell
Script:
get-date -displayhint date
exit 227

STDOUT – standard output.
STDERR – standard error
STDOUT and STDERR – standard output and standard error.

Move the Pass anything else slider to the right if you do not want to specify the pass output value. Otherwise, leave this slider disabled to set the pass values.

Pass values – specify the pass output value, for example, 0.

You cannot specify both pass and fail values for one recipe step. You can specify multiple recipe values. In this case, you have to specify each value from a new line.

On success – the recipe behavior on success:

Proceed – proceed to the next step.
Fail – terminate the recipe and mark it as failed.
Stop– terminate the recipe and mark it as successful.
Go to step – specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

In case you have already specified the recipe pass values, you will get the Fail anything else slider enabled automatically, as you cannot specify both pass and fail values for one recipe step. Move this slider to the left if you want to set fail values (Pass anything else slider will be enabled automatically).

Fail values – specify the pass output value.

On failure – the recipe behavior on failure

Proceed – proceed to the next step.
Fail – terminate the recipe and mark it as failed.
Stop- terminate the recipe and mark it as successful.
Go to step – specify the step to proceed to. If you specify the nonexistent step, the recipe will be stopped.

Press Save.

Running A Recipe

Go back to the recipes page and click the gear icon to run a script on a virtual server:

Screen Shot 2020 10 30 at 2.16.06 PM

See Also: Experience Our for Free VPS Hosting: Enjoy a 30-Day Trial with Risk-Free Servers

Example Recipe

Here is an example recipe. It runs on virtual servers for Apache server installation and default web page configuration.

It can be used for the following events:

  • VS provisioning (starts Apache server during the VS creation)
  • Network rebuild
  • Network interface added

Consists of 5 steps. Each step depends on the previous step result.

Step 1

#if echo $OPERATING_SYSTEM_DISTRO |grep rhel ; then
  if rpm -qa |grep httpd |grep -v grep ; then
    yum -y update httpd
  else
    yum -y install httpd
  fi
#else
 # exit 1
#fi

Result source: Exit code

Pass values: 0

On success: Proceed

Fail values: Fail anything else

On failure: Fail

Step 2

 echo "<p><a href=http://$CP_ADDRESS>OnApp Cloud</a></p>" > /var/www/html/index.html

Result source: Exit code

Pass values: 0

On success: Go to step 5

Fail values: Fail anything else

On failure: Go to step 4

Step 3

 service httpd restart

Result source: Exit code

Pass values: 0

On success: Stop

Fail values: Fail anything else

On failure: Fail

Step 4

echo "Can not write to file" > /var/log/recipes.log

Result source: Exit code

Pass values: 0

On success: Stop

Fail values: Fail anything else

On failure: Fail

Step 5

echo “<p><a href=http://$IP_ADDRESS>$HOSTNAME</a></p>” >> /var/www/html/index.html

Result source: Exit code

Pass values: 0

On success: Go to step 3

Fail values: Fail anything else

On failure: Go to step 4

Deleting A Recipe

Go back to the recipes page and click the gear icon to delete a recipe:

Screen Shot 2020 10 30 at 2.14.55 PM

Need help managing your cloud server?

Our support team is available 24 hours a day to assist you. Please contact us via ticket or live chat for support.

What are your feelings

COMPLETE DIGITAL SERVER SOLUTIONS FOR ALL

Bare Metal Dedicated Servers

A single tenant, physical server allowing you full access to its resources

Read More

Cloud VPS

The cheapest way to get your own independent computing instance.
Read More

Cloud VDS

Virtualized server platform hosted on enterprise-grade physical servers
Read More

10 Gbps Unmetered Servers

Zumiv offers high bandwidth dedicated servers up to 20Gbps.
Read More
free vps hosting

ZUMIV NEWSLETTER

Receive the latest news, updates and offers. You can unsubscribe at any time.

ZUMIV NEWSLETTER

Receive the latest news, updates and offers. You can unsubscribe at any time.

zumiv logo white final 1 1

Cloud VPS and Bare Metal Servers for Less

Registered Office:
124 City Road, London
EC1V 2NX, United Kingdom.
44-7-441-399-305
Support Hours: 24x7x365
Sale Office Hours: M-F, 7AM-5PM EST

We accept the following:

payment option

PRODUCTS

SERVICES

© 2023 Webcom Ltd. (DBA zumiv.com) Company,  CR: 14252964, ® All Rights Reserved

certifications

ZUMIV NEWSLETTER

Receive the latest news, and offers. You can unsubscribe at any time.

CALL US 44.7.441.399.305

  • PRODUCTS
  • LOCATIONS
  • SOLUTIONS
  • COMPANY