Create Linux VM Customised with Cloud-Init

June 18, 2020

by Chris Rasmussen

Intended Audience Level: Beginner/Intro

Code Sample Type: Snippet

Nutanix Technologies: Prism Central

Minimum Product Version: 5.15

Script/Code Language: JSON Payload

REST API Sample? Yes

REST API Version: v3

JSON payload to create a detailed AHV VM that is then configured with Cloud-Init. All important VM parameters are specified, including base64-encoded Cloud-Init YAML spec.

Code Sample Details

Note this section may be empty, if additional code sample details are not available.

Request Parameters

The below parameters should be used with the sample payload.

Please note you will need to alter {{placeholder}} values to match your environment, e.g. subnet name and UUID, cluster name and UUID.

Request URL:


Request method:



The AHV image matching “{{cloud_init_image_uuid_pc}}” must have the Cloud-Init package installed before the Lin ux VM can be created from it.

Recommended Reading

Before using this code sample, it is strongly recommended to read the article titled “Nutanix API v3 – Creating a Linux VM with Cloud-Init“. It contains some detail about Cloud-Init and why it may be used.


					"disk_address": {
						"device_index": 0,
						"adapter_type": "SCSI"
				"data_source_reference": {
					"kind": "image",
					"uuid": "{{cloud_init_image_uuid_pc}}"
			"guest_customization": {
				"cloud_init": {
					"user_data": "I2Nsb3VkLWNvbmZpZwp1c2VyczoKICAtIG5hbWU6IG51dGFuaXgKICAgIHNzaC1hdXRob3JpemVkLWtleXM6CiAgICAgIC0gc3NoLXJzYSBLRVkKICAgIHN1ZG86IFsnQUxMPShBTEwpIE5PUEFTU1dEOkFMTCddCiAgICBncm91cHM6IHN1ZG8KICAgIHNoZWxsOiAvYmluL2Jhc2gKCnBhY2thZ2VzOgogIC0gaHR0cGQ="
				"is_overridable": false

Nutanix CALM DSL LAB 1.0


Have you wanted to learn the Nutanix Calm DSL, but haven't been sure where to start?
Check out the Nutanix Calm DSL Lab 1.0 now!