Create VM clusters

This page describes how to create a VM Cluster in Google Cloud.

In Oracle Database@Google Cloud, you can create a VM Cluster in Google Cloud using Google Cloud console or the Oracle Database@Google Cloud API. You'll need to create an Exadata Infrastructure instance before you can create a VM Cluster. To learn more about how to create a Exadata Infrastructure instance, see Create instances.

After you create a VM Cluster, you can create an Oracle Database for your VM Cluster with Oracle Cloud Infrastructure (OCI).

To learn more about Oracle Database@Google Cloud, see Product overview. For a list of available regions, see Available configurations.

Create a VM cluster

The following section covers how to create a VM Cluster in Google Cloud using the Google Cloud console or gcloud CLI.

  1. Go to the Exadata Database Service page in the Google Cloud console.

    Go to Exadata Database Service

  2. Click Exadata VM Clusters.

  3. In the Exadata VM Clusters section, click Create.

  4. In the Basic details section, complete the following:

    1. Select the Oracle Exadata Infrastructure instance that you want to create the VM Cluster in. To create an Exadata Infrastructure instance for your VM Cluster, see Create instances.

    2. Enter a Display name for your VM Cluster to display in the Google Cloud console. The display name must be unique within your Google Cloud project.

    3. Enter a VM Cluster ID to identify your cluster. The VM Cluster ID must be unique within your Google Cloud project and can't be changed later.

    4. Select the Oracle Grid Infrastructure version from the drop-down.

  5. In the VM Cluster configuration section, complete the following:

    1. Click Change DB Servers to select the database servers you want to use for VM placement. A minimum of two database servers is required.

      Only database servers that are available in the Exadata Infrastructure can be selected. Once you select the DB servers, click Submit to save.

    2. Enter the OCPU count per VM for your cluster. OCPU count can range from 2 to 126.

    3. Enter the Memory per VM for your cluster. Memory count can range from 30GB to 1,390GB.

    4. Enter the Local storage per VM for your cluster. Local storage count can range from 60GB to 1,800GB.

  6. In the Exadata storage configuration section, complete the following:

    1. Enter the Usable Exadata Storage for your cluster. This can range from 2TB to 100TB and must be specified in multiples of 1TB.

    2. Check the box for Allocate storage for sparse snapshots to allow storage to be utilized for sparse snapshots. This setting can't be changed after the VM Cluster has been created.

    3. Check the box for Allocate storage for local backups to allow your cluster storage to be used for local backups. This setting can't be changed after the VM Cluster has been created.

  7. In the Networking section, define the network configuration for the VM Cluster by completing the following:

    1. In the Associated network drop-down, select the VPC network you want to use from your network project. You can only choose one network from the list.

    2. In the Client IP Range field, enter the private IPv4 address range that you want to use for your VM Clusters or databases. IPv6 addresses aren't supported.

      Address ranges must use a valid CIDR notation (for example, 10.10.10.0/24). For more information on how to select client IP ranges, see Requirements for IP Address space.

    3. In the Backup IP Range field, enter the private IPv4 address range that will be used for the backup subnet. Your backup IP range can't overlap with your Client IP range. IPv6 addresses aren't supported.

      Address ranges must use a valid CIDR notation (for example, 10.10.11.0/24). For more information on how to select client IP ranges, see Requirements for IP Address space.

    4. In the Hostname prefix, specify a prefix you want to use to generate hostnames for the VM Cluster virtual machines. This prefix can only contain letters, numbers, or hyphens, and must start with a letter. The maximum allowed length is 12 characters.

  8. In the SSH keys section, add the public SSH keys you'd like to use for the cluster. To add a key, enter the SSH key name in the SSH Key 1 field. For each additional key, click ADD ITEM.

    For more information on how to generate SSH keys, see Generate SSH keys.

  9. In the License type section, select the type of Oracle license you're using for your cluster. Select one of the following:

    1. License included if you're creating a new license purchased as part of the Google Cloud marketplace order.

    2. Bring your own license (BYOL) if you're be using an existing Oracle license.

  10. In the Diagnostics collection section, complete the following to configure monitoring for your VM Cluster:

    1. Select the Enable diagnostic events checkbox to track all cluster diagnostic events.

    2. Select the Enable health monitoring checkbox to use the monitoring console to monitor cluster health metrics.

    3. Select the Enable incident logs and trace collection checkbox to enable incident logging for your cluster.

  11. In the Advanced fields section, complete the following:

    1. From the Timezone drop-down, select the timezone you'd like to use for diagnostic collection. This timezone is used for event timestamps.

    2. In the SCAN Listener Port (TCP/IP) field, enter a value to assign a SCAN listener port to your cluster. The port value can range from 1,024 to 8,000, and the default value is 1,521.

  12. Click Create to create the VM Cluster.

Use the gcloud oracle-database cloud-vm-clusters create command to create a cluster using gcloud CLI.

gcloud oracle-database cloud-vm-clusters create CLUSTER_ID
--exadata-infrastructure=EXADATA_INSTANCE_ID
--project=PROJECT_NAME
--location=REGION_ID
--display-name="DISPLAY_NAME"
--network=NETWORK_NAME
--cidr=CLIENT_SUBNET_RANGE
--backup-subnet-cidr=BACKUP_SUBNET_RANGE
--properties-license-type=LICENSE_TYPE
--properties-ssh-public-keys="SSH_KEYS"
--properties-gi-version=GI_VERSION
--properties-hostname-prefix=HOSTNAME_PREFIX_NAME
--properties-cpu-core-count=CPU_CORE_COUNT

Replace the following:

  • CLUSTER_ID: a permanent identifier for your instance. The cluster ID can't be changed once set.
  • EXADATA_INFRASTRUCTURE_NAME: the name of the Exadata Infrastructure instance where you'd like to create your cluster in the following format:

    projects/PROJECT_ID/locations/REGION_ID/cloudExadataInfrastuctures/EXADATA_INSTANCE_NAME
    
  • PROJECT_NAME: the name of your Google Cloud project.

  • REGION_ID: the region for your cluster. The region is permanent and can't be changed later. The region must match the region used to create the Exadata Infrastructure instance. For a list of available regions, see Available configurations.

  • DISPLAY_NAME: a name to identify your cluster and is displayed in the Google Cloud console. The name must be unique within your Google Cloud project.

  • NETWORK_NAME: the name of the network from your network VPC project that you'd like to use for your cluster in the following format:

    projects/PROJECT_ID/locations/global/NETWORK_NAME
    

    To create a VPC network project, see Configure VPC network.

  • CLIENT_SUBNET_RANGE: the IPv4 address or address range that can access your cluster. Address ranges must use a valid CIDR notation (for example, 10.10.10.0/24). For more information on how to select client IP ranges, see Requirements for IP Address space.

  • BACKUP_SUBNET_RANGE: the IPv4 address or address range that serves as backup to access your cluster. Address ranges must use a valid CIDR notation (for example, 10.10.10.0/24). For more information on how to select client IP ranges, see Requirements for IP Address space.

  • LICENSE_TYPE: the license type associated with your Oracle Database@Google Cloud order. Only accepted values are bring-your-own-license or license-included.

  • SSH_KEYS: the public SSH keys you want stored with your cluster. You can enter a single value for a single key, or an array of values for multiple keys.

  • GI_VERSION: the grid infrastructure version for your cluster. To get a list of all available grid infrastructure versions, run the following command in gcloud CLI:

    gcloud oracle-database gi-versions list --location=REGION_ID
    

    Replace the following:

    • REGION_ID: the region where you're creating your cluster. For a list of available regions, see Available configurations.
  • HOSTNAME_PREFIX_NAME: the prefix you want to use to generate hostnames for the VM Cluster. This prefix can only contain letters, numbers, or hyphens, and must start with a letter. The maximum allowed length is 12 characters.

  • CPU_CORE_COUNT: the number of enabled CPU cores you want for your cluster.

