vmware / build-tools-for-vmware-aria

Build Tools for VMware Aria provides development and release management tools for implementing automation solutions based on the VMware Aria Suite and VMware Cloud Director. The solution enables Virtual Infrastructure Administrators and Automation Developers to use standard DevOps practices for managing and deploying content.
Other
48 stars 24 forks source link

Unable to pull multiple Content Sources from vRA #161

Closed RV1959 closed 1 year ago

RV1959 commented 1 year ago

Description

My content.yaml contains two Content Sources, one linked to project A and one to project B.

When I pull the vRA content, I get an error in the logging: [ERROR] Failed to execute goal com.vmware.pscoe.maven.plugins:vra-ng-package-maven-plugin:2.31.1:pull (default-cli) on project TestMeerdereCloudTemplateContentSources: Execution default-cli of goal com.vmware.pscoe.maven.plugins:vra-ng-package-maven-plugin:2.31.1:pull failed: Content Source [Cloud Development 2] not found on the server.

The 'Cloud Development 2' definitely exists, but it is linked to a project that is not present in the settings.xml (AFAIK only a single project can be specified there).

It is not an option for us to include all content in a single source, because on the target (production) system we need to assign some content to one set of projects and other content to another set of projects. Using multiple settings.xml is not feasible with the gitlab runners we use.

Steps to Reproduce

  1. Here is my content.yaml:

    blueprint: [] subscription: [] flavor-mapping: [] image-mapping: [] storage-profile: [] region-mapping: {} catalog-item: [] custom-resource: [] resource-action: [] catalog-entitlement: [] content-source:

    • Cloud Development Source
    • Cloud Development 2 property-group: [] policy: content-sharing: []
  2. Pull the content:

    • Executing task: mvn vra-ng:pull -PvRA8-Development

[INFO] Scanning for projects... [INFO] [INFO] -----------< nl.gi:TestMeerdereCloudTemplateContentSources >------------ [INFO] Building TestMeerdereCloudTemplateContentSources 1.0.0-SNAPSHOT [INFO] from pom.xml [INFO] -------------------------------[ vra-ng ]------------------------------- [INFO] [INFO] --- vra-ng:2.31.1:pull (default-cli) @ TestMeerdereCloudTemplateContentSources --- [INFO] Reading config for type : VRANG [INFO] Searching for Package Store for type VRANG [INFO] Detected ConfigurationVraNg [INFO] Request URL: https://hidden/vco/api/about [INFO] Acquiring with refresh token [INFO] Token URI: https://hidden:443/csp/gateway/am/api/auth/api-tokens/authorize [INFO] Creating configuration for VRA NG com.vmware.pscoe.iac.artifact.model.vrang.VraNgPackageDescriptor@1c93b51e[ catalogItem=[] blueprint=[] subscription=[] flavorMapping=[] imageMapping=[] storageProfile=[] catalogEntitlement=[] propertyGroup=[] regionMapping=com.vmware.pscoe.iac.artifact.model.vrang.VraNgRegionMapping@420cd102 customResource=[] resourceAction=[] contentSource=[Cloud Development Source, Cloud Development 2] policy=com.vmware.pscoe.iac.artifact.model.vrang.VraNgPolicy@c7f4457 ] [INFO] Package | EXPORT | nl.gi.TestMeerdereCloudTemplateContentSources-1.0.0-SNAPSHOT.vra-ng [INFO] Currently exporting: VraNgPropertyGroupStore [INFO] Empty array is passed, not exporting anything [INFO] Currently exporting: VraNgContentSourceStore [INFO] Exporting filtered items: [Cloud Development Source, Cloud Development 2] [INFO] Created file C:(...)\nl.gi.TestMeerdereCloudTemplateContentSources-1.0.0-SNAPSHOT.vra-ng\content-sources\Cloud Development Source.json [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.076 s [INFO] Finished at: 2023-08-24T13:22:45+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.vmware.pscoe.maven.plugins:vra-ng-package-maven-plugin:2.31.1:pull (default-cli) on project TestMeerdereCloudTemplateContentSources: Execution default-cli of goal com.vmware.pscoe.maven.plugins:vra-ng-package-maven-plugin:2.31.1:pull failed: Content Source [Cloud Development 2] not found on the server. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Preconditions: Two content sources of type 'VMware Cloud Templates' present in the content.yaml

Expected behavior: Pull succeeds

Actual behavior: Fails (see before)

Reproduces how often: 100%

Component/s: [What are the Build Tools for VMware Aria components affected by the issue (e.g. "common/artifact-manager", "maven/plugins/vra-ng", "typescript/vrotest", etc)]

Affects Build/s:

Environment

Client

Server

Failure Logs

see before

Related issues and PRs

Additional Context

Michaelpalacce commented 1 year ago

Hey @RV1959, thank you for reaching out.

It's important to know that the vra-ng archetype (the one you are using) is meant to be per project, per organization https://github.com/vmware/build-tools-for-vmware-aria/blob/main/docs/versions/latest/Components/Archetypes/vRA%208.x/General/Core%20Concepts.md#single-project-and-single-organization

This is expected and cannot be changed.

In general a single vra-ng project should be created for a single Aria project.

For shared/global resources, you can create a global vra-ng project.

Closing this, reopen if needed