ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 337 forks source link

community.vmware.vcenter_license adds all keys as License 1 #611

Open ImranJMughal opened 3 years ago

ImranJMughal commented 3 years ago
SUMMARY

when using community.vmware.vcenter_license to add vc, esxi and vsan cluster keys they all get added as name "License 1".

ISSUE TYPE

Can we have the option to add the name instead as we have a naming convention for licences as it helps for reporting.

COMPONENT NAME

community.vmware.vcenter_license

ADDITIONAL INFORMATION

I think it used entityDisplayName in https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.LicenseAssignmentManager.html but not sure if its the same for version 7 vcsa


    - name: Add VCSA Key
      community.vmware.vcenter_license:
        hostname: "vcsa.domain.com"
        username: "userx"
        password: "passx"
        license: "{{ item.key }}"
        license_description: "{{ item.description }}"
        validate_certs: no
        state: present
      register: tag_results
      delegate_to: localhost
      with_items:
        -
          key: 1-2-3-4-5
          description: "x.domain.com VCSA 7 License"
        -
          key: 6-7-8-9-10
          description: "x.domain.com ESXI 7 License"
        -
          key: 11-12-13-14-15
          description: "x.domain.com VSAN 7 License"
ansibullbot commented 3 years ago

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

@ImranJMughal: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md

click here for bot help

ImranJMughal commented 3 years ago
ANSIBLE VERSION
ansible 2.10.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/etc/ansible/library', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.9.0rc1 (default, Aug 11 2020, 23:12:07) [GCC 5.4.0 20160609]
sky-joker commented 3 years ago

Thank you @ImranJMughal for reporting this issue.

I looked for a method or property for license name changing, but I didn't find it.
https://vdc-download.vmware.com/vmwb-repository/dcr-public/b50dcbbf-051d-4204-a3e7-e1b618c1e384/538cf2ec-b34f-4bae-a332-3820ef9e7773/vim.LicenseManager.html

Unfortunately, I seem that a license name can't specify via vSphere API.

I think it used entityDisplayName in https://www.vmware.com/support/developer/converter-sdk/conv60_apireference/vim.LicenseAssignmentManager.html but not sure if its the same for version 7 vcsa

I confirmed that the entityDisplayName wasn't a license name displaying on vCenter GUI.
The entityDisplayName is displayed in the Asset in vCenter Server Systems(or Hosts) in Licenses in Administrator.

Akasurde commented 3 years ago

@sky-joker Do you know any esxcli alternative? Thanks

sky-joker commented 3 years ago

@Akasurde

I looked for how to register a license via VCSA command on Google, but I don't found out. I seem that the license can register via the command line if it is ESXi. https://www.altaro.com/vmware/license-vcenter-esxi-vsan/