using Google.Cloud.OracleDatabase.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedOracleDatabaseClientSnippets
{
    /// <summary>Snippet for CreateCloudVmClusterAsync</summary>
    /// <remarks>
    /// This snippet has been automatically generated and should be regarded as a code template only.
    /// It will require modifications to work:
    /// - It may require correct/in-range values for request initialization.
    /// - It may require specifying regional endpoints when creating the service client as shown in
    ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
    /// </remarks>
    public async Task CreateCloudVmClusterAsync()
    {
        // Create client
        OracleDatabaseClient oracleDatabaseClient = await OracleDatabaseClient.CreateAsync();
        // Initialize request argument(s)
        string parent = "projects/[PROJECT]/locations/[LOCATION]";
        CloudVmCluster cloudVmCluster = new CloudVmCluster();
        string cloudVmClusterId = "";
        // Make the request
        Operation<CloudVmCluster, OperationMetadata> response = await oracleDatabaseClient.CreateCloudVmClusterAsync(parent, cloudVmCluster, cloudVmClusterId);

        // Poll until the returned long-running operation is complete
        Operation<CloudVmCluster, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
        // Retrieve the operation result
        CloudVmCluster result = completedResponse.Result;

        // Or get the name of the operation
        string operationName = response.Name;
        // This name can be stored, then the long-running operation retrieved later by name
        Operation<CloudVmCluster, OperationMetadata> retrievedResponse = await oracleDatabaseClient.PollOnceCreateCloudVmClusterAsync(operationName);
        // Check if the retrieved long-running operation has completed
        if (retrievedResponse.IsCompleted)
        {
            // If it has completed, then access the result
            CloudVmCluster retrievedResult = retrievedResponse.Result;
        }
    }
}

package main

import (
	"context"

	oracledatabase "cloud.google.com/go/oracledatabase/apiv1"
	oracledatabasepb "cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb"
)

func main() {
	ctx := context.Background()
	// This snippet has been automatically generated and should be regarded as a code template only.
	// It will require modifications to work:
	// - It may require correct/in-range values for request initialization.
	// - It may require specifying regional endpoints when creating the service client as shown in:
	//   https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
	c, err := oracledatabase.NewRESTClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	defer c.Close()

	req := &oracledatabasepb.CreateCloudVmClusterRequest{
		// TODO: Fill request struct fields.
		// See https://pkg.go.dev/cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb#CreateCloudVmClusterRequest.
	}
	op, err := c.CreateCloudVmCluster(ctx, req)
	if err != nil {
		// TODO: Handle error.
	}

	resp, err := op.Wait(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use resp.
	_ = resp
}
import com.google.api.core.ApiFuture;
import com.google.cloud.oracledatabase.v1.CloudVmCluster;
import com.google.cloud.oracledatabase.v1.CreateCloudVmClusterRequest;
import com.google.cloud.oracledatabase.v1.LocationName;
import com.google.cloud.oracledatabase.v1.OracleDatabaseClient;
import com.google.longrunning.Operation;

public class AsyncCreateCloudVmCluster {

  public static void main(String[] args) throws Exception {
    asyncCreateCloudVmCluster();
  }

  public static void asyncCreateCloudVmCluster() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (OracleDatabaseClient oracleDatabaseClient = OracleDatabaseClient.create()) {
      CreateCloudVmClusterRequest request =
          CreateCloudVmClusterRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setCloudVmClusterId("cloudVmClusterId-1217103287")
              .setCloudVmCluster(CloudVmCluster.newBuilder().build())
              .setRequestId("requestId693933066")
              .build();
      ApiFuture<Operation> future =
          oracleDatabaseClient.createCloudVmClusterCallable().futureCall(request);
      // Do something.
      Operation response = future.get();
    }
  }
}
/**
 * This snippet has been automatically generated and should be regarded as a code template only.
 * It will require modifications to work.
 * It may require correct/in-range values for request initialization.
 * TODO(developer): Uncomment these variables before running the sample.
 */
