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

Adding examples created for previous demo #287

Merged
merged 9 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions examples/demos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Demos

This directory contains some scenarios presented on demonstrations.

27 changes: 27 additions & 0 deletions examples/demos/boot_from_san_and_migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Server profile with boot from SAN and server profile & volume migration

This demo is composed by 5 steps, each one associated with a playbook, that should be executed in the specified order:

### [Step 1 - Create server profile with boot from SAN](step_1_create_server_profile_boot_from_SAN.yml)
This playbook exemplifies how to create a server profile with boot from SAN (3PAR) without using a template. It performs 2 tasks:
1. The server profile 'profile_san' is created (if not already present) and assigned to server hardware in bay 1. You can check all parameters, including those related to the server hardware and those related to the storage as SAN connections and volume attachment. The volume must be ready to use.
2. The server hardware is powered on.

### [Step 2 - Add an extra data volume attachment to the existing server profile](step_2_based_on_server_profile_boot_from_SAN_add_another_volume.yml)
This playbook exemplifies how to add an extra volume attachment to the existing server profile 'profile_san'. It performs only 1 task:
1. Updates server profile 'profile_san' (created on step 1) adding a new volume attachment identified by id 2. When this task is executed, the additional volume becomes available to the operating system.

### [Step 3 - Create server profile based on a server profile template](step_3_create_server_profile_from_template.yml)
This playbook exemplifies how to create a server profile using a server profile template. It performs 2 tasks:
1. The server profile 'profile_i3s' is created (if not already present) and assigned to server hardware in bay 12. In this case, all settings were configured in the template, including network connections and OS deployment plan to use Image Streamer.
2. The server hardware is powered on.

### [Step 4 - Migrate a data volume to another server profile](step_4_migrate_data_volume.yml)
This playbook exemplifies how to migrate a data volume from one server profile to another. It performs 2 tasks:
1. Updates server profile 'profile_san' to match its original state on step 1, removing the data volume identified by id 2.
2. Updates server profile 'profile_i3s' inserting the data volume removed in the previous task. The connectionId used by the storage paths needs to be updated to match the SAN connections. In this case, the SAN connection ids in the server profile template were 4 and 5.

### [Step 5 - Migrate server profile to another server hardware](step_5_migrate_server_profile.yml)
This playbook exemplifies how to migrate a server profile from one server hardware to another. For this use case only one task must be executed:
1. The server profile 'profile_san' is updated specifying the new server hardware. This task was copied from step 1 and just the server hardware name was changed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
###
# Copyright 2017 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.
###

- hosts: all
vars:
config: '{{ playbook_dir }}/oneview_config.json'
server_hardware_type_name: "SY 480 Gen9 3"
enclosure_group_name: "SYN107_EG"
server_hardware_name: "2-USE722C99W-M, bay 1"
profile_name: "profile_san"
management_network: "Management"
SAN_A_network: "SAN-A"
SAN_B_network: "SAN-B"
storage_pool_name_A: "Pool name A"

tasks:

- name : "Create Server Profile {{ profile_name }} with 1 volume attachment (boot)"
oneview_server_profile:
config: "{{ config }}"
data:
name: "{{ profile_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
serverHardwareName: "{{ server_hardware_name }}"
serialNumberType: Virtual
iscsiInitiatorNameType: AutoGenerated
macType: Virtual
wwnType: Virtual
description: 'use case 1: boot from SAN'
affinity: Bay
connections:
- id: 1
name: LAB
functionType: Ethernet
portId: Mezz 3:2-a
requestedMbps: '2500'
networkName: "{{ management_network }}"
requestedVFs: '0'
boot:
priority: NotBootable
- id: 2
name: SAN-A
functionType: FibreChannel
portId: Mezz 2:1
requestedMbps: Auto
networkName: "{{ SAN_A_network }}"
boot:
priority: Primary
bootVolumeSource: ManagedVolume
- id: 3
name: SAN-B
functionType: FibreChannel
portId: Mezz 2:2
requestedMbps: Auto
networkName: "{{ SAN_B_network }}"
boot:
priority: NotBootable
boot:
manageBoot: true
order:
- CD
- USB
- HardDisk
- PXE
bootMode:
manageMode: true
mode: BIOS
bios:
manageBios: false
overriddenSettings: []
hideUnusedFlexNics: true
iscsiInitiatorName: ''
localStorage:
sasLogicalJBODs: []
controllers: []
sanStorage:
hostOSType: Windows Server 2016
manageSanStorage: true
volumeAttachments:
- id: 1
isBootVolume: true
lunType: Auto
storagePaths:
- isEnabled: true
connectionId: 2
- isEnabled: true
connectionId: 3
volumeName: win_boot
volumeStoragePoolName: "{{ storage_pool_name_A }}"
delegate_to: localhost

