HewlettPackard / oneview-chef

This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Terraform and Ansible Collection
https://supermarket.chef.io/cookbooks/oneview
Apache License 2.0
17 stars 15 forks source link

Server Hardware Type not detected #351

Closed wingZero21 closed 6 years ago

wingZero21 commented 6 years ago

Scenario/Intent

[What you are trying to achieve but can't?]

Trying to assign a Server Hardware Type via variable for server Profile/Template.

Environment Details

Steps to Reproduce

[If you are filing an issue, what are the things we need to do in order to reproduce your problem? How are you using this cookbook or any resources it includes?]

Running the below configuration

syn_server_hardware_type = 'SY 480 Gen10 1'
syn_enclosure_group = 'GROUP001'
syn_firmware_driver = 'Service Pack for ProLiant, 2018.03.0'

# Oneview Server Template 
oneview_server_profile_template 'server_profile_template' do
  client my_client
  enclosure_group syn_enclosure_group
  firmware_driver syn_firmware_driver
  server_hardware_type syn_server_hardware_type
  action [:create]
end

# Oneview Server Profile 
oneview_server_profile 'server_profile' do
  client my_client
  server_profile_template = 'server_profile_template'
  server_hardware_type syn_server_hardware_type
  enclosure_group syn_enclosure_group
  firmware_driver syn_firmware_driver
  action [:create]
end

Expected Result

[What do you expect to happen after taking the steps above?]

I expect the profile to be created and assigned to the server hardware type.

Actual Result

[What actually happens after the steps above? Include error output or a link to a gist.]

Recipe: atchef_oneview_server_profile::default
  * oneview_server_profile_template[server_profile_template] action create

    ================================================================================
    Error executing action `create` on resource 'oneview_server_profile_template[server_profile_template]'
    ================================================================================

    OneviewSDK::NotFound
    --------------------
    ServerHardwareType with data '{:name=>"SY 480 Gen10 1"}' was not found
wingZero21 commented 6 years ago

Does the Hardware type need to be explicitly stated?

I have noticed there is an option to provide the hardware details separately for this? However there does not seem to be an add option for this?

Any ideas on why this is not picking up the hardware type that is located with Oneview?

Also when attempting to change the API/Variant version via the configuration settings on the profile template itself, it does not seem to be picking up these options? Can you confirm if its possible to do this via the profile or whether this needs to be specified via the attributes of the cookbook?

screen shot 2018-04-09 at 13 22 52

wingZero21 commented 6 years ago

Any ideas on this? The hardware type is there and exists as shown through the screenshot. I believe i have managed to change the API/Variant version now so it should be picking it up.

Details:


    OneviewSDK::NotFound
    --------------------
    ServerHardwareType with data '{:name=>"SY 480 Gen10 1"}' was not found

    Cookbook Trace:
    ---------------
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/oneview_helper.rb:248:in `load_resource'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/resource_provider.rb:274:in `load_resource'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/resource_providers/api200/server_profile_provider.rb:58:in `set_resource'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/resource_providers/api200/server_profile_template_provider.rb:21:in `load_with_properties'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/resource_providers/api200/server_profile_template_provider.rb:31:in `create_or_update'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/resource_providers/api******/synergy/server_profile_template_provider.rb:20:in `create_or_update'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/libraries/oneview_helper.rb:47:in `do_resource_action'
    /etc/chef/local-mode-cache/cache/cookbooks/oneview/resources/server_profile_template.rb:29:in `block in class_from_file'```
wingZero21 commented 6 years ago

Looks like this was caused due to an incorrect environment variable and also not using the correct API/Variant. This is now fixed.