If you choose to support deployment with Deployment Manager for your VM product, you must complete the following steps.
Determine how to create your deployment package
We recommend that you use Producer Portal's guided configuration option to create your deployment package directly in the Google Cloud console.
The guided configuration supports simple VM products, such as single-VM
deployments with basic firewall rules, but it doesn't support some complex
features, such as deployments with multiple VMs and custom configuration
fields. If you need features that the guided configuration doesn't support,
you can use the
open source mpdev
tool
to either create your deployment package or to customize an existing package
by adding additional capabilities to it.
We don't recommend using custom deployment templates that you created without using Google Cloud console or the Deployment Manager Autogen tool with Cloud Marketplace. We recommend that you create your deployment package directly in Google Cloud console.
Switch between guided configuration and manual configuration
If you use Producer Portal's guided configuration option and later want to switch to manually configuring your deployment package, click Go to manual configuration.
When you switch, you can download the Autogen specification for the deployment package you created in the guided configuration, to use as a basis for your manual configuration.
Complete your guided configuration
To finish configuring and submit a simple deployment package using the Google Cloud console, complete the following steps:
In Producer Portal, go to the Deployment package section.
Under Deployment Manager configuration, next to the input field labeled Cloud Storage Bucket, click Browse.
If you've already created a Cloud Storage bucket, select it here.
If you don't have a Cloud Storage bucket, click the icon labeled Create new bucket. When you create a new bucket, you:
- Select a name for the bucket.
- Specify what region or regions the bucket stores data in.
- Specify the storage class for your data.
- Determine what level of granularity to apply to the Identity and Access Management (IAM) permissions for the bucket's data.
- Configure optional advanced settings, such as encryption or data retention policies.
Ensure that you enable Object Versioning for your Cloud Storage bucket.
To save your bucket settings and continue configuring your deployment package, click Configure.
Under Choose the machine type, you must specify a Default zone, Minimum machine type, and Default machine type for your VM product, along with the size and type of its boot disk.
Under Specify operating system, you must specify the name and version of the OS your VM image uses, as well as the version number of the VM image.
Optionally, under Set up VM access, you can specify site and administrator URLs, along with a username and password, that users can use to access the VM after deployment.
Optionally, under Configure networking, you can specify settings for IP forwarding and configure Firewall rules.
Optionally, under Define next steps, you can provide instructions for your product's users to guide them on getting started with your product. These instructions will be visible to them after they deploy your product.
After you complete the previous steps, click Generate to create your deployment package.
If you need to make additional changes to your deployment package later, you can click Edit to make changes, and then click Generate to regenerate your deployment package with those changes applied.
If you plan to switch to manual configuration, you can click Download to download the Autogen specification for the deployment package you created in the guided configuration, to use as a basis for your manual configuration.
Submit the deployment package for review in Producer Portal. After you submit the package, it might take up to two weeks for Google to review and approve the package.
Complete your manual configuration
This section explains how to use the mpdev
tool to create a deployment package
and submit the package for review.
The mpdev
tool uses Deployment Manager
Autogen
to generate the Deployment Manager templates for your deployment
package. The tool generates the deployment package based on an Autogen
specification that contains the configuration inputs for your VM product.
At a high level, to generate and submit your deployment package, you must do the following:
- Create and configure a Cloud Storage bucket to store and manage access to the deployment package.
- Create an Autogen specification that includes the image details and deployment requirements for your VM product.
- Generate the deployment package based on your Autogen specification, and upload the package to the Cloud Storage bucket.
- Submit the deployment package for review in Producer Portal. After you submit the package, it might take up to two weeks for Google to review and approve the package.
The following sections explain how to complete the steps to generate and submit your deployment package.
Before you begin
If you're using mpdev
to create your deployment package, complete the
following steps:
Install the
mpdev
tool by following the instructions in themarketplace-tools
repository.Download the Google Cloud SDK.
Create your Cloud Storage bucket
You must create the Cloud Storage bucket in the same public Google Cloud project that you use for Producer Portal and configure the bucket in the following ways:
- Enable Object Versioning for the bucket to protect your deployment package from being deleted or overwritten.
- Grant the Storage Object Viewer
(
roles/storage.objectViewer
) role tocloud-commerce-marketplace-onboarding@twosync-src.google.com
.
To create and configure a Cloud Storage bucket, run the following
gcloud storage
commands:
BUCKET_NAME=YOUR_BUCKET_NAME gcloud storage buckets create gs://$BUCKET_NAME gcloud storage buckets update gs://$BUCKET_NAME --versioning gcloud storage buckets add-iam-policy-binding gs://$BUCKET_NAME --member=group:cloud-commerce-marketplace-onboarding@twosync-src.google.com --role=roles/storage.objectViewer
Where YOUR_BUCKET_NAME
is the name you provide for
the new bucket, subject to naming requirements.
Create your Autogen specification
To create your Autogen specification, we recommend that you use the single
VM example
in the marketplace-tools
repository as your initial
Autogen specification, and then customize the specification with your VM's
configuration details.
For more complex use cases, you can set up autocomplete in some integrated
development environments (IDEs)
to help edit and validate configurations.yaml
files.
To create your Autogen specification from the single VM example
:
Check out the example's preconfigured Autogen specification into a local directory:
PACKAGE=YOUR_PACKAGE_NAME mpdev pkg get https://github.com/GoogleCloudPlatform/marketplace-tools.git/examples/deployment-manager/autogen/singlevm $PACKAGE
Where
YOUR_PACKAGE_NAME
is the name that you provide for the local directory. For example,my-deployment-package
.Update the specification with your VM's configuration details by modifying the
configurations.yaml
file with the following information:- The name of your VM image.
- The
ID
for the public Google Cloud project that hosts your VM image, which is the same project that you use for Producer Portal.
For steps to update the VM image and Google Cloud project fields in the
configurations.yaml
file, refer to thesingle VM example
'sREADME.md
file.If required for your product, customize additional fields, such as
passwords
,deployInput
, andpostDeploy
. These fields are located under theDeploymentSpec
in theconfigurations.yaml
file. To learn more about the fields available for customization, refer to the Autogen reference documentation).
Generate your deployment package
After you create and customize the Autogen specification, use the specification to generate the Deployment Manager template files for your deployment package. To store the package, upload the package to the Cloud Storage bucket.
To generate and upload your deployment package:
Set the output location for the deployment package to your Cloud Storage bucket:
mpdev cfg set zipPath gs://BUCKET_NAME/OBJECT
Where BUCKET_NAME is the name of the bucket that you created for the package and OBJECT is the name that you provide for the Cloud Storage object, subject to naming guidelines.
Generate the deployment package:
mpdev apply -f $PACKAGE/configurations.yaml
The generated deployment package is zipped and uploaded to your bucket.
To verify that you configured the template properly, create a deployment by running the following command:
TMPDIR=$(mktemp -d) unzip $PACKAGE/template.zip -d $TMPDIR gcloud deployment-manager deployments create $PACKAGE --config $TMPDIR/test_config.yaml
Submit your deployment package for review in Producer Portal
After you've created and configured your deployment package, you must submit the package to Producer Portal so that the Cloud Marketplace team can review and approve the package.
In Producer Portal, go to the Deployment package section.
Under Specify your Cloud Storage object location, select the deployment package object that you previously uploaded.
Click Validate. The validation process might take up to two hours to complete, and you can exit the screen while it is completing.
After Producer Portal has successfully read your deployment package, you can click Deployment preview to view how the customer sees your VM configuration.
After the validation completes successfully, to submit the deployment package for review, click Submit. After you submit the package, it might take up to two weeks for Google to review and approve the package.