/**
 *  Required. The name of the parent in the following format:
 *  projects/{project}/locations/{location}.
 */
// const parent = 'abc123'
/**
 *  Required. The ID of the VM Cluster to create. This value is restricted
 *  to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of 63
 *  characters in length. The value must start with a letter and end with
 *  a letter or a number.
 */
// const cloudVmClusterId = 'abc123'
/**
 *  Required. The resource being created
 */
// const cloudVmCluster = {}
/**
 *  Optional. An optional ID to identify the request. This value is used to
 *  identify duplicate requests. If you make a request with the same request ID
 *  and the original request is still in progress or completed, the server
 *  ignores the second request. This prevents clients from
 *  accidentally creating duplicate commitments.
 *  The request ID must be a valid UUID with the exception that zero UUID is
 *  not supported (00000000-0000-0000-0000-000000000000).
 */
// const requestId = 'abc123'

// Imports the Oracledatabase library
const {OracleDatabaseClient} = require('@google-cloud/oracledatabase').v1;

// Instantiates a client
const oracledatabaseClient = new OracleDatabaseClient();

async function callCreateCloudVmCluster() {
  // Construct request
  const request = {
    parent,
    cloudVmClusterId,
    cloudVmCluster,
  };

  // Run request
  const [operation] = await oracledatabaseClient.createCloudVmCluster(request);
  const [response] = await operation.promise();
  console.log(response);
}

callCreateCloudVmCluster();
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\OracleDatabase\V1\Client\OracleDatabaseClient;
use Google\Cloud\OracleDatabase\V1\CloudVmCluster;
use Google\Cloud\OracleDatabase\V1\CreateCloudVmClusterRequest;
use Google\Rpc\Status;

/**
 * Creates a new VM Cluster in a given project and location.
 *
 * @param string $formattedParent                              The name of the parent in the following format:
 *                                                             projects/{project}/locations/{location}. Please see
 *                                                             {@see OracleDatabaseClient::locationName()} for help formatting this field.
 * @param string $cloudVmClusterId                             The ID of the VM Cluster to create. This value is restricted
 *                                                             to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of 63
 *                                                             characters in length. The value must start with a letter and end with
 *                                                             a letter or a number.
 * @param string $formattedCloudVmClusterExadataInfrastructure The name of the Exadata Infrastructure resource on which VM
 *                                                             cluster resource is created, in the following format:
 *                                                             projects/{project}/locations/{region}/cloudExadataInfrastuctures/{cloud_extradata_infrastructure}
 *                                                             Please see {@see OracleDatabaseClient::cloudExadataInfrastructureName()} for help formatting this field.
 * @param string $cloudVmClusterCidr                           Network settings. CIDR to use for cluster IP allocation.
 * @param string $cloudVmClusterBackupSubnetCidr               CIDR range of the backup subnet.
 * @param string $formattedCloudVmClusterNetwork               The name of the VPC network.
 *                                                             Format: projects/{project}/global/networks/{network}
 *                                                             Please see {@see OracleDatabaseClient::networkName()} for help formatting this field.
 */
function create_cloud_vm_cluster_sample(
    string $formattedParent,
    string $cloudVmClusterId,
    string $formattedCloudVmClusterExadataInfrastructure,
    string $cloudVmClusterCidr,
    string $cloudVmClusterBackupSubnetCidr,
    string $formattedCloudVmClusterNetwork
): void {
    // Create a client.
    $oracleDatabaseClient = new OracleDatabaseClient();

    // Prepare the request message.
    $cloudVmCluster = (new CloudVmCluster())
        ->setExadataInfrastructure($formattedCloudVmClusterExadataInfrastructure)
        ->setCidr($cloudVmClusterCidr)
        ->setBackupSubnetCidr($cloudVmClusterBackupSubnetCidr)
        ->setNetwork($formattedCloudVmClusterNetwork);
    $request = (new CreateCloudVmClusterRequest())
        ->setParent($formattedParent)
        ->setCloudVmClusterId($cloudVmClusterId)
        ->setCloudVmCluster($cloudVmCluster);

    // Call the API and handle any network failures.
    try {
        /** @var OperationResponse $response */
        $response = $oracleDatabaseClient->createCloudVmCluster($request);
        $response->pollUntilComplete();

        if ($response->operationSucceeded()) {
            /** @var CloudVmCluster $result */
            $result = $response->getResult();
            printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
        } else {
            /** @var Status $error */
            $error = $response->getError();
            printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
        }
    } catch (ApiException $ex) {
        printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
    }
}

