Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1390619

Summary: When running bootstrap with the --force option, it deletes the host AND if it is associated to a virtual machine via a compute resource, the virtual machine also.
Product: Red Hat Satellite Reporter: Rich Jerrido <rjerrido>
Component: BootstrapAssignee: Rich Jerrido <rjerrido>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.3CC: bbuckingham, ehelms, jcallaha, jyejare, ktordeur, mmccune, oshtaier
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 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 Rich Jerrido 2016-11-01 14:16:29 UTC
Description of problem:
When running bootstrap with the --force option, it deletes the host AND if it is associated to a virtual machine via a compute resource, the virtual machine also. 

Version-Release number of selected component (if applicable):
katello-client-bootstrap-1.1.0-2.el7sat.noarch

How reproducible:
100%

Steps to reproduce:

- create a host
- associate it with a virtual machine
- register it via bootstrap.py using --force

Actual results
virtual machine is deleted (as bootstrap deletes the foreman host) 

Expected results. 

virtual machine is not deleted and it is disassociated from the foreman host first.

Comment 1 Rich Jerrido 2016-11-01 14:18:27 UTC
This was addressed in upstream commit (https://github.com/Katello/katello-client-bootstrap/commit/dab153ed587f805db8bc82cad75815315d342221). moving to POST

Comment 3 Jitendra Yejare 2017-12-15 07:38:33 UTC
As per discussion with Zhenech on steps to verify this bug:
```
<jyejare> Zhenech, Looking for steps
<Zhenech> jyejare: you'd need a sat6 with a configured compute resource, and a vm running on that said CR
<jyejare> Zhenech, i have internal libvirt running a VM
<Zhenech> jyejare: now if you open the VM in satellite, it should list it as running on the CR (= sat knows where it runs).
<Zhenech> jyejare: now you run bootstrap with --force (because the VM is already registered), before the patch sat6 would actually also delete the VM itself from libvirt
<Zhenech> jyejare: after the patch, only the host in satellite is deleted and re-created
```


AS per above steps:
1. I created VM on internal libvirt CR
2. The VM was registered to satellite using AK
3. I ran bootstrap on VM(content host) with force option


Observation:
1. The host was re-registered but VM was not deleted as expected.

Changing the state to Verified !

Comment 4 Satellite Program 2018-02-21 16:54:37 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, 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-2018:0336