Skip to main content

Marketplace Apps — CloudStack Requirements

This page covers what a CloudStack provider admin must prepare before Marketplace Apps can deploy successfully. If you are using OpenStack, see OpenStack — Image & Startup Requirements.

Common setup first

Complete the platform-neutral CMP configuration in Configure Marketplace Apps in CMP before returning here for CloudStack-specific template requirements.


How CMP delivers the startup script on CloudStack​

CMP uses CloudStack UserData to deliver the rendered startup script to the VM at first boot.

Admin defines Startup Script on CMP template (with {{VAR}} placeholders)
↓
Customer fills environment variables at Create Instance
↓
CMP substitutes customer values into the script
↓
CMP sends combined UserData to CloudStack deployVirtualMachine
↓
CloudStack delivers UserData to the VM
↓
Guest OS executes script at first boot (via startup script support)

For this to work, three conditions must be met:

  1. The CloudStack template has startup script / UserData support enabled.
  2. The network or VPC offering includes User Data.
  3. The CMP template has a startup script configured with the correct placeholders.

1. Prepare the CloudStack template​

Enable startup script / UserData support​

When registering or modifying the template in CloudStack, enable startup script / UserData support. Without this, CloudStack cannot inject the rendered Marketplace script into the VM at first boot — the VM deploys successfully but scripts never execute.

Marketplace deployments will silently fail without this

If the template does not support startup scripts, the Marketplace App appears to deploy, but no application configuration takes place inside the guest.

Full template preparation steps: Preparing CMP-Compatible Templates (CloudStack).

Password-enable the template​

CMP provisions Marketplace VMs using the template's password capability. The CloudStack template should be password-enabled so CMP can retrieve the VM password after deploy.

See Preparing CMP-Compatible Templates — Password support.

Root disk must be scalable​

The template's root disk must be scalable at deploy time — customers select storage packages that must be ≥ the template's virtual size.

Set Minimum Storage on the CMP template to prevent customers from selecting undersized packages. See Configuring Templates in CMP — Minimum resource requirements.


2. Ensure VPC / network offerings include User Data​

Marketplace Apps depend on UserData being deliverable through the network. The CloudStack VPC or network offering used by the VM must include User Data support.

User Data required in network offerings

If the network/VPC offering does not include User Data, Marketplace deploy appears to succeed — but the startup script is never delivered to the guest. The application is not configured.

See Virtual Router / VPC — User Data.


3. Configure the startup script on the CMP template​

Path: Settings → Orchestrator → Templates → edit template → Start up Script

Set Image Type to Market Place App​

Set Image Type to Market Place App, then select the Marketplace App and Version you created in CMP. This links the template to the app.

See Link templates.

Write the startup script with placeholders​

CMP lists Placeholder buttons for the Marketplace App's environment variables in the startup script editor. Click a placeholder to insert it.

Use {{VAR_NAME}} syntax in the script — lowercase matching the environment variable key. At deploy time, CMP substitutes the customer's entered value.

Example — allow a port configured by the customer:

#!/bin/bash
# Open the port the customer selected
ufw allow {{port}}

Example — configure a database with customer-supplied credentials:

#!/bin/bash
mysql -u root -e "CREATE DATABASE {{db_name}};"
mysql -u root -e "CREATE USER '{{db_user}}'@'localhost' IDENTIFIED BY '{{db_password}}';"
mysql -u root -e "GRANT ALL PRIVILEGES ON {{db_name}}.* TO '{{db_user}}'@'localhost';"
No environment variables?

If the Marketplace App has no environment variables (the script sets up everything from baked-in defaults or generates credentials inside the guest), the startup script still runs — just with no customer-supplied substitutions. Document where credentials are written on the guest in the per-app email content.


4. Script size limits​

CloudStack enforces a maximum UserData size via vm.userdata.max.length. CMP also validates the customer-entered portion via max_startup_script_size_in_bytes in Global Settings.

At deploy, CMP combines:

  • Administrator script (on the template)
  • Customer-entered script (if the customer provides one at Create Instance)

Both together must not exceed CloudStack's vm.userdata.max.length.

See Startup script size — CloudStack and CMP for full details and how to align the limits.


Checklist​

ItemWhere to configure
Template registered in CloudStack with startup script / UserData supportCloudStack
Template is password-enabled in CloudStackCloudStack
CMP template Image Type = Market Place App; app and version selectedSettings → Orchestrator → Templates
Startup script written with {{VAR}} placeholders matching environment variablesSettings → Orchestrator → Templates → Start up Script
VPC / network offering includes User DataCloudStack + Settings → Orchestrator → Packages
Script size within CMP and CloudStack limitsGlobal Settings + CloudStack

Was this page helpful?
Found something that could be improved?