ansible-collections / ansible-collections/netapp.cloudmanager
single node CVO in GCP requires subnetPath in shared VPC case
- Dominant language
- Python
- Stars
- 3
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### 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
```console
$ 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
```console
$ ansible-galaxy collection list
...
Collection Version
------------------- -------
ansible.posix 1.3.0
netapp.cloudmanager 21.15.0
```
### Playbook
```console
- 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
```yaml (paste below)
$ ansible-playbook ./cvo.yml
```
### Expected Results
expected CVO instance to get created
### Actual Results
```console
...
[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
```
Contributor guide
Research direction
Start at the na_cloudmanager_cvo_gcp module entry point and reproduce the supplied playbook with the shared VPC values. Compare the submitted request with the working API request, focusing on subnetPath, subnetId, project_id, and network_project_id. Done means the single-node CVO creation succeeds for the shared VPC case and the request behavior is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible, gcp, python
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100