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

single node CVO in GCP requires subnetPath in shared VPC case #4

Open
tsrustam opened this issue Apr 6, 2022 · 1 comment
Open

Comments

@tsrustam
Copy link

tsrustam commented Apr 6, 2022

Summary

getting error message "Failed to retrieve vpc host-network"
when using shared vpc host project with network name "host-network"
and when creating single node CVO instance using netapp.cloudmanager.na_cloudmanager_cvo_gcp
Comparison of arguments of working API call vs the one that ansible collection(v21.15.0) submits shows missing
subnetPath argument.

working API call has both subnetPath and subnetId having the same value
...
"subnetPath": "projects/shared-vpc-host-project/regions/us-central1/subnetworks/cvo-subnetwork-name",
"subnetId": "projects/shared-vpc-host-project/regions/us-central1/subnetworks/cvo-subnetwork-name",
"vpcId": "host-network",
...

connector logs show that network name that connector tries to use is formed using project_id rather than network_project_id
Hard to say whose fault is that given that description of optional subnetPath argument is very vague. I guess that argument is required when network is in different project

Component Name

na_cloudmanager_cvo_gcp

Ansible Version

$ ansible --version
ansible [core 2.11.3] 
...
python version = 3.9.7 (default, Jan  1 2020, 00:00:00) [GCC 8.3.0]
jinja version = 3.0.1
libyaml = True

Cloud Manager Collection Version

$ ansible-galaxy collection list
...
Collection          Version
------------------- -------
ansible.posix       1.3.0
netapp.cloudmanager 21.15.0

Playbook

- name: test
  hosts: localhost
  connection: local
  tasks:
    - name: Create NetApp Cloud Manager cvo for GCP
      netapp.cloudmanager.na_cloudmanager_cvo_gcp:
        state: present
        name: ansible
        project_id: cvo-project
        network_project_id: shared-vpc-host
        vpc_id: host-network
        zone: us-central1-c
        subnet_id: "projects/shared-vpc-host/regions/us-central1/subnetworks/cvo-subnetwork-name"
        firewall_rule: allow-cvo-traffic
        gcp_volume_type: pd-ssd
        gcp_volume_size: 500
        gcp_volume_size_unit: GB
        gcp_service_account: "cvo-service@cvo-project.iam.gserviceaccount.com"
        data_encryption_type: GCP
        svm_password: "password"
        ontap_version: latest
        use_latest_version: true
        capacity_package_name: Freemium
        license_type: capacity-paygo
        instance_type: n2-standard-4
        client_id: "CLIENT-ID-HERE"
        workspace_id: "WORKSPACE-ID-HERE"
        sa_client_id: "SA-CLIENT-ID-HERE"
        sa_secret_key: "SA-SECRET-KEY-HERE"
        capacity_tier: cloudStorage

Steps to Reproduce

$ ansible-playbook ./cvo.yml

Expected Results

expected CVO instance to get created

Actual Results

...
[WARNING]: Module did not set no_log for update_svm_password
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Error: unexpected response on creating cvo gcp: 400, b'{"message":"Failed to retrieve vpc host-network","causeMessage":"BadRequestException: Failed to retrieve vpc host-network"}'

PLAY RECAP **************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
@carchi8py
Copy link
Contributor

@wenjun666 will look in to it.

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

2 participants