HewlettPackard / oneview-puppet

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://forge.puppet.com/hewlettpackard/oneview
Apache License 2.0
8 stars 17 forks source link

Cannot create uplinkset for LIG on a Synergy frame #148

Closed frippe75 closed 7 years ago

frippe75 commented 7 years ago

Scenario/Intent

Trying to create a LIG with some uplinkset defined in a single "call" but fail with: Error: /Stage[main]/Main/Oneview_logical_interconnect_group[Puppet LIG Synergy-with-uplinks]: Could not evaluate: Port not supported: 2 type not found

Tried all possible combinations of portnames. But I guess this is not implemented for synergy frames.

Environment Details

Steps to Reproduce

docker run  -it \
                        -v $(pwd)/:/puppet \
                        -e ONEVIEW_URL='https://synergy-demo.lab.net' \
                        -e ONEVIEW_USER='Administrator' \
                        -e ONEVIEW_PASSWORD='*********' \
                        -e ONEVIEW_SSL_ENABLED=true, \
                        -e ONEVIEW_LOG_LEVEL='info' \
                        -e ONEVIEW_API_VERSION='300' \
                        -e ONEVIEW_HARDWARE_VARIANT='Synergy' \
                        oneview puppet apply examples/test_lig.pp

The test_lig.pp file. You need to create the "Tunnel Trunk-A" network prior to creating the LIG.

oneview_logical_interconnect_group{'Puppet LIG Synergy-with-uplinks':
  ensure => 'present',
  data   => {
    name                => 'PUPPET_TEST_LIG',
    type                => 'logical-interconnect-groupV300',
    redundancyType     => 'Redundant',
    enclosureType      => 'S12000',
    state               => 'Active',
    uplinkSets          => [
      {
        name                => 'TUNNEL_ETH_UP_01',
        ethernetNetworkType => 'Tunnel',
        networkType         => 'Ethernet',
        lacpTimer           => 'Short',
        mode                => 'Auto',
        uplink_ports        => [{   bay  => 3,
                                    port => '23' },
                                  { bay  => 3,
                                    port => '24' },
                                  { bay  => 6,
                                    port => '25' },
                                  { bay  => 6,
                                    port => '26' }
                               ],
        networkUris         => [ 'Tunnel Trunk-A' ]
      }
    ],
    interconnectBaySet => 3,
    interconnects       => [
      { bay  => 3,
        type => 'Virtual Connect SE 40Gb F8 Module for Synergy' },
      { bay  => 6,
        type => 'Virtual Connect SE 40Gb F8 Module for Synergy' }
        ],
    internalNetworkUris => ['Tunnel Trunk-A']
  },
}

Expected Result

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

Actual Result

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

fgbulsoni commented 7 years ago

This has been verified and is a possible improvement for the Ruby SDK.

Currently, we do not allow for using the compact syntax with Q and integer type ports. So, it will only work for 'X' and 'D' type ports at this moment.

While this improvement is not integrated into the SDK, using the full declaration of uplink sets should be the default:

oneview_logical_interconnect_group{'Puppet Ethernet LIG Synergy':
  ensure => 'present',
  data   => {
    name               => 'Puppet Ethernet LIG Synergy',
    redundancyType     => 'Redundant',
    interconnectBaySet => 3,
    interconnects      =>
    [
      {
        bay  => 3,
        type => 'Virtual Connect SE 40Gb F8 Module for Synergy'
      },
      {
        bay  => 6,
        type => 'Virtual Connect SE 40Gb F8 Module for Synergy'
      },
    ],
    uplinkSets         => [
      {
        networkUris            => [ 'TUNNEL_ETH_UP_01' ],
        mode                   => 'Auto',
        lacpTimer              => 'Short',
        logicalPortConfigInfos => [
          {
            desiredSpeed    => 'Auto',
            logicalLocation => {
              locationEntries => [
                {
                  type          => 'Bay',
                  relativeValue => 3
                },
                {
                  type          => 'Port',
                  relativeValue => 62
                },
                {
                  type          => 'Enclosure',
                  relativeValue => 1
                }
              ]
            }
          },
          {
            desiredSpeed    => 'Auto',
            logicalLocation => {
              locationEntries => [
                {
                  type          => 'Bay',
                  relativeValue => 6
                },
                {
                  type          => 'Port',
                  relativeValue => 67
                },
                {
                  type          => 'Enclosure',
                  relativeValue => 1
                }
              ]
            }
          }
        ],
        networkType            => 'Ethernet',
        ethernetNetworkType    => 'Tunnel',
        name                   => 'test_upset'
      }
    ]
  }
}

In this case, relativeValue 62 refers to Q1:1 and 67 to Q2:1 ports respectively.