Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lustre doesn't deploy if existing VPC is specified. #691

Open
Tristan-Kosciuch opened this issue Nov 14, 2022 · 0 comments
Open

lustre doesn't deploy if existing VPC is specified. #691

Tristan-Kosciuch opened this issue Nov 14, 2022 · 0 comments

Comments

@Tristan-Kosciuch
Copy link

Tristan-Kosciuch commented Nov 14, 2022

I don't believe lustre.jinja is configured to deploy lustre into an existing VPC. In my lustre.yaml I have this in my cluster config:

   ### Use these fields to deploy Lustre in an existing VPC, Subnet, and/or Shared VPC
    vpc_net                 : slurm-gcp-v5-net
    #vpc_subnet              : slurm-gcp-v5-primary-subnet
    #shared_vpc_host_proj    : < Shared VPC Host Project name >

slurm-gcp-v5-net exists and you can see I've commented out the vpc_subnet. The first error returned is "subnet_split is undefined". In line 23 of lustre.jinja, subnet_split is defined only if lustre is being deployed into a new VPC. I fixed this error by adding this to lustre.jinja:

{% if properties['vpc_net'] and not properties['vpc_subnet'] %}
{% set subnet = properties['cidr'].split('/')[0] %}
{% set subnet_split = subnet.split('.') %}
{% endif %}

However, now the rest of the code references the wrong VPC. For instance, in lustre.jinja to create new subnets:

{% if not properties['vpc_subnet'] %}
# Create a subnet for the new cluster
- name: {{properties["cluster_name"]}}-lustre-subnet
  type: compute.v1.subnetwork
  properties:
    network: $(ref.{{properties["cluster_name"]}}-lustre-network.selfLink)
    ipCidrRange: {{ properties["cidr"]}}
    region: {{ region_ext }}
    privateIpGoogleAccess: TRUE

Notice how network: will be properties["cluster_name"]-lustre-network, not["vpc_net"]. I think the script needs to be reworked for passing an existing VPC without specifying a subnet. I'll need to fix this so I can create a PR.

Update

I got the script working by adding this code before the resources block in lustre.jinja. Change to your project in GCP:

{% if properties['vpc_net'] %}
  {% set vpc_reference = 'https://www.googleapis.com/compute/v1/projects/<Project ID>/global/networks/' ~ properties["vpc_net"]  %}
{% endif %}

This code in the resources section

# create subnet_split if using existing VPC
{% if properties['vpc_net'] and not properties['vpc_subnet'] %}
{% set subnet = properties['cidr'].split('/')[0] %}
{% set subnet_split = subnet.split('.') %}
{% endif %}

and by changing network references from network: $(ref.{{properties["cluster_name"]}}-lustre-network.selfLink) to network: {{ vpc_reference }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant