Configure Blueprint Orchestration
Sandbox environment automation and enhanced orchestration is available with CloudShell Premium Tier.
This section explains how to configure the blueprint (orchestration) commands that will run on the sandbox and should be used when working on a blueprint that is not based on the default CloudShell Sandbox Template, which provides common setup, teardown, save, and restore orchestration commands. For resource automation, see Managing Scripts.
In this article:
Add blueprint scripts
You can add Python scripts that contain orchestration commands. However, the blueprint scripts first need to be added to CloudShell - see Adding scripts.
To add blueprint scripts:
- From the Blueprint menu, select Properties.
- In the Scripts area, click Add Scripts.
-
Select the scripts you want to add and click Done.
The scripts are listed in the Scripts area.
-
To apply the changes, click Update.
The properties page closes and the diagram workspace is displayed.
Use scripts to set up and tear down blueprints
CloudShell provides CloudShell Sandbox Template, an out-of-the-box template, which includes common setup and teardown orchestration. If you have an existing blueprint or you created a new blueprint not based on the out-of-the-box template, you can add out-of-the-box orchestration to your blueprint in the blueprint properties page.
You can also create your own scripts that will setup and teardown a sandbox or customize the out-of-the-box scripts. For more information, see CloudShell Dev Guide's Getting Started with Orchestration Scripts.
Note: The Python Setup & Teardown driver is provided to automatically run setup and teardown scripts.
To add set up and teardown scripts to a blueprint:
- In the Manage dashboard, upload the orchestration script (as described above). (For more details about adding and editing scripts, see Managing Scripts.)
- In the Edit Script dialog box for the required script, set the Script Type to be Setup or Teardown.
- In the blueprint's properties page, select a driver if needed.
- Click Add Scripts.
- Select the required Setup or Teardown scripts and save it to the blueprint.
Add Setup and Teardown scripts
Add a blueprint driver only if you are not using the out-of-the-box CloudShell Sandbox Template and want to add setup and teardown scripts. If you want to add automation to your blueprint, other than setup and teardown, you should add the Python scripts directly, without a driver.
The default driver included in the out-of-the box CloudShell Sandbox Template is used for sandbox setup and teardown and for sandbox save and restore and it applies to the four out-of-the-box scripts.
To add Setup and Teardown scripts to the blueprint:
- From the Blueprint menu, select Properties.
-
(Optional) Select the appropriate Driver. By default, no driver is needed to run the default orchestration scripts.
The default driver included in the out-of-the box CloudShell Sandbox Template is used for running sandbox orchestration scripts setup, teardown, save and restore.
-
If you're using Setup and Teardown scripts in the blueprint, define their durations:
- In the Estimated setup duration section, use the Up/Down arrows to define the setup duration.
-
In the Estimated teardown duration section, use the Up/Down arrows to define the teardown duration.
Notes:- Setting either of these values to a duration of '0' hours and minutes will disable the Setup and Teardown script's execution.
- The Setup phase is included in the sendbox's duration while Teardown is scheduled to start when the sandbox duration ends.
- The estimated Setup duration will allow the Setup process to run as long as it needs to.
- If the Teardown process takes longer than the estimated duration, it will be cancelled in both regular and Job Scheduling sandboxes. This is the designed behavior in order to ensure that any sandboxes scheduled ahead will start on time. The Teardown duration defined in the blueprint should be longer so it will allow the Teardown script to complete in time.
-
To apply the changes, click Update.
The properties page closes and the diagram workspace is displayed.
Add save and restore orchestration scripts
The CloudShell Sandbox Template is provided out-of-the-box and includes save and restore orchestration. If you have a new or existing blueprint that is not based on the out-of-the-box template, you can add out-of-the-box orchestration to your blueprint in the blueprint's Properties page. For additional customizations related to the Save and Restore add-on, see Save Sandbox Configurations
Developers can also customize the out-of-the-box Save and Restore scripts that save and restore sandboxes. For more information, see the CloudShell Dev Guide's Getting Started with Orchestration Scripts.
To add save and restore orchestration scripts:
- From the Blueprint menu, select Properties.
- (Optional) Select the appropriate Driver. By default, no driver is needed to run the default orchestration scripts.
- In the Save Sandbox area, make sure the Enable Sandbox Save check box is enabled.
- In the Scripts area, click Add Scripts.
-
Select the Save and Restore scripts you want to add and click Done.
The scripts are listed in the Scripts area.
-
To apply the changes, click Update.
The properties page closes and the diagram workspace is displayed.