Map a script to an OS profile

task australia Updated Nov 6, 2026 1 min read map-script-to-os-profile.md
Raw file servicenow.com

To execute scripted actions during VM provisioning, you can map a script to an OS profile. The script runs on VMs that are created based on the image template in the OS profile.

Before you begin

Role required: sn_cmp.cloud_admin

You must have a cloud account with datacenters. You must run Discovery on the service accounts to populate the datacenters.

About this task

In this procedure, you specify an existing script. See Create cloud initialization script templates and a script.

Note: Profile mappings that specify more details run first. For example, a mapping that specifies a blueprint, OS profile, and resource alias takes precedence over a mapping that specifies only an OS profile.

Procedure

  1. In the Cloud Admin Portal, navigate to Manage > Resource Profiles.

  2. In the Profiles list, select OS Profile and then open the profile.

  3. On the Cloud Script OS Profile Mappings related list, click New and then fill in the form.

Field

Description

Blueprint[Optional]

Select a blueprint to limit the script to a specific resource block used in the blueprint.

Cloud script

Select a cloud script to map the OS profile to.

Active

Select the check box if the cloud script should be run after the virtual machine is provisioned.

Application

Cloud Provisioning and Governance is auto-selected.

OS profile

If you specify a blueprint, the cloud script is run when the blueprint is provisioned.

Resource Alias[Optional]

If you specify a resource alias for the blueprint, then the cloud script is executed when the blueprint with the specified resource alias is provisioned.

4. Right-click the form header and select **Save**.
The **Name** attribute `[scriptName]` appears in the OS Profile Mapping Overrides list.
  1. In the OS Profile Mapping Overrides list, enter an attribute name and value to use when the resource is provisioned.

Related topics

Create an OS profile

Search documentation
Search document titles and file paths on the australia branch