Bug 712231

Summary: CDS Force Remove Option
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Jay Dobies <jason.dobies>
Component: DocumentationAssignee: Lana Brindley <lbrindle>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0CC: kbidarka, mhideo, sghai, tsanders
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-29 04:50:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jay Dobies 2011-06-09 20:53:06 UTC
I made a small change to how CDS unregister works.

When the unregister call is made, the RHUA server attempts to contact the CDS to tell it to clean up itself. This clean up includes things such as stopping hosting its repositories.

The problem is, if the CDS is down, either because it can't be contacted or the instance itself has died, there was no way to remove it since that call to the CDS would fail.

I added a "force" option to the CDS unregister in these cases to allow the user to remove it from the database even if that call fails. It's not the default; they need to explicitly acknowledge that the CDS hasn't properly cleaned itself up yet they still want to remove it.

In terms of RHUI Manager, that's done with a two step process:
- Attempt to cleanly unregister the CDS.
- For all CDS instances that fail this call (remember you can select more than one CDS at a time), we tell the user which ones failed and warn them about the force option.
- The user can elect the force option and the call will take place again, removing them from the database even if the CDS is unaccessible.

You might want to note that if a CDS is not cleanly unregistered, it will not be able to be registered again until a manual step is taken. When a CDS is registered, it exchanges a secret with the RHUA so that only that RHUA can communicate with it. This secret is removed on the unregister call to the CDS. If that unregister call does not happen, the user will have to explicitly remove the following file from the CDS before it can be reregistered:

/var/lib/pulp-cds/.gofer/secret

Comment 1 Jay Dobies 2011-06-09 20:55:21 UTC
Below is an example of what happens when trying to removed a downed CDS. I'm open to changes to the warning message before the force delete if you can think of any.



------------------------------------------------------------------------------
rhui (cds) => d

Select the CDS instances to be removed from the RHUI: 
  -  1 : CDS 1
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1

Select the CDS instances to be removed from the RHUI: 
  x  1 : CDS 1
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


All previously deployed repositories will be deleted when a CDS is unregistered.

The following CDS instances will be unregistered:
  CDS 1
Proceed? (y/n) y


Unregistering CDS 1...

The following CDS instances could not be contacted to be unregistered.
They may still be removed from the RHUI database, however the RHUI is unable
confirm that they have stopped hosting repositories.
  CDS 1

Forcibly remove these CDS instances? (y/n)y

Forcibly unregistering CDS 1...

------------------------------------------------------------------------------
rhui (cds) => l

-= RHUI Content Delivery Servers =-

No CDS instances are registered.

------------------------------------------------------------------------------
rhui (cds) =>

Comment 2 Lana Brindley 2011-06-23 01:37:36 UTC
<step performance="optional">
	<para>
		RHUI Manager contacts the CDS to ensure it is properly cleaned up when it is deleted. RHUI Manager is unable to delete a CDS instance that it cannot communicate with. However, there are some cases where you might need to remove an unresponsive CDS instance.
	</para>
	 <important>
	<title>Important</title>
		 <para>
			CDS instances exchange a secret with the RHUA so that only the RHUA is able to communicate with it. This secret is removed as part of the cleanup operation when a CDS is deleted normally. When a CDS instance is forcibly removed without being properly cleaned up, this secret is not deleted. You will not be able to register the CDS again until that secret has been removed. You can do this manually by deleting the <filename>/var/lib/pulp-cds/.gofer/secret</filename> file.
		</para>
	</important>
	 <para>
		When you attempt to perform a delete operation on a CDS instance that is not running, RHUI Manager will notify you that it is unable to delete the CDS, and ask if you want to forcibly remove the CDS. Type <userinput>y</userinput> to forcibly remove the unresponsive CDS:
	</para>
	 <warning>
	<title>Warning</title>
		 <para>
			Be very careful with this command. If you delete a CDS instance that is not running, RHUI Manager cannot confirm that the CDS instance is not hosting repositories.
		</para>
	</warning>
<screen>
------------------------------------------------------------------------------
rhui (cds) =&gt; d

Select the CDS instances to be removed from the RHUI: 
  -  1 : CDS 1
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for
more commands: 1

Select the CDS instances to be removed from the RHUI: 
  x  1 : CDS 1
Enter value (1-1) to toggle selection, 'c' to confirm selections, or '?' for
more commands: c


All previously deployed repositories will be deleted when a CDS is
unregistered.

The following CDS instances will be unregistered:
  CDS 1
Proceed? (y/n) y


Unregistering CDS 1...

The following CDS instances could not be contacted to be unregistered.
They may still be removed from the RHUI database, however the RHUI is unable
confirm that they have stopped hosting repositories.
  CDS 1

Forcibly remove these CDS instances? (y/n)y

Forcibly unregistering CDS 1...
</screen>
</step>

Revision 1-14
LKB

Comment 3 Sachin Ghai 2011-06-28 03:03:56 UTC
Verified under chapter 6 ==> Content distribution Server (CDS) Instances of stage doc at

http://documentation-stage.bne.redhat.com/docs/en-US/Red_Hat_Update_Infrastructure/2.0/html/Installation_Guide/chap-Installation_Guide-Content_Distribution_Server_CDS_Instances.html


The complete procedure of CDS delete instance and with force option is explained under 
Chapter6 ==> Procedure 6.3. Delete a CDS Instance"

Comment 4 Lana Brindley 2011-07-29 04:50:27 UTC
This book is now available at http://docs.redhat.com/docs/en-US/Red_Hat_Update_Infrastructure/2.0/html/Installation_Guide/index.html

Please raise a new bug for any further changes.

LKB