Bug 1794753

Summary: ejecting the install media does not work
Product: Red Hat Satellite Reporter: Joachim Schiele <Joachim.Schiele2>
Component: ProvisioningAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Ondrej Gajdusek <ogajduse>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: inecas, lzap, rbeyel, sshtein, tonay, zhunting
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:08:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joachim Schiele 2020-01-24 14:33:17 UTC
Description of problem:
We are installing RHEL7/RHEL8 using a "Full host image" - ISO - on a vSphere client with "ESXi 6.5 and later (VM version 13)" but the CD-ROM is never ejected.

Version-Release number of selected component (if applicable):
RHEL8.1 using Satellite 6.5 to generate the ISO image.
RHEL7.7 using Satellite 6.5 to generate the ISO image.

How reproducible:
In the kickstart for rhel8 we tried:
  reboot --eject

In the kickstart for rhel7 we tried:
  eject -i 0 || true
  eject || true
  (eject -m -r &> /dev/null || :) &

	[root@myhost ~]# eject /dev/sr0 -v
	eject: device name is `/dev/sr0'
	eject: /dev/sr0: not mounted
	eject: /dev/sr0: is whole-disk device
	eject: /dev/sr0: is removable device
	eject: /dev/sr0: trying to eject using CD-ROM eject command
	eject: CD-ROM eject command succeeded

But after the actual reboot the ISO is still attached to the host and tries to restart the installation each time!

Expected results:

After a eject and reboot the freshly installed OS should boot.

Comment 3 Zach Huntington-Meath 2020-01-30 14:05:45 UTC
This is a provisioning bug, but the eject should not work.

Comment 4 Joachim Schiele 2020-02-03 15:06:14 UTC
@Zach Huntingto-Meath: You probably answered to your collegues and I can't see their replies but if not your answer does not make sense to me.

If I boot the installed system, and that can either be RHEL7 or RHEL8, then i can simply put in any ISO media and use eject and it will actually "eject" the media using "eject /dev/sg0" but the same does not work in the installer.

Any ideas welcome!

Comment 6 Lukas Zapletal 2020-12-09 16:09:13 UTC
Hello, have you tried "eject --force"?

Can you provide output of the "mount" command when eject does not work?

Can you also try this:

%post --nochroot
eject --force
%end

We need to isolate the problem so Anaconda team can take a look. I am wondering if I create a kickstart that will do:

%post
mount
eject --force
sleep 999
%end

Would reproduce the issue for them.

Comment 7 Marek Hulan 2020-12-18 09:19:11 UTC
I guess comment 6 was a needinfo for the reporter

Comment 8 Lukas Zapletal 2021-10-18 07:48:37 UTC
Joachim, are you still affected by this?

Comment 10 Lukas Zapletal 2021-10-26 08:58:18 UTC
This was fixed in Foreman Bootdisk 17.0 which ships with Satellite 6.10.

Guest operating system is not able to eject media, it needs to be done via VMWare API. Satellite 6.10+ will perform a call to VMWare to detach the bootdisk when host reports finished unattended installation via "curl http://satellite/unattended/finish".

https://projects.theforeman.org/issues/26824

Comment 13 Ondrej Gajdusek 2021-11-10 12:37:25 UTC
VERIFIED - RHEL 7 & RHEL 8

@Satellite 6.10.0 snap 25

The CDROM was successfully ejected after the host was provisioned.

From vSphere UI:
"CD/DVD drive 1      Disconnected"

Comment 15 errata-xmlrpc 2021-11-16 14:08:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702

Comment 16 Red Hat Bugzilla 2024-01-06 04:27:44 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days