def clean_up_instance(self, task): """Cleans up the boot of instance. This method cleans up the environment that was setup for booting the instance. It unlinks the instance kernel/ramdisk in node's directory in tftproot and removes the PXE config. :param task: a task from TaskManager. :returns: None """ node = task.node try: images_info = pxe_utils.get_instance_image_info( task, ipxe_enabled=self.ipxe_enabled) except exception.MissingParameterValue as e: LOG.warning( 'Could not get instance image info ' 'to clean up images for node %(node)s: %(err)s', { 'node': node.uuid, 'err': e }) else: pxe_utils.clean_up_pxe_env(task, images_info, ipxe_enabled=self.ipxe_enabled) boot_mode_utils.deconfigure_secure_boot_if_needed(task)
def clean_up_instance(self, task): """Cleans up the boot of instance. This method cleans up the environment that was setup for booting the instance. :param task: A task from TaskManager. :returns: None """ LOG.debug("Cleaning up instance boot for " "%(node)s", {'node': task.node.uuid}) self._eject_all(task) boot_mode_utils.deconfigure_secure_boot_if_needed(task)
def clean_up_instance(self, task): """Cleans up the boot of instance. This method cleans up the environment that was setup for booting the instance. :param task: a task from TaskManager. :returns: None :raises: IRMCOperationError if iRMC operation failed. """ if task.node.driver_internal_info.get('boot_from_volume'): self._cleanup_boot_from_volume(task) return # Disable secure boot, if enabled secure boot boot_mode_utils.deconfigure_secure_boot_if_needed(task) _remove_share_file(_get_iso_name(task.node, label='boot')) driver_internal_info = task.node.driver_internal_info driver_internal_info.pop('irmc_boot_iso', None) task.node.driver_internal_info = driver_internal_info task.node.save() _cleanup_vmedia_boot(task)