Bug 1596662

Summary: Changing location of a VM via hammer fails if VMWare hot plugin is enabled.
Product: Red Hat Satellite Reporter: Shivdutt Bharadwaj <shbharad>
Component: Compute Resources - VMWareAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3.1CC: akarimi, akarsale, apatel, bkearney, chrobert, dhlavacd, emil.sylvio.golinelli, kgaikwad, lhellebr, mbacovsk, mhulan, oezr, rabajaj, rajgupta, shisingh
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-15 16:57:36 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 Shivdutt Bharadwaj 2018-06-29 12:04:42 UTC
Description of problem: Changing location of a VM via hammer fails if VMWare hot plugin feature is enabled and VM is powered ON.

Basically if satellite is not able to verify all vm attributes in a compute resource, it won't allow to update the host of that compute resource.

NOTE: Same is possible via GUI from bulk actions.

Case 1 - 
For VMWare (VM is on and hot plugin is enabled on both satellite as well as VMWare)-

# hammer host update --name=hostname --location=$LOC
Could not update the host:
  Failed to update a compute $COMPUTE_RESOURCE (VMware) instance $INSTANCE_NAME: InvalidPowerState: The attempted operation cannot be performed in the current state (Powered on).

Case 2 -
For libvirt (if communication breaks from satellite to KVM)-

# hammer host update --name=hostname --location=$LOC

 Failed to create a compute $COMPUTE_RESOURCE (Libvirt) instance $INSTANCE_NAME: undefined method `name' for nil:NilClass


Version-Release number of selected component (if applicable):
hammer (0.11.0.1)
 * hammer_cli_csv (unknown version)
 * hammer_cli_foreman (0.11.0.5)
 * hammer_cli_foreman_admin (0.0.8)
 * hammer_cli_foreman_bootdisk (0.1.3.3)
 * hammer_cli_foreman_discovery (1.0.0)
 * hammer_cli_foreman_docker (unknown version)
 * hammer_cli_foreman_openscap (unknown version)
 * hammer_cli_foreman_remote_execution (unknown version)
 * hammer_cli_foreman_tasks (unknown version)
 * hammer_cli_foreman_virt_who_configure (unknown version)
 * hammer_cli_katello (0.11.3.5)


How reproducible: Always


Steps to Reproduce:
1. Update host location via hammer. Host should be a VMWare host and hotplugin feature should be enabled from both satellite and VMWare end. 
2. Update host location via hammer. Host should be a KVM host and compute resource should not be accessible.
3.

Actual results: Host update failed.


Expected results: Host update should succeed.


Additional info:

Comment 7 Marek Hulan 2019-02-07 13:51:30 UTC
Created redmine issue https://projects.theforeman.org/issues/26012 from this bug

Comment 11 Ondřej Ezr 2019-05-15 16:57:36 UTC
This one is duplicating a solved bug, closing as duplicate.

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