Skip to content

Commit

Permalink
Merge 7841c4f into 98a1bf3
Browse files Browse the repository at this point in the history
  • Loading branch information
VenkateshRavula authored Jul 30, 2020
2 parents 98a1bf3 + 7841c4f commit 0d74245
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 96 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- Logical Interconnect Group
- Network Set
- Server Certificate
- Server Hardware
- Server Hardware Type
- Server Profile
- Server Profile Template
- Storage Pool
- Storage System
- Storage Volume Template
Expand Down
98 changes: 50 additions & 48 deletions endpoints-support.md

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions examples/server_hardware.pp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,32 @@
},
}

oneview_server_hardware{'server_hardware_14':
ensure => 'get_local_storage',
data => {
name => '0000A66101, bay 3',
},
}

# This example works only for server hardware having local_storageV2 schema
oneview_server_hardware{'server_hardware_15':
ensure => 'get_local_storagev2',
data => {
name => '0000A66101, bay 3',
},
}

# NOTE: This resource requires a state of 'RefreshPending'
# NOTE: This resource accepts an optional field 'options' for refreshing the server hardware
oneview_server_hardware{'server_hardware_14':
oneview_server_hardware{'server_hardware_16':
ensure => 'set_refresh_state',
data => {
name => '0000A66101, bay 3',
state => 'RefreshPending'
},
}

oneview_server_hardware{'server_hardware_15':
oneview_server_hardware{'server_hardware_17':
ensure => 'absent',
data => {
hostname => '172.18.6.14',
Expand Down
12 changes: 6 additions & 6 deletions examples/server_profile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ensure => 'get_available_targets',
data => {
query_parameters => {
scopesUri => '/rest/scopes/aa42a1c2-114e-49ef-b725-4cee9f284d74'
scopesUri => '/rest/scopes/d330e8aa-a811-4b79-870e-1cd247d8356d'
}
}
}
Expand All @@ -45,9 +45,9 @@
ensure => 'get_available_networks',
data => {
query_parameters => {
enclosureGroupUri => '/rest/enclosure-groups/3956d043-22a7-44f1-8a16-e6c6bd7c35a2',
serverHardwareTypeUri => '/rest/server-hardware-types/5FED8002-0CD7-4246-9809-B2235985F903'
# scopesUri => '/rest/scopes/bf3e77e3-3248-41b3-aaee-5d83b6ac4b49'
enclosureGroupUri => '/rest/enclosure-groups/2ca75192-1403-486e-87e1-3163d64e93db',
serverHardwareTypeUri => '/rest/server-hardware-types/B73A3E43-867E-4684-B32F-CEC38322996E'
scopesUri => '/rest/scopes/bf3e77e3-3248-41b3-aaee-5d83b6ac4b49'
}
}
}
Expand All @@ -66,9 +66,9 @@
ensure => 'present',
data =>
{
type => 'ServerProfileV11',
type => 'ServerProfileV12',
name => 'Test Server Profile',
serverHardwareUri => '/rest/server-hardware/30303837-3931-584D-5131-303030323038',
serverHardwareUri => '/rest/server-hardware/30303437-3034-4D32-3230-313030304752',
}
}

Expand Down
102 changes: 64 additions & 38 deletions examples/server_profile_provision_with_i3s.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
################################################################################
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# This example requires the following resources before executing:
# Ethernet network - iSCSI, Management


# Vars
$server_profile_name = 'Server profile with OS Deployment Plan - PUPPET DEMO'
$server_hardware_name = 'F2-CN7515049D, bay 8'
$server_hardware_type = 'SY 480 Gen9 1'
$network_1 = 'Management'
$network_2 = 'IS iSCSI'
$network_1 = '/rest/ethernet-networks/1aaec4f8-c1c3-4178-a23c-fc4c118frees'
$network_2 = '/rest/ethernet-networks/1aaec4f8-c1c3-4178-a23c-fc4c118de4db'
$deployment_plan_name = 'Bootstrap_DCOS'

# Powering off the server in order to apply the Server Profile
Expand Down Expand Up @@ -37,43 +55,51 @@
pxeBootPolicy => 'Auto',
mode => 'UEFIOptimized',
},
connections => [
{
id => 1,
name => 'connection1',
functionType => 'Ethernet',
networkUri => $network_1,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'NotBootable',
}
},
{
id => 2,
name => 'connection2',
functionType => 'Ethernet',
networkUri => $network_2,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'Primary',
initiatorNameSource => 'ProfileInitiatorName'
}
},
{
id => 3,
name => 'connection3',
functionType => 'Ethernet',
networkUri => $network_2,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'Secondary',
initiatorNameSource => 'ProfileInitiatorName'
connectionSettings => {
connections => [
{
id => 1,
name => 'connection1',
functionType => 'Ethernet',
networkUri => $network_1,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'NotBootable',
}
},
{
id => 2,
name => 'connection2',
functionType => 'Ethernet',
networkUri => $network_2,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'Primary',
ethernetBootType => 'iSCSI',
iscsi => {
initiatorNameSource => 'ProfileInitiatorName'
}
}
},
{
id => 3,
name => 'connection3',
functionType => 'Ethernet',
networkUri => $network_2,
requestedMbps => 2500,
requestedVFs => 'Auto',
boot => {
priority => 'Secondary',
ethernetBootType => 'iSCSI',
iscsi => {
initiatorNameSource => 'ProfileInitiatorName'
}
}
}
}
]
]
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions examples/server_profile_template.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
# (C) Copyright 2016-2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,11 @@
################################################################################

