How to access user provided custom data inside Nutanix VM | Nutanix Community
Skip to main content

Hi Team

I am trying to deploy a VM in my Nutanix cluster. I am invoking this API https://{PRISM_CENTRAL_IP}:9440/api/nutanix/v3/vms from my powershell script with the desired body. I am using a vmdk image for creating VM and my requirement is that once the VM will turned on it should start my application. In order to start the application I need some user provided custom data.

While creating the VM I am passing custom data as part of guest_customization section of the payload.  I want to access this information inside the VM while start up.

Please let me know how I can read the user provided custom data inside the VM. If I am passing the custom data in a wrong place, then let me know how to pass the custom data while creating VM.

I am curious to know if any solution is provided by Nutanix similar to AWS/GCP where we were invoking a specific endpoint (ex GCP - http://169.254.169.254/computeMetadata/v1/instance/attributes/user-data) to get the metadata.

Attaching the whole payload for reference.

"guest_customization": {

    "cloud_init": {

        "custom_key_values": {

            "custom_data1": "custom_value1"

        }

    }

}

Be the first to reply!

Reply