/**
 * Helper to execute the sample.
 *
 * This sample has been automatically generated and should be regarded as a code
 * template only. It will require modifications to work:
 *  - It may require correct/in-range values for request initialization.
 *  - It may require specifying regional endpoints when creating the service client,
 *    please see the apiEndpoint client configuration option for more details.
 */
function callSample(): void
{
    $formattedParent = OracleDatabaseClient::locationName('[PROJECT]', '[LOCATION]');
    $cloudVmClusterId = '[CLOUD_VM_CLUSTER_ID]';
    $formattedCloudVmClusterExadataInfrastructure = OracleDatabaseClient::cloudExadataInfrastructureName(
        '[PROJECT]',
        '[LOCATION]',
        '[CLOUD_EXADATA_INFRASTRUCTURE]'
    );
    $cloudVmClusterCidr = '[CIDR]';
    $cloudVmClusterBackupSubnetCidr = '[BACKUP_SUBNET_CIDR]';
    $formattedCloudVmClusterNetwork = OracleDatabaseClient::networkName('[PROJECT]', '[NETWORK]');

    create_cloud_vm_cluster_sample(
        $formattedParent,
        $cloudVmClusterId,
        $formattedCloudVmClusterExadataInfrastructure,
        $cloudVmClusterCidr,
        $cloudVmClusterBackupSubnetCidr,
        $formattedCloudVmClusterNetwork
    );
}
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import oracledatabase_v1


def sample_create_cloud_vm_cluster():
    # Create a client
    client = oracledatabase_v1.OracleDatabaseClient()

    # Initialize request argument(s)
    cloud_vm_cluster = oracledatabase_v1.CloudVmCluster()
    cloud_vm_cluster.exadata_infrastructure = "exadata_infrastructure_value"
    cloud_vm_cluster.cidr = "cidr_value"
    cloud_vm_cluster.backup_subnet_cidr = "backup_subnet_cidr_value"
    cloud_vm_cluster.network = "network_value"

    request = oracledatabase_v1.CreateCloudVmClusterRequest(
        parent="parent_value",
        cloud_vm_cluster_id="cloud_vm_cluster_id_value",
        cloud_vm_cluster=cloud_vm_cluster,
    )

    # Make the request
    operation = client.create_cloud_vm_cluster(request=request)

    print("Waiting for operation to complete...")

    response = operation.result()

    # Handle the response
    print(response)
require "google/cloud/oracle_database/v1"

##
# Snippet for the create_cloud_vm_cluster call in the OracleDatabase service
#
# This snippet has been automatically generated and should be regarded as a code
# template only. It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in https://cloud.google.com/ruby/docs/reference.
#
# This is an auto-generated example demonstrating basic usage of
# Google::Cloud::OracleDatabase::V1::OracleDatabase::Rest::Client#create_cloud_vm_cluster.
#
def create_cloud_vm_cluster
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::OracleDatabase::V1::OracleDatabase::Rest::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::OracleDatabase::V1::CreateCloudVmClusterRequest.new

  # Call the create_cloud_vm_cluster method.
  result = client.create_cloud_vm_cluster request

  # The returned object is of type Gapic::Operation. You can use it to
  # check the status of an operation, cancel it, or wait for results.
  # Here is how to wait for a response.
  result.wait_until_done! timeout: 60
  if result.response?
    p result.response
  else
    puts "No response received."
  end
end

What's next