# This example requires:
# - FC networks 'FC01' and 'FC02'
# - Storage system should be added and a volume should be created
# - Enclosure Groups 'e10_encl_group' and 'e11-encl-group'
# - Server Hardware Type 'BL460c Gen9 1'
# - Firmware bundle 'HPE Synergy Custom SPP 201912 2019 12 19' (make 'manageFirmware' as false if firmware is not available)

# You can either declare the name or the uri of the following parameters that require Uri:
oneview_server_profile_template{'Server Profile Template Create':
Expand Down Expand Up @@ -285,7 +288,7 @@
}
}

# This task will only work once the Server Profile above is deleted
# This task will work only after deleting the above created Server Profile
# oneview_server_profile_template{'Server Profile Template Destroy #2':
# ensure => 'absent',
# require => Oneview_server_profile_template['Server Profile Create'],
Expand Down
10 changes: 10 additions & 0 deletions lib/puppet/provider/oneview_server_hardware/c7000.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ def get_bios
true
end

def get_local_storage
pretty get_single_resource_instance.get_local_storage
true
end

def get_local_storagev2
pretty get_single_resource_instance.get_local_storagev2
true
end

def get_ilo_sso_url
pretty get_single_resource_instance.get_ilo_sso_url
true
Expand Down
8 changes: 8 additions & 0 deletions lib/puppet/type/oneview_server_hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
provider.get_bios
end

newvalue(:get_local_storage) do
provider.get_local_storage
end

newvalue(:get_local_storagev2) do
provider.get_local_storagev2
end

newvalue(:get_ilo_sso_url) do
provider.get_ilo_sso_url
end
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/provider/oneview_server_hardware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@
expect(provider.get_bios).to be
end

it 'should return the local storage' do
expect_any_instance_of(resource_type).to receive(:get_local_storage).and_return('Fake Get Local Storage')
expect(provider.get_local_storage).to be
end

it 'should return the local storagev2' do
expect_any_instance_of(resource_type).to receive(:get_local_storagev2).and_return('Fake Get Local StorageV2')
expect(provider.get_local_storagev2).to be
end

it 'should return the ilo sso url' do
expect_any_instance_of(resource_type).to receive(:get_ilo_sso_url).and_return('Fake get_ilo_sso_url')
expect(provider.get_ilo_sso_url).to be
Expand Down

0 comments on commit 0d74245

Please sign in to comment.