Automating the creation of virtual machines and storage accounts by using GCP
Before you begin
Make sure an administrator has configured the GCP connector.
Create VM element properties
A Create GCP VM element creates a virtual machine in GCP.
The following video (3:01) explains how to automate the task of creating a virtual machine in Google Cloud Platform:
The following table describes the Create GCP VM input properties:
Property | Description |
---|---|
Connection ID | The connection ID of the GCP connector. |
Project ID | The project ID of the Google Cloud project. |
Vm Name | The name of the virtual machine. The value must be between 1 and 63 characters and comply with the following guidelines:
|
Zone | The name of the zone in which you want to create the virtual machine. A zone is a subset of a geographical region. For more information about the regions and zones, see GCP regions and zones. |
(Optional) Create a VM by using an Image Publisher, an Instance Template, or a Custom Image | An image or a template that contains the virtual machine configuration settings. The following options are available:
Important: You can select one type of an image or a template to create a virtual machine. |
(Optional) Machine Configuration | A machine image of a Compute Engine resource that stores the For more information about the Compute Engine machine families, see Machine families resource and comparison guide. Important: This property is mandatory if you select Image Publisher or Custom Image to create a virtual machine. This property is optional if you select Instance Template to create a virtual machine. |
(Optional) Disk Type | The storage option for your virtual machine instance. For more information about the different disk type options, see Compute Engine disk types. |
(Optional) Disk Size | The size of the disk. If you do not specify a value, GCP uses the default value. The default value is calculated based on the selected project ID and source image. |
(Optional) Auto Delete | The option to configure the auto-delete behavior for disks attached to the Compute Engine virtual machines. |
(Optional) Device Disk Name | The option to provide a custom name for the disk. If you do not provide a name, GCP uses the default name. |
(Optional) Host Name | The option to specify a custom host name for the virtual machine. If you do not provide a name, GCP uses the default DNS name as the host name. |
(Optional) Public Ssh Key | The SSH key-pair used to connect to the virtual machine instance. |
(Optional) GPU Type | The graphics processing unit (GPU) types that you can add to your virtual machine. For more information about the different GPU types, see GPU types. |
(Optional) GPU Count | The number of GPUs you want to add to the virtual machine. The possible values are 1, 2, or 4. Important: Enter a value for this field only if you have selected GPU Type. |
(Optional) Network Tag | A character string that you can add to a virtual machine resource to provide a way to conditionally allow or deny policies. For more information about tags, see Tags overview. |
(Optional) Custom Network Subnet | A subnet, which is a group of IP addresses in a Virtual Private Cloud (VPC) network that you can select while creating a virtual machine. |
(Optional) Additional Blank Disk Type | The parameters you can set to configure additional disk space for your virtual machine. |
(Optional) Additional Blank Disk Size | |
(Optional) Additional Blank Disk Device Name | |
(Optional) Additional Blank Disk Auto Delete |
The following table describes the Create GCP VM output properties:
Property | Description | Example |
---|---|---|
Instance Name | The name of the virtual machine instance. | VM-1 |
IP | The IP address of the provisioned virtual machine. | 192.158.1.3 |
Status | The current status of the virtual machine such as Running, Deallocating, and Stopped. | Running |
Custom Host Name | The custom host name of the virtual machine, if provided. | <host name> |
Create GCP Bucket element properties
A Create GCP Bucket element creates a bucket for your data in Google Cloud Platform (GCP).
For more information about GCP buckets, see GCP buckets.
The following table describes the Create GCP Bucket input properties:
Property | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Connection Id | The connection ID of the GCP connector. | |||||||||||||||
Bucket Name | A unique name of the bucket that you want to create. The name must meet the following requirements:
| |||||||||||||||
Region | The name of the region in which you want to create the bucket. | |||||||||||||||
(Optional) Dual Region | A specific pair of locations that you can select based on the region. For more information, see GCP bucket locations. | |||||||||||||||
(Optional) Storage Class Name | The type of bucket you want to create based on the data storage duration and access frequency. The possible values are:
| |||||||||||||||
(Optional) Uniform Access Control | The option to decide the access control permission for the bucket. The possible values are:
| |||||||||||||||
(Optional) Prevent Public Access | The option to prevent the public from using your storage bucket.
| |||||||||||||||
(Optional) Maximum Number of Versions Per Object and Expire Non Current Versions After Days | Maximum Number of Versions Per Object—The number of versions you can have for every object in your bucket. (If Maximum Number of Versions Per Object is selected) Expire Non Current Versions After Days—The number of days after which the object versions that are not in use should be deleted. | |||||||||||||||
(Optional) Retention Policy Duration and Retention Policy Unit | Select the retention policy parameters only if you have not selected Maximum Number of Versions Per Object. The duration to keep the objects in your bucket. The unit of measurement for the retention policy duration. The possible values are: seconds, minutes, hours, days, months, years. |
To create a process for creating a virtual machine or bucket by using a GCP connector
- Log in to BMC Helix Innovation Studio.
- Navigate to the Workspace tab and select the application in which you want to create a process.
- In the application, select Processes and click New.
- In the Process designer, drag the element to the canvas based on the action you want to perform in Google Cloud Platform (GCP):
- To create a virtual machine, drag the Create GCP VM element to the canvas.
- To create a bucket, drag the Create GCP Bucket element to the canvas.
- In the element Properties pane, enter the property values.
- (Optional) Add the other process elements and specify the flow of execution that you want to create for your business logic.
- Save the process.
Data lookups and GCP connector queries
You can use data lookups with the Create GCP VM and Create GCP Bucket elements to select a value from the list of available values for the input properties.
You can pull data from an external system by mapping the element properties to a form or a dataset, or manually add the required values.
For information about mapping data to a form or a dataset, see Creating selection menus for question responses.
The following table lists the parameters that can be mapped to a form or a dataset, and those that need to be manually specified:
Parameter | Mapped to | Type | Example |
---|---|---|---|
PROJECT_ID | Form | Queryable | projects |
ZONE | Form | Queryable | us-east1 |
IMAGE_PUBLISHER | NA The possible values are:
| Queryable | windows-sql-cloud, SQL Server on Windows Server |
IMAGE_ID | Form | Queryable | windows-1709-core-for-containers |
DISK_TYPE | Form | Queryable | Balanced persistent disk |
MACHINE_CONFIGUR | Form | Queryable | e2-standard-2 |
GPU_TYPE | Form | Queryable | nvidia-tesla-t4 |
GPU_COUNT | Form | Queryable | 1 |
NETWORK_TAGS | NA You can select one or both of the following options:
| Simple | http-server |
INSTANCE_TEMPLAT | Form | Queryable | projects/project/global/instanceTemplates/example-instance-template |
CUSTOM_IMAGE_ID | Form | Queryable | projects/{project_name}/global/images/{image_name} |
ADDITIONAL_BLANK | Form | Queryable | Balanced persistent disk |
CUSTOM_NETWORK | Form | Queryable | 10.0.0.0/8 |
Example: Automating the creation of a virtual machine in GCP
Ajay is an application business analyst at Apex Global. He wants to automate the task of creating a virtual machine in GCP so that he can reduce the manual efforts of agents who are assigned to user requests for virtual machine creation. To automate the task, Ajay creates a process. He uses the Create GCP VM element to create a virtual machine in GCP and uses the Send Email element to notify the virtual machine details to the user.
Ajay performs the following actions to create the process to automate the creation of a virtual machine:
- Creates the process as shown in the following image:
- On the GENERAL tab, enters the name and adds the required variables.
- Adds the Create VM element properties as shown in the following image:
- Saves the process.
Example: Automating storage bucket creation in GCP
Ajay is an application business analyst in Apex Global. He wants to automate the task of creating a storage bucket in GCP. To automate the task, Ajay creates a process.
He uses the Create GCP Bucket element to create a bucket in GCP and the Send Email element to notify the bucket details to the user.
Ajay performs the following actions to create the process to automate the creation of a storage bucket:
- Creates the process as shown in the following image:
- On the GENERAL tab, enters the name and adds the required variables.
- Adds the Create bucket Service element properties as shown in the following image:
- Saves the process.
Example: Using lookups to specify Create GCP VM element input properties
Ajay is an application business analyst at Apex Global. Apex Global uses the BMC Helix Digital Workplace Advanced application to manage user service requests. Ajay automates the task of creating a virtual machine in GCP by creating a process to automate the task and use the process as a workflow in a service in BMC Helix Digital Workplace Advanced. While adding a questionnaire for the service, Ajay uses lookups to populate answers in the questionnaire. When a user uses the service to submit a virtual machine creation request, the user can specify the answers by selecting a value from the list of available values.
Ajay performs the following actions to use lookups in the questionnaire:
In the Question Designer of the service, Ajay adds the user-generated questions of Lookup type in the following sequence:
Lookup
Details
Project Id
Vm Name
Zone
Image Publisher
Image Version
Machine Configuration
Disk Type
Disk Size
Auto Delete
Device Disk Name
Host Name
Public Ssh Key
Gpu Type
Gpu Count
Network Tag
Additional Blank Disk Size
Additional Blank Disk Type
Additional Blank Disk Auto Delete
Additional Blank Disk Device Name
Custom Network Subnet
- Saves the questionnaire.
Learn about how to create questionnaires at Creating service questionnaires.