Skip to content

Not able to add a vcenterserver object #212

Open
@ngrosc

Description

@ngrosc

Describe the bug

Using vmware.alb.avi_vcenterserver (version 22.1.7 or 30.2.2) to create a vcenterserver for addint to a nsx-t cloud failes in a "list index out of range" error.

Reproduction steps

  1. define the vars for a nsx-t cloud and for a vcenterserver
- name: Create vcenter
  vmware.alb.avi_vcenterserver:
    avi_credentials: "{{ avi_credentials }}"
    name: vcentera
    vcenter_url: vcenter.local.domain
    vcenter_credentials_ref: MYCRED
    content_lib: 
      id: <uuid>
    cloud_ref: NAMEOFNSXTCLOUD
  1. deploy it
  2. it failes with list index out of range error

Expected behavior

vcenter gets created and linked to cloud

Additional context

Issue seems to be in file vmware/alb/plugins/module_utils/utils/ansible_utils.py, line 485 (30.2.2) or line 479 (22.1.7). Changing

#cloud = obj['cloud_ref'].split('name=')[1]

to

cloud = obj['cloud_ref']

fixes it in a quick and dirty way as we now have to use the uuid instead of the name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions