Create multiple VPC networks

Use the multivpc module to create up to eight VPC networks, each with a single subnetwork that contains a distinct IP address range.

By using this module, you can quickly deploy multiple isolated network environments for complex cluster configurations, such as high performance computing (HPC) workloads. The module outputs the additional_networks parameter, which lets you connect your networks to Slurm modules.

For the complete list of inputs and outputs for this module, see the multivpc module page in the Cluster Toolkit GitHub repository.

Before you begin

Before you begin, verify that you meet the following requirements:

  • You have installed and configured Cluster Toolkit. For installation instructions, see Set up Cluster Toolkit.
  • You have an existing cluster blueprint. You can use and modify an existing blueprint or create one from scratch. For a working example of a blueprint configured for the multivpc module, see the examples/gke-tpu-v6e.yaml file. For more information about creating and customizing blueprints, see Cluster blueprint.
  • To view a complete list of blueprints, go to the Cluster blueprint catalog page.

Required roles

To get the permissions that you need to create multiple VPC networks and subnetworks, ask your administrator to grant you the Compute Network Admin (roles/compute.networkAdmin) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations.

You might also be able to get the required permissions through custom roles or other predefined roles.

Configure multiple networks

To configure the multivpc module, you must define the following variables:

  • Name prefix: the name prefix for the VPC networks. The module prepends this string to all networks and subnetworks and appends a unique number. Specify this value by using the network_name_prefix field.
  • Network count: the number of VPC networks that you want to create. Specify this value by using the network_count field.
  • Global IP range: the Classless Inter-Domain Routing (CIDR) formatted IP address range that spans the entire set of networks. Specify this value by using the global_ip_address_range field.
  • Subnetwork CIDR suffix: the CIDR suffix that defines the address space that the individual VPC networks cover. Specify this value by using the subnetwork_cidr_suffix field.

Example configuration

The following example shows how to use the multivpc module to create eight new VPC networks. The module assigns names ranging from the multivpc-net-0 string to the multivpc-net-7 string. The module also creates exactly one subnetwork in each VPC network.

  - id: network
    source: modules/network/vpc

  - id: multinetwork
    source: modules/network/multivpc
    settings:
      network_name_prefix: multivpc-net
      network_count: 8
      global_ip_address_range: 172.16.0.0/12
      subnetwork_cidr_suffix: 16

  - id: a3_nodeset
    source: community/modules/compute/schedmd-slurm-gcp-v6-nodeset
    use: [network, multinetwork]
    settings:
      machine_type: a3-highgpu-8g

What's next

  • For the complete list of inputs and outputs for this module, see the multivpc module page in the Cluster Toolkit GitHub repository.