---
sourceDocument: Australia IT Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/it-operations-management

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Example: Post-provision cloud script

# Example: Post-provision cloud script {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 30. Juni 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

This example shows a cloud script that runs after a user provisions a virtual
machine.

## Vorbereitungen

* Role required: cloud_admin
* OS resource profile that is mapped to an image template. The user provisions a resource using the profile. You must add [basic authentication
  credentials](https://www.servicenow.com/docs/access?context=r_BasicAuthCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US) to the image.
* Compute resource profile that is mapped to a hardware type.
{#create-cloud-init-script-example__ul_qkh_4cn_sz}

## Warum und wann dieser Vorgang ausgeführt wird

In this example, you create a cloud init script, customize a resource block, and provision a VM from the Cloud User Portal.

## Prozedur

1. Create a cloud script template and a cloud script that refers to the template.
2. Open the virtual server resource block, and then follow these steps:
   1. Set the Draft/Published switch to Draft.  
      ![Virtual Server]()
   2. On the Operations tab, select Virtual Server Interface from the Interface list.  
   3. In the Operation field, verify that these operations exist:  
      * Block Until Ready
      * Execute Script: This operation tells the blueprint to run a script.
      {#create-cloud-init-script-example__ul_ix1_2kn_sz}

      ![Block Until Ready]()

      ![Execute Script operation]()
   4. Click the Input Parameters tab to view the inputs for each operation.
   5. On the Steps tab, add steps as needed.
   6. For the Script parameter on each step, clear the Script check box and change the expression in the Mapping column to the following text: `$(CloudScript.scripts.scriptname)`, where `scriptname` is the name of the script, not the script template, that you created earlier.  
3. Publish the virtual server resource block, and use it in a blueprint that in turn is published to a catalog item.
4. Launch a new stack to provision a VM and specify the OS profile and Compute profile that you created as a prerequisite.

## Ergebnisse

The Stack Status page runs through the CreateNode, BlockUntilReady, and ExecuteShellScript operations. The last operation kicked off the script you created.

