As part of the pre-migrations phase, we perform steps to temporary disable functionality to make sure the upgrades are run in isolation from outside, e.g. * Disable enabled sync plans, stores information about the disabled sync plans to file to be able to restore it in SyncPlans::Enable * Disable external traffic on port 443 to prevent the interference with the system while the uprade runs The commands to work with the maintenance-mode: 1. foreman-maintain maintenance-mode status Shows the status of the maintenance mode. Possible values: * off - the maintenance mode is off * on - the maintenance mode is on * partially on - there were some steps of the maintenance mode already set, while some parts were not * not available - since foreman-maintain can run not only the satellite, on some installations (such as clients), this might not be avaiable 2. foreman-maintain maintenance-mode on Runs the steps to enable the maintenance mode 3. foreman-maintain maintenance-mode off Runs the steps to disable the maintenance mode The exact steps to turn the maintenance mode on/off might differ from different versions and server vs proxy.
*** 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.