diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher index 8745f2dd7440972231adc3ba1c7b3ce799bc2cdd..64eda10d9724dc2131c42d502a9f999c653fb0a8 100755 --- a/daemons/ganeti-watcher +++ b/daemons/ganeti-watcher @@ -244,10 +244,17 @@ def GetClusterData(): all_results = cli.PollJob(job_id, cl=client, feedback_fn=logging.debug) + logging.debug("Got data from cluster, writing instance status file") + result = all_results[0] smap = {} instances = {} + + # write the upfile + up_data = "".join(["%s %s\n" % (fields[0], fields[1]) for fields in result]) + utils.WriteFile(file_name=constants.INSTANCE_UPFILE, data=up_data) + for fields in result: (name, status, autostart, snodes) = fields diff --git a/lib/constants.py b/lib/constants.py index 494531a5e01df1547338b097f513c451059c5f1a..d9edc139d835ffa96db84da0a009f7774721ff2e 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -96,6 +96,7 @@ CLUSTER_CONF_FILE = DATA_DIR + "/config.data" SSL_CERT_FILE = DATA_DIR + "/server.pem" RAPI_CERT_FILE = DATA_DIR + "/rapi.pem" WATCHER_STATEFILE = DATA_DIR + "/watcher.data" +INSTANCE_UPFILE = RUN_GANETI_DIR + "/instance-status" SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts" RAPI_USERS_FILE = DATA_DIR + "/rapi_users" QUEUE_DIR = DATA_DIR + "/queue"