]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
add clock task to sync clocks
authorSage Weil <sage@newdream.net>
Thu, 16 Jun 2011 21:37:52 +0000 (14:37 -0700)
committerSage Weil <sage@newdream.net>
Thu, 16 Jun 2011 22:19:55 +0000 (15:19 -0700)
teuthology/task/clock.py [new file with mode: 0644]

diff --git a/teuthology/task/clock.py b/teuthology/task/clock.py
new file mode 100644 (file)
index 0000000..e7df8b6
--- /dev/null
@@ -0,0 +1,47 @@
+import contextlib
+import logging
+
+from orchestra import run
+
+log = logging.getLogger(__name__)
+
+def task(ctx, config):
+    """
+    Sync or skew clock
+
+    This will initially sync the clocks.  Eventually it should let us also
+    skew by some number of seconds.
+
+    example:
+
+    tasks:
+    - clock:
+    - ceph:
+    - interactive:
+
+    to sync.
+
+    To skew, we should allow something like:
+
+    tasks:
+    - clock:
+        mon.0: -2
+        client.1: 2
+    - ceph:
+    - interactive:
+
+    """
+
+    ctx.cluster.run(
+        args=[
+            'sudo',
+            'ntpdate',
+            'clock1.dreamhost.com',
+            'clock2.dreamhost.com',
+            'clock3.dreamhost.com',
+            ],
+        )
+
+    # TODO do the skew
+    #for role, skew in config.iteritems():
+