Bug 906254 - packstack will fail if ntpd is running while ntpdate is executed
Summary: packstack will fail if ntpd is running while ntpdate is executed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: openstack-packstack
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Martin Magr
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-31 10:07 UTC by Sandro Mathys
Modified: 2016-08-30 11:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-30 11:26:33 UTC
Type: Bug


Attachments (Terms of Use)
proposed patch (728 bytes, text/plain)
2013-01-31 11:01 UTC, Sandro Mathys
no flags Details

Description Sandro Mathys 2013-01-31 10:07:56 UTC
Description of problem:
If one chooses to configure NTP servers, packstack will fail if ntpd is already running. The reason behind this is that both are sharing the same socket. Therefore ntpdate will print an error and return exit code 1, but packstack / puppet are expecting exit code 0.

Version-Release number of selected component (if applicable):
openstack-packstack-2012.2.2-0.7.dev346.el6.noarch


How reproducible:
Always

Steps to Reproduce:
1. Have ntpd already running (with default server configuration or whatever)
2. Tell packstack to configure NTP servers
3. See packstack fail
  
Actual results:
ERROR:root:Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/packstack/installer/run_setup.py", line 806, in main
    _main(confFile)
  File "/usr/lib/python2.6/site-packages/packstack/installer/run_setup.py", line 593, in _main
    runSequences()
  File "/usr/lib/python2.6/site-packages/packstack/installer/run_setup.py", line 569, in runSequences
    controller.runAllSequences()
  File "/usr/lib/python2.6/site-packages/packstack/installer/setup_controller.py", line 57, in runAllSequences
    sequence.run()
  File "/usr/lib/python2.6/site-packages/packstack/installer/setup_sequences.py", line 154, in run
    step.run()
  File "/usr/lib/python2.6/site-packages/packstack/installer/setup_sequences.py", line 60, in run
    function()
  File "/usr/lib/python2.6/site-packages/packstack/plugins/puppet_950.py", line 123, in applyPuppetManifest
    waitforpuppet(currently_running)
  File "/usr/lib/python2.6/site-packages/packstack/plugins/puppet_950.py", line 111, in waitforpuppet
    validate_puppet_logfile(log)
  File "/usr/lib/python2.6/site-packages/packstack/modules/ospluginutils.py", line 137, in validate_puppet_logfile
    raise PackStackError(message)
PackStackError: Error during puppet run : err: /Stage[main]//Exec[ntpdate]/returns: change from notrun to 0 failed: /usr/sbin/ntpdate 0.ch.pool.ntp.org returned 1 instead of one of [0] at /var/tmp/packstack/20130131-1048/manifests/10.112.1.28_ntpd.pp:76

Error during puppet run : err: /Stage[main]//Exec[ntpdate]/returns: change from notrun to 0 failed: /usr/sbin/ntpdate 0.ch.pool.ntp.org returned 1 instead of one of [0] at /var/tmp/packstack/20130131-1048/manifests/10.112.1.28_ntpd.pp:76

Expected results:
Configuration applied, no errors, ntpd running.

Additional info:
Might be best to exec "service ntpd stop ||:" before running ntpdate.

Comment 1 Sandro Mathys 2013-01-31 11:01:54 UTC
Created attachment 690845 [details]
proposed patch

Comment 2 Derek Higgins 2013-01-31 14:28:22 UTC
Patch submitted upstream
https://review.openstack.org/#/c/20900/1

Comment 3 Martin Magr 2013-02-01 09:45:02 UTC
Good point, patch is working, but it could be done easier [1] as puppet provides such function.

[1] http://www.puppetcookbook.com/posts/ensure-service-is-stopped.html

Comment 4 Sandro Mathys 2013-02-02 21:18:32 UTC
(In reply to comment #3)
> Good point, patch is working, but it could be done easier [1] as puppet
> provides such function.
> 
> [1] http://www.puppetcookbook.com/posts/ensure-service-is-stopped.html

Sure, but ntpd is already defined (with the opposite value for "ensure") and puppet won't allow to define it a second time.

Comment 5 Fedora Update System 2013-02-13 18:57:29 UTC
openstack-packstack-2012.2.2-0.8.dev406.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/openstack-packstack-2012.2.2-0.8.dev406.el6

Comment 6 Fedora Update System 2013-02-13 18:59:20 UTC
openstack-packstack-2012.2.2-0.8.dev406.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openstack-packstack-2012.2.2-0.8.dev406.fc18

Comment 7 Fedora Update System 2013-02-15 04:59:22 UTC
Package openstack-packstack-2012.2.2-0.8.dev406.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openstack-packstack-2012.2.2-0.8.dev406.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2483/openstack-packstack-2012.2.2-0.8.dev406.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-02-21 13:37:26 UTC
openstack-packstack-2012.2.2-1.0.dev408.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openstack-packstack-2012.2.2-1.0.dev408.fc18

Comment 9 Fedora Update System 2013-02-21 13:39:18 UTC
openstack-packstack-2012.2.2-1.0.dev408.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/openstack-packstack-2012.2.2-1.0.dev408.el6

Comment 10 Fedora Update System 2013-02-27 12:39:33 UTC
openstack-packstack-2012.2.3-0.1.dev454.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openstack-packstack-2012.2.3-0.1.dev454.fc18

Comment 11 Vinny Valdez 2014-09-24 23:13:56 UTC
This is also a problem if the controller is also the NTP server. Puppet stops ntpd then runs ntpdate and it fails. A work around is to leave ntpd running and run ntpdate -bu <server>. This allows ntpdate to sync against a running ntpd on the same system. In small POC environments where a time server may not be reachable, this becomes a problem as a dedicated NTP server is needed. 

Instead, the controller can be used to setup ntpd on it's own pseudo clock to at least keep all the OpenStack systems in sync, regardless if it can reach an external ntpd server.

Example configuration to accomplish this:
server 127.127.1.0
fudge 127.127.1.0 stratum 10

See Bug 1134613


Note You need to log in before you can comment on or make changes to this bug.