- name: Power on the server hardware
oneview_server_hardware:
config: "{{ config }}"
state: power_state_set
data:
name : "{{ server_hardware.name }}"
powerStateData:
powerState: "On"
powerControl: "MomentaryPress"
delegate_to: localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
###
# Copyright 2017 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.
###

- hosts: all
vars:
config: '{{ playbook_dir }}/oneview_config.json'
server_hardware_type_name: "SY 480 Gen9 3"
enclosure_group_name: "SYN107_EG"
server_hardware_name: "2-USE722C99W-M, bay 1"
profile_name: "profile_san"
management_network: "Management"
SAN_A_network: "SAN-A"
SAN_B_network: "SAN-B"
storage_pool_name_A: "Pool name A"
storage_pool_name_B: "Pool name B"

tasks:

- name : "Update Server Profile {{ profile_name }} adding another volume attachment"
oneview_server_profile:
config: "{{ config }}"
data:
name: "{{ profile_name }}"
serverHardwareTypeName: "{{ server_hardware_type_name }}"
enclosureGroupName: "{{ enclosure_group_name }}"
serverHardwareName: "{{ server_hardware_name }}"
serialNumberType: Virtual
iscsiInitiatorNameType: AutoGenerated
macType: Virtual
wwnType: Virtual
description: 'use case 1: boot from SAN'
affinity: Bay
connections:
- id: 1
name: LAB
functionType: Ethernet
portId: Mezz 3:2-a
requestedMbps: '2500'
networkName: "{{ management_network }}"
requestedVFs: '0'
boot:
priority: NotBootable
- id: 2
name: SAN-A
functionType: FibreChannel
portId: Mezz 2:1
requestedMbps: Auto
networkName: "{{ SAN_A_network }}"
boot:
priority: Primary
bootVolumeSource: ManagedVolume
- id: 3
name: SAN-B
functionType: FibreChannel
portId: Mezz 2:2
requestedMbps: Auto
networkName: "{{ SAN_B_network }}"
boot:
priority: NotBootable
boot:
manageBoot: true
order:
- CD
- USB
- HardDisk
- PXE
bootMode:
manageMode: true
mode: BIOS
bios:
manageBios: false
overriddenSettings: []
hideUnusedFlexNics: true
iscsiInitiatorName: ''
localStorage:
sasLogicalJBODs: []
controllers: []
sanStorage:
hostOSType: Windows Server 2016
manageSanStorage: true
volumeAttachments:
- id: 1
isBootVolume: true
lunType: Auto
storagePaths:
- isEnabled: true
connectionId: 2
- isEnabled: true
connectionId: 3
volumeName: win_boot
volumeStoragePoolName: "{{ storage_pool_name_A }}"
- id: 2
lunType: Auto
storagePaths:
- isEnabled: true
connectionId: 2
- isEnabled: true
connectionId: 3
volumeName: DATA1
volumeStoragePoolName: "{{ storage_pool_name_B }}"
delegate_to: localhost
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
###
# Copyright 2017 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.
###

- hosts: all
vars:
config: '{{ playbook_dir }}/oneview_config.json'
server_hardware_name: "2-USE722C99W-M, bay 12"
server_profile_template: "Windows2016_i3s"
profile_name: "profile_i3s"

tasks:

- name : "Create Server Profile - {{ profile_name }}"
oneview_server_profile:
config: "{{ config }}"
data:
serverHardwareName: "{{ server_hardware_name }}"
serverProfileTemplateName: "{{ server_profile_template }}"
name: "{{ profile_name }}"
delegate_to: localhost

- name: Power on the server hardware
oneview_server_hardware:
config: "{{ config }}"
state: power_state_set
data:
name : "{{ server_hardware.name }}"
powerStateData:
powerState: "On"
powerControl: "MomentaryPress"
delegate_to: localhost
Loading