Bug 1487559
Summary: | [RFE] foreman-maintain maintenance-mode command | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Ivan Necas <inecas> |
Component: | Satellite Maintain | Assignee: | Kavita <kgaikwad> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Jameer Pathan <jpathan> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | Unspecified | CC: | ahumbe, aupadhye, bbuckingham, bkearney, inecas, kgaikwad, lzap, mmccune, mvanderw, ofalk, peter.vreman, sthirugn, swadeley |
Target Milestone: | Unspecified | Keywords: | FutureFeature |
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: | 2020-03-05 16:17:26 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1122832, 1496794 |
Description
Ivan Necas
2017-09-01 09:27:51 UTC
*** Bug 1314742 has been marked as a duplicate of this bug. *** Created redmine issue http://projects.theforeman.org/issues/22198 from this bug *** Bug 1526749 has been marked as a duplicate of this bug. *** Upstream bug assigned to kgaikwad With Sat6.4 the system requirements are more reasonable now with 20GB memory and ~800GB disk space. For me this BZ can be closed as delivered with Sat6.4 Ivan, how are you with comment 10? Looks like i typed a comment in the wrong BZ, https://bugzilla.redhat.com/show_bug.cgi?id=1487559#c10 was meant for BZ https://bugzilla.redhat.com/show_bug.cgi?id=1408380 and has nothing to do with maintenance mode. Sorry for the confusion, Peter Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/22198 has been resolved. Verified -Satellite version: satellite-6.6.0-5.beta.el7sat.noarch -foreman-maintain version: rubygem-foreman_maintain-0.4.3-2.el7sat.noarch Steps: 1. "maintenance-mode" command # foreman-maintain maintenance-mode --help Usage: foreman-maintain maintenance-mode [OPTIONS] SUBCOMMAND [ARG] ... Parameters: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands: start Start maintenance-mode stop Stop maintenance-mode status Get maintenance-mode status is-enabled Get maintenance-mode status code Options: -h, --help print help 2. "maintenance-mode status" command # foreman-maintain maintenance-mode status Running Status of maintenance-mode ================================================================================ Check of maintenance-mode consistency: / Running status of maintenance-mode Status of maintenance-mode: Off - Iptables chain: absent - sync plans: empty data - cron jobs: not managed [OK] -------------------------------------------------------------------------------- 2. "maintenance-mode is-enabled" command # foreman-maintain maintenance-mode is-enabled Running Show only status code of maintenance-mode ================================================================================ Showing status code for maintenance_mode: Maintenance mode is Off [OK] -------------------------------------------------------------------------------- 1 3. "maintenance-mode start" command - Create few sync-plans and add ":manage_crond: true" in "/etc/foreman-maintain/foreman_maintain.yml" file to manage cron service. # foreman-maintain maintenance-mode start Running Start maintenance-mode ================================================================================ disable active sync plans: - Total 3 sync plans are now disabled. [OK] -------------------------------------------------------------------------------- Add maintenance_mode chain to iptables: [OK] -------------------------------------------------------------------------------- Stop cron service: Stopping the following service(s): crond \ All services stopped [OK] -------------------------------------------------------------------------------- - Information about the disabled sync plans is stored in "/var/lib/foreman-maintain/data.yml" file to be able to use it to re-enable sync plans. # cat /var/lib/foreman-maintain/data.yml --- :default: :sync_plans: :enabled: [] :disabled: - 1 - 2 - 3 4. Check status of maintenace-mode # foreman-maintain maintenance-mode status Running Status of maintenance-mode ================================================================================ Check of maintenance-mode consistency: / Running status of maintenance-mode Status of maintenance-mode: On - Iptables chain: present - sync plans: disabled - cron jobs: not running [OK] -------------------------------------------------------------------------------- # foreman-maintain maintenance-mode is-enabled Running Show only status code of maintenance-mode ================================================================================ Showing status code for maintenance_mode: Maintenance mode is On [OK] -------------------------------------------------------------------------------- 0 5. "maintenance-mode stop" command # foreman-maintain maintenance-mode stop Running Stop maintenance-mode ================================================================================ re-enable sync plans: \ Total 3 sync plans are now enabled. [OK] -------------------------------------------------------------------------------- Remove maintenance_mode chain from iptables: [OK] -------------------------------------------------------------------------------- Start cron service: Starting the following service(s): crond \ All services started [OK] -------------------------------------------------------------------------------- # foreman-maintain maintenance-mode status Running Status of maintenance-mode ================================================================================ Check of maintenance-mode consistency: / Running status of maintenance-mode Status of maintenance-mode: Off - Iptables chain: absent - sync plans: enabled - cron jobs: running [OK] -------------------------------------------------------------------------------- Observation: 1. "maintenance-mode status" gives status of: - maintenance-mode is On or Off. - Sync-plans enabled/disabled. - Whether maintenance_mode chain is added to iptables. - state of cron service 2. "maintenance-mode is-enabled" gives maintenance-mode status code, 0 when maintenance-mode is On and 1 if it's Off. 3. "maintenance-mode start" command: - Adds maintenance_mode chain to iptables. - Disables active sync-plans - stops cron service. (if manage_crond is set to true in "/etc/foreman-maintain/foreman_maintain.yml") 4. "maintenance-mode stop" command: - Removes maintenance_mode chain from iptables. - re-enables sync-plans which got disabled during "maintenance-mode start" - starts cron service. Additional info: - maintenance-mode subcommand is also supported on capsule for backup scenario as cron start/stop and iptables chain rule for 443 will work on capsule. Foreman Maintain won't run sync-plan procedures on capsule as it checks for feature katello. (Reference comment #20 ) The current version of foreman_maintain includes this fix. The current version of foreman_maintain includes this fix. |