def _update_persistent_boot(self, device_type=[], persistent=False):
        """Changes the persistent boot device order in BIOS boot mode for host

        Note: It uses first boot device from the device_type and ignores rest.

        :param device_type: ordered list of boot devices
        :param persistent: Boolean flag to indicate if the device to be set as
                           a persistent boot device
        :raises: IloError, on an error from iLO.
        :raises: IloCommandNotSupportedError, if the command is not supported
                 on the server.
        """
        tenure = 'Once'
        new_device = device_type[0]
        # If it is a standard device, we need to convert in RIS convention
        if device_type[0].upper() in DEVICE_COMMON_TO_RIS:
            new_device = DEVICE_COMMON_TO_RIS[device_type[0].upper()]

        if persistent:
            tenure = 'Continuous'

        systems_uri = "/rest/v1/Systems/1"
        # Need to set this option first if device is 'UefiTarget'
        if new_device is 'UefiTarget':
            system = self._get_host_details()
            uefi_devices = (
                system['Boot']['UefiTargetBootSourceOverrideSupported'])
            iscsi_device = None
            for device in uefi_devices:
                if device is not None and 'iSCSI' in device:
                    iscsi_device = device
                    break

            if iscsi_device is None:
                msg = 'No UEFI iSCSI bootable device found'
                raise exception.IloError(msg)

            new_boot_settings = {}
            new_boot_settings['Boot'] = {'UefiTargetBootSourceOverride':
                                         iscsi_device}

            status, headers, response = self._rest_patch(systems_uri, None,
                                                         new_boot_settings)
            if status >= 300:
                msg = self._get_extended_error(response)
                raise exception.IloError(msg)

        new_boot_settings = {}
        new_boot_settings['Boot'] = {'BootSourceOverrideEnabled': tenure,
                                     'BootSourceOverrideTarget': new_device}
        status, headers, response = self._rest_patch(systems_uri, None,
                                                     new_boot_settings)
        if status >= 300:
            msg = self._get_extended_error(response)
            raise exception.IloError(msg)
def _update_persistent_boot ( self , device_type = [ ] , persistent = False ) : tenure = 'Once' new_device = device_type [ 0 ] if device_type [ 0 ] . upper ( ) in DEVICE_COMMON_TO_RIS : new_device = DEVICE_COMMON_TO_RIS [ device_type [ 0 ] . upper ( ) ] if persistent : tenure = 'Continuous' systems_uri = "/rest/v1/Systems/1" if new_device is 'UefiTarget' : system = self . _get_host_details ( ) uefi_devices = ( system [ 'Boot' ] [ 'UefiTargetBootSourceOverrideSupported' ] ) iscsi_device = None for device in uefi_devices : if device is not None and 'iSCSI' in device : iscsi_device = device break if iscsi_device is None : msg = 'No UEFI iSCSI bootable device found' raise exception . IloError ( msg ) new_boot_settings = { } new_boot_settings [ 'Boot' ] = { 'UefiTargetBootSourceOverride' : iscsi_device } status , headers , response = self . _rest_patch ( systems_uri , None , new_boot_settings ) if status >= 300 : msg = self . _get_extended_error ( response ) raise exception . IloError ( msg ) new_boot_settings = { } new_boot_settings [ 'Boot' ] = { 'BootSourceOverrideEnabled' : tenure , 'BootSourceOverrideTarget' : new_device } status , headers , response = self . _rest_patch ( systems_uri , None , new_boot_settings ) if status >= 300 : msg = self . _get_extended_error ( response ) raise exception . IloError ( msg )
Changes the persistent boot device order in BIOS boot mode for host

        Note: It uses first boot device from the device_type and ignores rest.

        :param device_type: ordered list of boot devices
        :param persistent: Boolean flag to indicate if the device to be set as
                           a persistent boot device
        :raises: IloError, on an error from iLO.
        :raises: IloCommandNotSupportedError, if the command is not supported
                 on the server.