Integration of Storage Redirection
- Intel AMT device has met the redirection requirements
- Management point initiating connection to Intel AMT clients
- Mount the drive on the Intel AMT client by setting the redirection interface.
- Reboot the Intel AMT client to the appropriate interface.
- Storage redirection must be enabled in the BIOS Extension (CSME or MEBX) of the Intel AMT device. The CSME contains a setting to enable or disable storage capabilities. This setting can only be changed by manually entering the MEBX and then rebooting the platform.These settings must be enabled or the HLAPI will throw exceptions. These exceptions are represented by instances of the ManageabilityException class, and have the following message property: “The IDE-R interface is enabled.”
- The Intel AMT device contains a setting for each of the interfaces.In this case the interfaces can only be enabled remotely prior to establishing the storage redirection session. Enabling the interface requires administration privileges on the Intel AMT device (PT_administration Realm). This task is performed by using the SetInterfaceState method:amt.RedirectionIDER.SetInterfaceState(true);
- The redirection listener must be enabled for the redirection to occur.The redirection WS-Management interface is utilized to enable the Intel AMT redirection listener sockets. The HLAPI saves the current state of the listener before opening a SOL/storage redirection session. The listener will be enabled automatically if it is closed. After the session is closed, the HLAPI restores the listener to the state it was in before the session started.
- Initiate the connection.Using the HLAPI, we can easily make the connection and authenticate with the firmware, the solution will require the use of several files; HLAPI.dll, imrsdk.dll, and IWSManClient.dll.This is done by creating an object for each Intel AMT device. The instance is created using the AMTInstanceFactory.Create method and the IAMTInstance interface. For example:using Intel.Manageability; using Intel.Manageability.Exceptions; ConnectionInfoEX connection = new ConnectionInfoEX(host, username, password, secure, certificate, auth, proxy, redirectionProxy, tcpForwarder); IAMTInstance amt = AMTInstanceFactory.CreateEX(connection);
- Mount the image file to the Intel AMT device.Next, we need to use the storage redirection API in order to mount the remote image for the device:amt.RedirectionIDER.SetInterfaceState(true); amt.RedirectionIDER.StartIDERCD("C:\\MYCD.iso"); IDERState w = amt.RedirectionIDER.CurrentSessionState; IDERStatistics statistics = amt.RedirectionIDER.GetStatistics(); Console.WriteLine("PacketsReceived: " + statistics.PacketsReceived); amt.RedirectionIDER.StopIDER(); amt.RedirectionIDER.SetInterfaceState(false); amt.RedirectionIDER.Dispose();
- Set the boot source.Now that we have mounted the drive to the Intel AMT device, we need to set the boot source prior to rebooting the device to the image file. In order to do this we need to use the Boot Control API from the Intel AMT HLAPI.
- The first step will determine the current boot control settings:spaceBootSource bootSource; FirmwareVerbosityEnum FWVerbosity; amt.BootControl.GetCurrentSettings(out bootSource, out bootOptions, out FWVerbosity); Console.WriteLine("Current boot Options: " + bootOptions.ToString()); Console.Write("Current boot Source: " + bootSource.Source.ToString()); Console.WriteLine(". index: " + bootSource.Index.ToString()); Console.WriteLine("Current Firmware Verbosity: " + FWVerbosity.ToString());
- Now we need to set the next SetNextBoot options to use the mounted drive:spaceBootCapabilities bootCapabilities = amt.BootControl.BootCapabilities; BootSource bootSource; if (bootCapabilities.IDER) bootSource = new BootSource(BootSourceEnum.IDERCD); else bootSource = new BootSource(BootSourceEnum.NONE); BootOptionsFlags flags = BootOptionsFlags.NONE; if (bootCapabilities.SOL) flags |= BootOptionsFlags.UseSOL; if (bootCapabilities.BiosSetup) flags |= BootOptionsFlags.BiosSetup; FirmwareVerbosityEnum FWverbosity = FirmwareVerbosityEnum.NONE; if (bootCapabilities.FirmwareVerbosityVerbose) FWverbosity = FirmwareVerbosityEnum.Verbose; amt.BootControl.SetNextBoot(bootSource, flags, FWverbosity);
- Reboot the Intel AMT device.Next we need to perform the actual reboot of the Intel AMT device by adding a line of code from the Power API. For example:amt.Power.Reset();
- Clear the next boot setting.As the next boot setting is still specifying the mounted iso file, we need to clear the BootControl options, for example:amt.BootControl.ClearBootOptions();