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

auto-assign hardware with scoped user not assigned #699

Closed
bigmagic opened this issue Jun 1, 2021 · 3 comments · Fixed by #701
Closed

auto-assign hardware with scoped user not assigned #699

bigmagic opened this issue Jun 1, 2021 · 3 comments · Fixed by #701

Comments

@bigmagic
Copy link

bigmagic commented Jun 1, 2021

Scenario/Intent

Hi,
We are using the autoassign feature of the Server Profile but the SP is not assigned when we execute the playbook with the scoped user.

It seems to related to the following issue: #469

This scoped used has administrator access to the following resources:

  • /rest/enclosures/..
  • /rest/sas-interconnects/...
  • /rest/drive-enclosures/...
  • /rest/logical-interconnect-groups/...
  • /rest/sas-logical-interconnect-groups/...
  • /rest/sas-logical-interconnects/...
  • /rest/logical-interconnects/...
  • /rest/sas-interconnects/....
  • /rest/sas-logical-interconnect-groups/...
  • /rest/sas-logical-interconnects/...
  • /rest/drive-enclosures/...
  • /rest/server-hardware/...

When we create the SP from ServerProfileTemplate, the ServerProfile is created but it is not automatically assigned to a server hardware.

Note: It is working when we execute the playbook as an administrator (not scoped) who has access to all resrouces into OneView.

Environment Details

  • OneView Ansible Docker Image: v6.1.0-OV6.1
  • OneView Appliance Version: 4.40

Steps to Reproduce

Below a small example:

---
- hosts: localhost    
  vars:
    # Python
    ansible_python_interpreter: '/usr/local/bin/python3.6'
    config: 'oneview-.json'
    ooneviewsptName: "spt-480g10"
    ooneviewspName: "test-assign-sp"


  tasks:

  - name: "Create SP from SPT"
    oneview_server_profile:
      config: "{{ config }}"
      state: present
      data: 
        name: "{{ ooneviewspName }}"
        serverProfileTemplateName: "{{ ooneviewsptName }}"
      params:
        force: true
```

### Expected Result

The Server Profile is created but It is not assigned to a hardware server.

### Actual Result

Not working as expected.

I thank you for your help,

Best Regards,
NIcolas
@VenkateshRavula
Copy link
Collaborator

VenkateshRavula commented Jun 3, 2021

Hi @bigmagic , we have analyzed the issue and found the issue could be reproduced when the initialScopeUris is not passed in the playbook as mentioned in the server profile examples.

Could you please try with the below playbook.

---
- hosts: localhost    
  vars:
    # Python
    ansible_python_interpreter: '/usr/local/bin/python3.6'
    config: 'oneview-.json'
    ooneviewsptName: "spt-480g10"
    ooneviewspName: "test-assign-sp"
    scope_uris: "<scope_uri>"

  tasks:
  - name: "Create SP from SPT"
    oneview_server_profile:
      config: "{{ config }}"
      state: present
      data: 
        name: "{{ ooneviewspName }}"
        serverProfileTemplateName: "{{ ooneviewsptName }}"
        initialScopeUris:
            - {{ scope_uri }}
      params:
        force: true

@bigmagic
Copy link
Author

bigmagic commented Jun 3, 2021

Hi @VenkateshRavula
I thank you for the reply and we will try.
Best Regards,
Nicolas

@bigmagic
Copy link
Author

bigmagic commented Jun 4, 2021

Hi @VenkateshRavula
I confirm It is working with initialScopeUris.
Thanks,
Best Regards,
Nicolas

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

Successfully merging a pull request may close this issue.

2 participants