Cannot delete PXE Boot Menu option with tooltop on disabled Delete button showing option is in use.

book

Article ID: 180046

calendar_today

Updated On:

Products

Deployment Solution Ghost Solution Suite

Issue/Introduction

 

Resolution

Problem

When attempting to delete a PXE Boot Menu option, the Delete button is grayed out and PXE Configuration Utility is showing "In use by DS". The following screen shot shows this behavior with the DOS Managed menu option.

Error message:

This item cannot be deleted because it is in use by GSS.

Environment
Deployment Solution 6.5 through 6.9, all versions.
Ghost Solution Suite 3.x

Cause
The reason that the Delete button is grayed out is not because of a bug in the software, but rather an attempt to prevent users from deleting a menu option if any jobs are referring to them. If a job is specifically using a PXE boot menu option, if that option were to be removed there would be orphaned data in the Deployment Server database.

Resolution

The best resolution to this issue is to find the jobs that are referring to the PXE Menu Option that is being deleted, and then change those jobs to use another PXE Menu option so that they no longer have that dependency. In many environments a user will have many jobs with multiple tasks and it can be a little difficult to go through all of those jobs manually to find if any given task is using the PXE Menu Option in question.

The following SQL queries help make identifying jobs that are using a PXE Boot Menu and changing those jobs much easier. Simply copy these SQL statements into a query analyzer and run them against your Deployment Server database, after customizing the SET @PXENAME = entry information.

1. The first query will show you the job name of all jobs that are using the specified PXE Menu Option. You will need to change the line where it shows SET @PXENAME = to be the name of the PXE Menu Option you are looking for.

/* The following SQL Query will show all jobs that use a specific PXE Menu Option */
USE eXpress
DECLARE @PXENAME AS VARCHAR(40)
/*Change the value below to the PXE Menu Option name*/
SET @PXENAME = 'DOS Managed'

SELECT event.name AS 'Job Name' FROM event, task, boot_options
WHERE boot_options.pxe_description = @PXENAME AND
boot_options.bootoption_id = task.bootoption_id AND
task.event_id = event.event_id

2. The next query will actually change all of the jobs that the first query returned to use the option Default Automation instead of the specific PXE Menu option that they where using previously. Once again you will need to change the line that shows SET @FROM = to reflect the option you want to change from. 

/* The following SQL Query will change all jobs from the specified PXE Menu Option to Default Automation */
USE eXpress
DECLARE @FROM AS VARCHAR(255)

SET @FROM = 'Linux Managed 2' --Name of the option you want to change from

UPDATE task SET bootoption_id = 1, boot_image_cpu_arch = 0
WHERE  bootoption_id = (SELECT bootoption_id FROM boot_options WHERE pxe_description = @FROM)
After running these queries and making these changes, you should be able to delete the PXE Menu Option with no problem.

3. The following query will allow you to change all jobs pointing to a specified menu option to a new menu option:

          /* The following SQL Query will change all jobs from the specified PXE Menu Option to a new one */
          USE eXpress
          DECLARE @FROM AS VARCHAR(255)
          DECLARE @TO AS VARCHAR(255)

          SET @FROM = 'DOS Managed' --Name of the PXE Menu option you want to change from
          SET @TO = 'Linux Managed' --Name of the PXE Menu option you want to change to

          UPDATE task SET bootoption_id = (SELECT bootoption_id FROM boot_options WHERE pxe_description = @TO)
          WHERE  bootoption_id = (SELECT bootoption_id FROM boot_options WHERE pxe_description = @FROM)

While the previous queries work just fine, you may want to use a more complex query that returns task number in job, task type and folder in addition to the job name to make the tasks easier to find in case you have many of them. The following query returns list of all tasks that have an associated PE. To limit the results replace % with the name of PE you are looking for.

SELECT
e.[name] AS [Job Name],
t.task_seq+1 AS [Task # in Job],
LOWER(SUBSTRING(tt.name, 10, LEN(tt.name))) AS [Task Type],
ef.[name] AS [Folder],
bo.pxe_description AS [PE]
FROM [Task] t
JOIN [Event] e ON t.event_id = e.event_id
JOIN task_type tt ON t.task_type = tt.task_type
LEFT JOIN event_folder ef ON e.folder_id = ef.folder_id
LEFT JOIN boot_options bo ON t.bootoption_id = bo.bootoption_id
WHERE bo.pxe_description LIKE '%' /* Replace % with PE name*/
ORDER BY PE, t.event_id

 

Attachments