Automating the creation of virtual machines and storage accounts by using GCP


As an administrator or an application business analyst, you can automate the actions that you perform in Google Cloud Platform (GCP), such as creating a virtual machine and bucket. To automate these actions, in your application, you create processes by using the Create GCP VM and Create GCP Bucket elements in the Process designer of BMC Helix Innovation Studio.

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:



icon_play.png https://www.youtube.com/embed/aSXD9n8nyF

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:

  • The first character must be a lowercase letter.
  • The last character must not be a hyphen.
  • The characters between the first and the last character must be a combination of lowercase letters, hyphens, and digits. 

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:

  • Image Publisher—The name of the organization that provides a virtual machine image in the GCP Marketplace that you can use.
    • Image Version—The version of the virtual machine image.
      This field is required only if you select Image Publisher.
  • Instance Template—A template containing the configuration properties such as machine type, disk type, metadata, startup scripts, which you can use to create a virtual machine instance.
  • Custom Image—A custom image with all the required resources that you can use to create a virtual machine instance.

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
configuration, metadata, permissions, and data from one or more disks that are required to create a virtual machine instance. 

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:

  • It must be 3 to 63 characters long.
  • It can contain only numeric characters, lowercase letters, dashes, underscores, and dots.
  • The first and last character must be a number or a lowercase letter.
  • It cannot include an IP address.
  • It cannot contain the exact or close variations to the word Google.

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:

Storage Class Name

Duration

Access frequency

STANDARD

None

  • Frequently accessed
  • Short term storage

NEARLINE

30 days

  • Access once a month
  • Backup data

COLDLINE

60 days

  • Access once in a quarter
  • Disaster recovery

ARCHIVE

90 days

  • Access once in a year
  • Long term archive

(Optional) Uniform Access Control

The option to decide the access control permission for the bucket.

The possible values are:

  • UniformThe object access is controlled through bucket-level permission. 
  • Fine grainedThe object access is controlled through bucket-level and object-level permission. 

(Optional) Prevent Public Access

The option to prevent the public from using your storage bucket.

  • TruePrevent public access
  • FalseAllow public access

(Optional) Maximum Number of Versions Per Object and Expire Non Current Versions After Days

Maximum Number of Versions Per ObjectThe 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

  1. Log in to BMC Helix Innovation Studio.
  2. Navigate to the Workspace tab and select the application in which you want to create a process.
  3. In the application, select Processes and click New.
  4. 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.
  1. In the element Properties pane, enter the property values.
  2. (Optional) Add the other process elements and specify the flow of execution that you want to create for your business logic.
  3. 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:

  • cos-cloud, Container Optimized OS
  • centos-cloud, CentOS
  • debian-cloud, Debian
  • ml-images, Deep Learning on Linux
  • fedora-cloud, Fedora
  • fedora-coreos-cloud, Fedora CoreOS
  • opensuse-cloud, Open SUSE
  • rhel-cloud, Red Hat Enterprise Linux
  • rhel-sap-cloud, Red Hat Enterprise Linux for SAP
  • rocky-linux-cloud, Rocky Linux
  • windows-sql-cloud, SQL Server on Windows Server
  • suse-cloud, SUSE Linux Enterprise Server
  • suse-sap-cloud, SUSE Linux Enterprise Server for SAP
  • ubuntu-os-cloud, Ubuntu
  • ubuntu-os-pro-cloud, Ubuntu Pro
  • windows-cloud, Windows Server

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
ATION

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:

  • http-server
  • https-server

Simple

http-server

INSTANCE_TEMPLAT
E

Form

Queryable

projects/project/global/instanceTemplates/example-instance-template

CUSTOM_IMAGE_ID

Form

Queryable

projects/{project_name}/global/images/{image_name}

ADDITIONAL_BLANK
_DISK_TYPE

Form

Queryable

Balanced persistent disk

CUSTOM_NETWORK
_SUBNET

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:

  1. Creates the process as shown in the following image:
    23_2_Create_GCP_VM_element.png
  2. On the GENERAL tab, enters the name and adds the required variables.

  3. Adds the Create VM element properties as shown in the following image:

    23_2_Create_GCP_VM_element_properties.png
  4. 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:

  1. Creates the process as shown in the following image:
    23_2_Create_GCP_bucket_element.png
  2. On the GENERAL tab, enters the name and adds the required variables.

  3. Adds the Create bucket Service element properties as shown in the following image:

    23_2_Create_GCP_bucket_element_properties.png
  4. 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:

  1. In the Question Designer of the service, Ajay adds the user-generated questions of Lookup type in the following sequence:

    Lookup

    Details

    Project Id

    project_id_qsn.png

    Vm Name

    vm_name_qn.png

    Zone

    zone_qsn.png

    Image Publisher

     Image_publisher_qsn.png

    Image Version

     Image_version_qsn.png

    Machine Configuration

     machine_config_qsn.png

    Disk Type

     disk_type_qsn.png

    Disk Size

    disk_size_qsn.png

    Auto Delete

    auto_delete_qsn.png

    Device Disk Name

     device_disk_qsn.png

    Host Name

    host_name_qsn.png

    Public Ssh Key

    public_ssh_qsn.png

    Gpu Type

    Gpu_type_qsn.png

    Gpu Count

    Gpu_count_qsn.png

    Network Tag

    network_tag_qsn.png

    Additional Blank Disk Size

    add_disk_space_qsn.png

    Additional Blank Disk Type

    add_disk_space_type_qsn.png

    Additional Blank Disk Auto Delete

    add_disk_auto_delete_qsn.png

    Additional Blank Disk Device Name

    add_disk_name_qsn.png

    Custom Network Subnet

     custom_subnet_qsn.png

  2. Saves the questionnaire.

Learn about how to create questionnaires at Creating service questionnaires.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*