Bug 2247081

Summary: Provisioning vm host fails with error "Failed to attach ISO image to CDROM drive of instance client.example.com: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered on)".
Product: Red Hat Satellite Reporter: Ashish Patil <ashipati>
Component: Compute Resources - VMWareAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: sganar
Severity: high Docs Contact:
Priority: high    
Version: 6.13.4CC: ahumbe, chrobert, gtalreja, hlawatschek, lstejska, mhulan, momran, osousa, rlavi, saydas, sganar, sshtein, tasano, tharring, wpinheir, zhunting
Target Milestone: 6.15.0Keywords: PrioBumpGSS, Reopened
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman_bootdisk-21.2.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2257316 2257415 (view as bug list) Environment:
Last Closed: 2024-04-23 17:15:30 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:

Comment 2 Sayan Das 2023-10-31 08:01:54 UTC
// For Public Visibility // 


Description of problem:

 - Provisioning virtual machines in the VMware platform vSphere 8.0 via satellite version 6.13.4 using the Bootdisk Method (BIOS and UEFI) failed to create the host with the error.

Version-Release number of selected component (if applicable):
 
Satellite 6.13.4 + VMware vSphere 8 ( compute resource )

How reproducible:

 100% ( for the affected end-users )

Steps to Reproduce:

1. Provision a VM using the Satellite server with the Bootdisk Auto-Attach method on a VMware vSphere 8 compute resource. 
2. Check if the deployment is getting completed.

Actual results:

  ==========================
  [W|app|eb9fe95d] Failed to attach ISO image to CDROM drive of instance client.example.com: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered on).
  [I|app|eb9fe95d] Backtrace for 'Failed to attach ISO image to CDROM drive of instance client.example.com: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered on).' error (RbVmomi::Fault): InvalidPowerState: The attempted operation cannot be performed in the current state (Powered on).
   eb9fe95d | /usr/share/gems/gems/rbvmomi2-3.6.0/lib/rbvmomi/vim/Task.rb:15:in `wait_for_completion'
   eb9fe95d | /usr/share/gems/gems/fog-vsphere-3.6.2/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb:10:in `vm_reconfig_hardware'
   eb9fe95d | /usr/share/gems/gems/fog-vsphere-3.6.2/lib/fog/vsphere/requests/compute/vm_reconfig_cdrom.rb:32:in `vm_reconfig_cdrom'
   eb9fe95d | /usr/share/gems/gems/foreman_bootdisk-21.0.3/app/models/concerns/foreman_bootdisk/compute_resources/vmware.rb:43:in `iso_attach'
   eb9fe95d | /usr/share/gems/gems/foreman_bootdisk-21.0.3/app/models/concerns/foreman_bootdisk/orchestration/compute.rb:63:in `bootdisk_attach_iso'
   eb9fe95d | /usr/share/gems/gems/foreman_bootdisk-21.0.3/app/models/concerns/foreman_bootdisk/orchestration/compute.rb:89:in `setAttachIsoImage'
  ==========================

Expected results:

 The host should be provisioned without any error and the error should happen neither during ATTACH nor DETACH of the CDROM drive

Comment 5 Waldirio M Pinheiro 2023-11-01 00:22:26 UTC
Hello,

Just to keep on track, Satellite 6.13 supports vCenter version 6.x and 7.x. At this moment, we have no support for vCenter 8.x, which is the main idea of bugzilla [1].

Here is the doc.

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.13/html-single/provisioning_hosts/index#Creating_a_VMware_User_vmware-provisioning

Best
Waldirio

[1]. https://bugzilla.redhat.com/show_bug.cgi?id=2247345

Comment 6 Ron Lavi 2023-11-06 13:40:04 UTC

*** This bug has been marked as a duplicate of bug 2247345 ***

Comment 8 Sayan Das 2023-12-05 12:09:47 UTC
I hope that the QE team will test the fix on both vCenter 7 as well as 8u2, once the BZ moves to ON_QA stage

Comment 9 sganar 2023-12-19 18:27:00 UTC
Verified.

Tested on Satellite 6.15.0 Snap 3.0
rubygem-foreman_bootdisk-21.2.1-1.el8sat.noarch

Steps followed: 
1. Configure the satellite for provisioning and create the VMware CR
2. Provision a host on VMware using the bootdisk method

Observation: 
1. Tested on vCenter 7 as well as 8
2. The host provisioned without any issues.

One thing to note is after the host is successfully provisioned, the build status still shows `Pending Installation` on VMware 8 but the host is successfully registered and has content access through repos from AK, it just displays the wrong status(this is the only case when provisioning via Bootdisk but Network, Image-based shows correct build status as Installed)

`Everything works fine on VMware 7`

I am going to open a new BZ to track this issue, not going to block verification of this BZ as the main issue of this BZ is resolved.

Comment 10 sganar 2024-02-06 06:45:05 UTC
The above is tested for both VMware Vcenter 7 as well as VMware Vcenter 8.0.2(22380479)

Comment 13 errata-xmlrpc 2024-04-23 17:15:30 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 (Important: Satellite 6.15.0 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-2024:2010