chef-boneyard / inspec-oneview

InSpec OneView Resource Pack
https://www.inspec.io/
2 stars 1 forks source link

Unable to add interconnects to an enclosure group #4

Open russellseymour opened 6 years ago

russellseymour commented 6 years ago

Using the oneview_enclosure_group cookbook resource should allow you to specify the interconnects that are to be attached to it.

The logical interconnect group is successfully created using the `oneview_logical_interconnect_group' resource (https://github.com/chef/inspec-oneview/blob/russellseymour/infrastructure/test/integration/build/cookbooks/infrastructure/recipes/default.rb#L42)

However when this is added to the oneview_enclosure_group the group is created without any interconnects.

oneview_enclosure_group 'InSpec-Enclosure-Group' do
   client my_client
   data (
      stackingMode: 'Enclosure',
      interconnectMappingCount: 3,
      ipAddressingMode: 'DHCP'
   )
   logical_interconnect_groups [
      { name: 'InSpec-Logical-Interconnect-Group', enclosureIndex: '1' }
   ]
end
skpaterson commented 6 years ago

Reproduced on simulator and on live HP Synergy Oneview:

screen shot 2018-06-08 at 16 54 01

skpaterson commented 6 years ago

For reference, the above was attempting to use: https://github.com/HewlettPackard/oneview-chef

oneview_enclosure_group

oneview_enclosure_group 'EnclosureGroup_1' do
  client <my_client>
  data <resource_data>
  logical_interconnect_groups ['LIG_name1', { name: 'LIG_name2', enclosureIndex: 1 }]
  script <script_string> # String. Used in set_script action only.
  action [:create, :create_if_missing, :delete, :set_script]
end

logical_interconnect_groups: Array of data used to build the interconnect bay configuration. Each item can either be a string containing the LIG name or a hash containing the LIG name and enclosureIndex. Note that the enclosureIndex is not used on API200.
skpaterson commented 6 years ago

After a suggestion from HPE, arrived at the following which now seems to work in the live testing environment:

# Create enclosure group
eg = node['infrastructure']['enclosure_group']
oneview_enclosure_group eg['name'] do
  client my_client
  data(
    stackingMode: 'Enclosure',
    interconnectBayMappingCount: 6,
    ipAddressingMode: 'DHCP'
  )
  logical_interconnect_groups ["#{lig_ethernet['name']}"]
  only_if { eg['create'] }
end

screen shot 2018-06-20 at 12 11 31