|
| 1 | +--- |
| 2 | +title: Automate boot from SAN target configurations using Redfish |
| 3 | +date: 2023-06-01T20:13:38.207Z |
| 4 | +featuredBlog: false |
| 5 | +author: HPE Global Sales Engineering (GSE) team |
| 6 | +authorimage: /img/Avatar5.svg |
| 7 | +disable: false |
| 8 | +tags: |
| 9 | + - redfish |
| 10 | + - restapi |
| 11 | + - ilo-restful-api |
| 12 | +--- |
| 13 | +As the scale and complexity of infrastructure deployed in a customer environment increases, the need for consistency, ease of management and agility in responding to the changing needs of the infrastructure consumers becomes a key priority for IT staff. Operational efficiency has become a key business imperative for customers hosting any large IT footprint, and the operational efficiency gains are often achieved through automation of repetitive tasks performed by IT staff to deploy, manage, and operate IT infrastructure. |
| 14 | + |
| 15 | +There are several use-cases of infrastructure automation that exist, and in this blog post we will address the aspect of configuration of OS boot for a server from a Storage Area Network (SAN) based storage array. Specifically, we will discuss the procedure for configuring an HPE ProLiant DL Gen10, Gen10 plus and Gen11 servers to boot from a SAN target Logical Unit Number (LUN) using the Redfish® standard DMTF API. |
| 16 | + |
| 17 | +**Note**: |
| 18 | + |
| 19 | +* The steps outlined in this document were tested on HPE DL 380 Gen10 and Gen10 plus servers with Emulex based SN1610E FibreChannel (FC) cards, HPE iLO firmware 2.81 and Service Pack for ProLiant (SPP) available as of March 2023. |
| 20 | +* QLogic SN1610Q cards do not support the steps outlined in this document (as of April 2023). However, future firmware releases might enable this Redfish API-based configuration method. |
| 21 | + |
| 22 | +# Pre-requisite information |
| 23 | + |
| 24 | +Before we dive into the steps for performing the automation, you will need to gather a few pieces of information, such as |
| 25 | + |
| 26 | +* HPE iLO Management port IP address and credentials. |
| 27 | +* Storage target World Wide Number (WWN) and LUN id. A storage administrator can typically provide you with this information. |
| 28 | + |
| 29 | +Download and install the [HPE RESTful Interface Tool](https://www.hpe.com/info/resttool) (version 4.1.0.0 or later) on the system you will initiate the automation actions from. |
| 30 | + |
| 31 | + |
| 32 | +Once the RESTful Interface tool (referred to as iLOREST in the remainder of the document) has been installed, you can review the current boot target and their order of execution by following the steps below |
| 33 | + |
| 34 | +`ilorest login <ilo-ip> -u <ilo-user> -p password` |
| 35 | + |
| 36 | +`ilorest bootorder` |
| 37 | + |
| 38 | +Refer to the iLOREST[documentation](https://hewlettpackard.github.io/python-redfish-utility/#bootorder-command) for more information on this command. |
| 39 | + |
| 40 | +# Configuration Steps |
| 41 | + |
| 42 | +Now that you have gathered the pre-requisite information and installed the iLOREST tool, let’s discuss the detailed steps for implementing the automation. |
| 43 | + |
| 44 | +## Step 1: Ensure that the `FCScanPolicy` value is set to ‘AllTargets’ |
| 45 | + |
| 46 | +```markdown |
| 47 | +ilorest get FCScanPolicy --selector Bios |
| 48 | +``` |
| 49 | + |
| 50 | +Expected output: |
| 51 | + |
| 52 | +```markdown |
| 53 | +FCScanPolicy=AllTargets |
| 54 | +``` |
| 55 | + |
| 56 | +If the value is not set to AllTargets, you can change it using the following: |
| 57 | + |
| 58 | +```markdown |
| 59 | +ilorest set "FCScanPolicy"="AllTargets" --selector Bios |
| 60 | + |
| 61 | +ilorest commit |
| 62 | + |
| 63 | +ilorest reboot |
| 64 | +``` |
| 65 | + |
| 66 | +**Note**: |
| 67 | + |
| 68 | +After restarting the server, remember to retrieve the updated Bios settings from the iLO of the server with the following command: |
| 69 | + |
| 70 | +```markdown |
| 71 | +ilorest select Bios. --refresh |
| 72 | +``` |
| 73 | + |
| 74 | +You can monitor the server restart state and continue the configuration when it reaches the `FinishedPost` state, and the `vMainDeviceDiscoveryComplete` device discovery state. More details about monitoring server state is described in this [article](https://developer.hpe.com/blog/master-the-redfish-server-states-to-improve-your-monitoring-and-manageme/). |
| 75 | + |
| 76 | +The server state can be retrieved with the following command: |
| 77 | + |
| 78 | +```markdown |
| 79 | +ilorest serverstate |
| 80 | +``` |
| 81 | + |
| 82 | +The device discovery state can be obtained with the following commands: |
| 83 | + |
| 84 | +```markdown |
| 85 | +ilorest select ComputerSystem. --refresh |
| 86 | + |
| 87 | +ilorest get Oem/Hpe/DeviceDiscoveryComplete/DeviceDiscovery --json |
| 88 | +``` |
| 89 | + |
| 90 | +After restarting the server, you can verify that the settings have taken effect using the BIOS menus as shown in Figure 1 or using the commands: |
| 91 | + |
| 92 | +``` |
| 93 | +ilorest select Bios. --refresh |
| 94 | +
|
| 95 | +ilorest get FCScanPolicy |
| 96 | +``` |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +## Step 2: Identify the right FC Card |
| 101 | + |
| 102 | +The server you are trying to configure might have one or more FC cards in it, and you need to identify the right card using the steps below. |
| 103 | + |
| 104 | +List out available network adapters (includes FC cards) |
| 105 | + |
| 106 | +```markdown |
| 107 | +ilorest rawget /redfish/v1/Chassis/1/NetworkAdapters/ |
| 108 | +``` |
| 109 | + |
| 110 | +The previous command returns the following output: |
| 111 | + |
| 112 | +```json |
| 113 | +{ |
| 114 | + |
| 115 | + "@odata.context": "/redfish/v1/$metadata#NetworkAdapterCollection.NetworkAdapterCollection", |
| 116 | + |
| 117 | + "@odata.etag": "W/"F09DE05C"", "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/", |
| 118 | + |
| 119 | + "@odata.type": "#NetworkAdapterCollection.NetworkAdapterCollection", |
| 120 | + |
| 121 | + "Description": "The collection of network adapter resource instances available in this chassis.", |
| 122 | + |
| 123 | + "Members": [ |
| 124 | + |
| 125 | + { "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DC080000/" }, |
| 126 | + |
| 127 | + { "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DE083000/" }, |
| 128 | + |
| 129 | + { "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DE081000/" }, |
| 130 | + |
| 131 | + { "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/DE07B000/" } |
| 132 | + |
| 133 | + ], |
| 134 | + |
| 135 | + |
| 136 | +… |
| 137 | +``` |
| 138 | + |
| 139 | +Make a note of the device IDs in the output above - DC080000, DE083000, DE081000, DE07B000. The values for these items might be different on the server you are using. |
| 140 | + |
| 141 | +Query these items using the device ID to verify it is the right FC card that you would like to configure, for example using DE083000 device (your output and device IDs might be different). |
| 142 | + |
| 143 | +```markdown |
| 144 | +ilorest rawget /redfish/v1/Chassis/1/NetworkAdapters/DE083000 |
| 145 | +``` |
| 146 | + |
| 147 | +Look for the following in the output. |
| 148 | + |
| 149 | +```markdown |
| 150 | +"Location": { |
| 151 | + "PartLocation": { |
| 152 | + "LocationOrdinalValue": 4, |
| 153 | + "LocationType": "Slot", |
| 154 | + "ServiceLabel": "PCI-E Slot 4" |
| 155 | + } |
| 156 | +… |
| 157 | + |
| 158 | +"Manufacturer": "Hewlett Packard Enterprise", |
| 159 | + |
| 160 | +"Model": "HPE StoreFabric SN1610E 32Gb 2-port Fibre Channel Host Bus Adapt", |
| 161 | + |
| 162 | +"Name": "HPE SN1610E 32Gb 2p FC HBA" |
| 163 | +``` |
| 164 | + |
| 165 | +The above values can help you ascertain that you have the right card, and its device ID. |
| 166 | + |
| 167 | +## Step 3: Verify that Redfish configuration is Enabled |
| 168 | + |
| 169 | +Before you can change the boot from SAN configurations on an FC card, you will have to set `RedfishConfiguration` key to "Enabled" for the specific adapter, if it has not already been done. |
| 170 | + |
| 171 | +The current value of this key can be viewed by querying the adapter. |
| 172 | + |
| 173 | +```markdown |
| 174 | +ilorest rawget /redfish/v1/Chassis/1/NetworkAdapters/DE083000 |
| 175 | +``` |
| 176 | + |
| 177 | +If the value is not set, please perform the following steps: |
| 178 | + |
| 179 | +1. Create a file named enable-redfish.txt with the following contents |
| 180 | + |
| 181 | + ```json |
| 182 | + { |
| 183 | + "/redfish/v1/Chassis/1/NetworkAdapters/DE083000/": |
| 184 | + { |
| 185 | + "Oem": |
| 186 | + { |
| 187 | + "Hpe": |
| 188 | + { |
| 189 | + "RedfishConfiguration": "Enabled" |
| 190 | + } |
| 191 | + } |
| 192 | + } |
| 193 | + } |
| 194 | + ``` |
| 195 | +2. Apply this patch via iLOREST |
| 196 | + |
| 197 | + ```markdown |
| 198 | + ilorest rawpatch <file path>\enable-redfish.txt |
| 199 | + ``` |
| 200 | +3. To make this patch permanent, flush the configuration to the iLO NVRAM by creating a file name flushtonvm.txt, with the following contents: |
| 201 | + |
| 202 | + ```json |
| 203 | + { |
| 204 | + "/redfish/v1/Chassis/1/NetworkAdapters/DE083000/Actions/Oem/Hpe/HpeNetworkAdapter.FlushConfigurationToNVM/": |
| 205 | + { |
| 206 | + } |
| 207 | + } |
| 208 | + ``` |
| 209 | +4. Post the flush action via iLOREST |
| 210 | + |
| 211 | + ```markdown |
| 212 | + ilorest rawpost <file path>\flushtonvm.txt |
| 213 | + ``` |
| 214 | +5. Reboot the server |
| 215 | + |
| 216 | + ```markdown |
| 217 | + ilorest reboot |
| 218 | + ``` |
| 219 | + |
| 220 | +## Step 4: Set boot from SAN value to "Enable" for the adapter |
| 221 | + |
| 222 | +For each SN1610E adapter on your server that you would like to enable for SAN boot, there is a variable "BootMode" that needs to have a value of "FibreChannel". |
| 223 | + |
| 224 | +This can be viewed from BIOS configuration UI at the location shown in Figure 2. |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | +This value is part of the FC adapter configuration, and is visible in the output of the following command: |
| 229 | + |
| 230 | +```markdown |
| 231 | +ilorest rawget /redfish/v1/Chassis/1/NetworkAdapters/DE083000/NetworkDeviceFunctions/1/ |
| 232 | +``` |
| 233 | + |
| 234 | +Look for "BootMode" in the output generated. |
| 235 | + |
| 236 | +To modify the value of this property, |
| 237 | + |
| 238 | +1. Create a file named enable-sanboot.txt with the following: |
| 239 | + |
| 240 | + ```json |
| 241 | + { |
| 242 | + "/redfish/v1/Chassis/1/NetworkAdapters/DE083000/NetworkDeviceFunctions/1/": |
| 243 | + { |
| 244 | + "BootMode":"FibreChannel" |
| 245 | + } |
| 246 | + } |
| 247 | + ``` |
| 248 | +2. Apply this patch via iLOREST |
| 249 | + |
| 250 | + ```markdown |
| 251 | + ilorest rawpatch <file path>\enable-sanboot.txt |
| 252 | + ``` |
| 253 | +3. Flush or commit the changes to ilo NVM using the flushtonvm.txt file created before |
| 254 | + |
| 255 | + ```markdown |
| 256 | + ilorest rawpost <file path>\flushtonvm.txt |
| 257 | + ``` |
| 258 | + |
| 259 | + ## Step 5: Create the SAN boot target entry |
| 260 | + |
| 261 | + Once the boot from SAN is enabled on the FC card, you will need to create a mapping for the Storage LUN that would be used as a boot entry for the server. |
| 262 | + |
| 263 | + This entry is created within the BootTargets collection for the Port on the Adapter. |
| 264 | + |
| 265 | + ```markdown |
| 266 | + ilorest rawget /redfish/v1/Chassis/1/NetworkAdapters/DE083000/NetworkDeviceFunctions/1/ |
| 267 | + ``` |
| 268 | + |
| 269 | + In the output, look for entries such as: |
| 270 | + |
| 271 | + ```json |
| 272 | + "FibreChannel": { |
| 273 | + "BootTargets": [ |
| 274 | + { |
| 275 | + "BootPriority": 0, |
| 276 | + "LUNID": "00:00:00:00:00:00:00:00", |
| 277 | + "WWPN": "00:00:00:00:00:00:00:00" |
| 278 | + } |
| 279 | + ``` |
| 280 | + |
| 281 | + To create this entry, you will need to find out the Storage WWN and the LUN number exported to this server. |
| 282 | + |
| 283 | + 1. Create a patch file (example bootentry.txt file contents shown below). |
| 284 | + |
| 285 | + ```json |
| 286 | + { |
| 287 | + "/redfish/v1/Chassis/1/NetworkAdapters/DE083000/NetworkDeviceFunctions/1": |
| 288 | + { |
| 289 | + "FibreChannel": |
| 290 | + { |
| 291 | + "BootTargets":[ |
| 292 | + { |
| 293 | + "BootPriority": 0, |
| 294 | + "LUNID": "00:00:00:00:00:00:00:00", |
| 295 | + "WWPN": "00:00:00:00:00:00:00:C3" |
| 296 | + } |
| 297 | + ] |
| 298 | + } |
| 299 | + } |
| 300 | + } |
| 301 | + ``` |
| 302 | + 2. Apply this patch file via iLOREST |
| 303 | + |
| 304 | + ```markdown |
| 305 | + ilorest rawpatch <file path>\bootentry.txt |
| 306 | + ``` |
| 307 | + 3. Commit the changes by flashing the ilo NVRAM using the flushtonvm.txt file created before. |
| 308 | + |
| 309 | + ```markdown |
| 310 | + ilorest rawpost <file path>\flushtonvm.txt |
| 311 | + ``` |
| 312 | + 4. Restart the server. |
| 313 | + |
| 314 | + ```markdown |
| 315 | + ilorest reboot |
| 316 | + ``` |
| 317 | + 5. Once the server has restarted, you can view the boot order to verify that the new entry for the SAN boot target has been created. |
| 318 | + |
| 319 | + ```markdown |
| 320 | + ilorest bootorder |
| 321 | + ``` |
| 322 | + |
| 323 | + # Summary |
| 324 | + |
| 325 | + In this blog post, we have learnt how easy it is to automate the configuration of boot from SAN targets for HPE servers using the iLOREST tool. There are other aspects of server provisioning, monitoring, and management that you can automate with this tool and using the Redfish API interface supported by HPE iLO. |
| 326 | + |
| 327 | + To learn more about these topics, check out [HPE Developer portal](https://developer.hpe.com/search/?term=redfish) for additional blogs and technical articles. |
0 commit comments