In the Advanced options section, attach the cloned disk.
Create the VM.
Verify that the server is running for this VM. The startup script ensures that the VM is running.
Stop and remove connector-service in docker.
Remove the home directory and any other file which is not required for running the server. The same disk will be used for creating the VM image and will be accessible by customers later. This VM must only have libraries required for running the service.
Edit the VM and select the deletion rule to Keep disk
Delete this VM.
For creating the licensed image, get the license from the producer portal. Visit Producer portal.
Create a new Virtual Machine product. Visit the Deployment Package section and copy the VM license.
To create the licensed VM image, run the following command:
For connectors, create a module with a VM. Enter the project name, VM image name and labels for the image in your public project.
Use n2d-standard-2 as the default machine type with min CPU as 2 and RAM as 8 Gb. N2d-standard is optimal for medium traffic web servers. The default VM can be set with 2 cores. If customers expect higher traffic, this can be changed during the VM creation from the Marketplace. For information about pricing for different machine types, see VM instance pricing.
machineType:
# Check http://cloud.google.com/compute/docs/machine-types for all available typesdefaultMachineType:
gceMachineType:n2d-standard-2
# Minimum CPU and memory constraints for the machine type to run your solution properlyminimum:
cpu:2ramGb:8
Use pd-standard as the default disk type.
bootDisk:
diskType:
defaultType:pd-standard
Add the startup script to the autogen config. Stringify the startup script and add it in bashScriptContent.
gceStartupScript:
bashScriptContent:
Define the input fields which will be taken as input from customers during VM creation.
deployInput:
sections:
# The place int he Deployment Manager config that this section will appear. More details in deployment_package_autogen_spec.proto-placement:CUSTOM_TOP
name:CONNECTOR_SETTINGS
title:Connectorssettings
description:Connectorssettings
tooltip:SettingwithwhichconnectorVMwillberunning
# List of input fields that this section hasfields:
-required:falsename:TEST_DATA
title:TestData
description:Testdata
tooltip:randomdatafortesting
string_box:{}-required:falsename:PORT
title:Porttorunservice
tooltip:Porttorunconnectorservice
string_box:{}-required:falsename:LOG_LEVEL
title:Loglevel
description:Loglevelforthewebservice.AllowedvaluesareDEBUG,INFO,WARNING,ERROR.DefaultisINFO
string_box:{}
Keep the placement as CUSTOM_TOP and name as CONNECTOR_SETTINGS.
Define the field, and the type of input required for them. In this example, the Test Data and Port to run service fields appear for the customers of the Marketplace connector.
Define the Compute Engine metadata items. While defining the VM metadata. Map the name of the input field to the metadata key.
Add the steps details which will be shown to customers post deployment.
postDeploy:
# List of suggested action items for users, after deployment is successfulactionItems:
-heading:CreatethePrivateserviceattachment
description:NowtheconnectorserviceisrunningontheVM,pleasecreatethePSCserviceattachmenttocreatetheconnection.Followhttps://cloud.google.com/integration-connectors/docs/configure-pscforthedetailedguide.
-heading:Createtheconnection
description:Aftercreatingtheconnectorsendpointattachment,usetheendpointattachmenttocreateaconnectiontothepartnerconnector.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThis document outlines the process of creating a licensed virtual machine (VM) image and a corresponding Terraform deployment module for use on the Marketplace.\u003c/p\u003e\n"],["\u003cp\u003eA cloned disk and VM are created as a development environment, which are then cleaned and configured to create a licensed VM image that customers can use.\u003c/p\u003e\n"],["\u003cp\u003eThe Autogen tool, along with its configuration files, is used to define the VM's deployment properties, including machine type, disk type, startup scripts, and input fields for customer customization.\u003c/p\u003e\n"],["\u003cp\u003eThe configuration includes defining metadata, input fields for customer use during VM creation, and post-deployment instructions, along with the steps to run the Autogen tool to generate a Terraform module.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides a command line instruction on how to create the cloned disk and VM, as well as the necessary commands for the Autogen tool.\u003c/p\u003e\n"]]],[],null,["# Create a Terraform deployment module for the VM\n\nSee the [supported connectors](/integration-connectors/docs/connector-reference-overview) for Application Integration.\n\nCreate a Terraform deployment module for the VM\n===============================================\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to create a virtual machine (VM) and Terraform deployment module for the VM.\n\n### Create the licensed VM Image\n\n1. To ensure that the development VM is non impacted, create a copy of the disk used in the VM by running the following gcloud command: \n\n ```bash\n gcloud compute disks create CLONE_DISK \\ --description=\"cloned disk\" \\ --source-disk=projects/PROJECT/zones/ZONE/disks/SOURCE_VM_DISK\n ```\n2. Create the clone of the VM. For information, see [Create a VM similar to an existing VM](https://cloud.google.com/compute/docs/instances/create-vm-from-similar-instance).\n3. In the **Advanced options** section, attach the cloned disk.\n4. Create the VM.\n5. Verify that the server is running for this VM. The startup script ensures that the VM is running.\n6. Stop and remove connector-service in docker.\n7. Remove the home directory and any other file which is not required for running the server. The same disk will be used for creating the VM image and will be accessible by customers later. This VM must only have libraries required for running the service.\n8. Edit the VM and select the deletion rule to **Keep disk**\n9. Delete this VM.\n10. For creating the licensed image, get the license from the producer portal. Visit [Producer portal](https://console.cloud.google.com/producer-portal?project=). **Note:** If you can't access Producer Portal, verify that you've selected the correct project. If you still can't access it, use the [Partner Support Desk](https://g.co/cloud/psd-partner) to request assistance, and include the word \"Marketplace\" in your description. For more information about Partner Support Desk, visit [Request assistance with Application Integration](/marketplace/docs/partners/get-support).\n11. Create a new Virtual Machine product. Visit the **Deployment Package** section and copy the VM license.\n12. To create the licensed VM image, run the following command: \n\n```bash\ngcloud compute images create VM_IMAGE_NAME \\\n --project PUBLIC_PROJECT_NAME \\\n --source-disk projects/DEV_PROJECT_NAME/zones/ZONE/disks/SOURCE_VM_DISK \\\n --licenses LICENSE \\\n --description VM_IMAGE_DESCRIPTION\n```\n13. For more information, see [Building your VM](https://cloud.google.com/marketplace/docs/partners/vm/build-vm-image).\n\n### Create a terraform deployment module\n\n\nMarketplace provides the [Autogen tool](https://github.com/GoogleCloudPlatform/marketplace-autogen) to generate the terraform modules for the deployment of VM image on Marketplace.\n\n\nThis tool uses [Autogen proto definition](https://github.com/GoogleCloudPlatform/marketplace-autogen/blob/master/java/com/google/cloud/deploymentmanager/autogen/autogen.proto) to generate the deployment. For more information, see [Example config](https://github.com/GoogleCloudPlatform/marketplace-autogen/blob/master/example-config/solution.yaml).\n\n1. Add the details of your solution: \n\n```bash\nsolutionInfo:\n name: \n packagedSoftwareGroups:\n - type: SOFTWARE_GROUP_OS\n components:\n - name: Ubuntu\n version: 16.04 LTS\n - components:\n - name: Apache\n version: 2.4.23\n```\n2. For connectors, create a module with a VM. Enter the project name, VM image name and [labels](/marketplace/docs/partners/vm/partner-consumption-tracking) for the image in your public project.\n3. Use n2d-standard-2 as the default machine type with min CPU as 2 and RAM as 8 Gb. N2d-standard is optimal for medium traffic web servers. The default VM can be set with 2 cores. If customers expect higher traffic, this can be changed during the VM creation from the Marketplace. For information about pricing for different machine types, see [VM instance pricing](https://cloud.google.com/compute/vm-instance-pricing#vm-instance-pricing). \n\n ```bash\n machineType:\n # Check http://cloud.google.com/compute/docs/machine-types for all available types\n defaultMachineType:\n gceMachineType: n2d-standard-2\n # Minimum CPU and memory constraints for the machine type to run your solution properly\n minimum:\n cpu: 2\n ramGb: 8\n ```\n4. Use **pd-standard** as the default disk type. \n\n ```bash\n bootDisk:\n diskType:\n defaultType: pd-standard\n ```\n5. Add the startup script to the autogen config. Stringify the startup script and add it in bashScriptContent. \n\n ```bash\n gceStartupScript:\n bashScriptContent: \n ```\n6. Define the input fields which will be taken as input from customers during VM creation. \n\n ```bash\n deployInput:\n sections:\n # The place int he Deployment Manager config that this section will appear. More details in deployment_package_autogen_spec.proto\n - placement: CUSTOM_TOP\n name: CONNECTOR_SETTINGS\n title: Connectors settings\n description: Connectors settings\n tooltip: Setting with which connector VM will be running\n # List of input fields that this section has\n fields:\n - required: false\n name: TEST_DATA\n title: Test Data\n description: Test data\n tooltip: random data for testing\n string_box: {}\n - required: false\n name: PORT\n title: Port to run service\n tooltip: Port to run connector service\n string_box: {}\n - required: false\n name: LOG_LEVEL\n title: Log level\n description: Log level for the web service. Allowed values are DEBUG, INFO, WARNING, ERROR. Default is INFO\n string_box: {}\n ```\n\n\n Keep the placement as **CUSTOM_TOP** and name as **CONNECTOR_SETTINGS**.\n\n\n Define the field, and the type of input required for them. In this example, the **Test Data** and **Port to run service** fields appear for the customers of the Marketplace connector.\n7. Define the Compute Engine metadata items. While defining the VM metadata. Map the name of the input field to the metadata key. \n\n ```bash\n gce_metadata_items:\n - key: CONNECTOR_ENV_PORT\n value_from_deploy_input_field: PORT\n - key: CONNECTOR_ENV_TEST_DATA\n value_from_deploy_input_field: TEST_DATA\n - key: CONNECTOR_ENV_LOG_LEVEL\n value_from_deploy_input_field: LOG_LEVEL\n ```\n8. Add the steps details which will be shown to customers post deployment. \n\n ```bash\n postDeploy:\n # List of suggested action items for users, after deployment is successful\n actionItems:\n - heading: Create the Private service attachment\n description: Now the connector service is running on the VM, please create the PSC service attachment to create the connection. Follow https://cloud.google.com/integration-connectors/docs/configure-psc for the detailed guide.\n - heading: Create the connection\n description: After creating the connectors endpoint attachment, use the endpoint attachment to create a connection to the partner connector.\n ```\n9. To setup the autogen, run the following command: \n\n ```bash\n alias autogen='docker run \\\n --rm \\\n --workdir /mounted \\\n --mount type=bind,source=\"$(pwd)\",target=/mounted \\\n --user $(id -u):$(id -g) \\\n gcr.io/cloud-Marketplace-tools/dm/autogen'\n\n autogen --help\n ```\n10. To generate the terraform module, run the following command: \n\n ```bash\n mkdir solution_folder\n\n autogen \\\n --input_type YAML \\\n --single_input example-config/solution.yaml \\\n --output_type PACKAGE \\\n --output solution_folder\n ```\n\n\n The solution_folder contains the terraform module. This module will be used while publishing products on Marketplace.\n\nWhat's next\n-----------\n\n- Learn how to [submit the VM image for approval](/integration-connectors/docs/marketplace/submit-vm)."]]