You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@aurora.apache.org by "Joe Smith (JIRA)" <ji...@apache.org> on 2014/06/01 03:07:01 UTC

[jira] [Created] (AURORA-501) Improve HostMaintenance API

Joe Smith created AURORA-501:
--------------------------------

             Summary: Improve HostMaintenance API
                 Key: AURORA-501
                 URL: https://issues.apache.org/jira/browse/AURORA-501
             Project: Aurora
          Issue Type: Story
          Components: Maintenance, SRE
            Reporter: Joe Smith
            Priority: Minor


>From [~tweingartner] in response to https://reviews.apache.org/r/20285/:

{quote}
The API seems a bit strange to me here.  In particular, there is a {{HostMaintenance}} class, and methods:

{code}
HostMaintenance.start_maintenance(host_list)
HostMaintenance.end_maintenance(host_list)
...
{code}

Which all seems very repetitive to me. It might make more sense to have {{HostMaintenance}}'s constructor take a list of hosts (already grouped) to operate on:

{noformat}
maint = HostMaintenance(possibly_grouped_host_list)
maint.status(host_subset=None) => return status of each host in possibly_grouped_host_list, or a subset thereof if given, raise hell if subset not in possibly_grouped_host_list
maint.start(host_subset=None) => return some sort of status of the operation, or nothing and just raise hell?
maint.drain(host_subset=None) => return next drained batch/host, do in a loop, like using a generator
maint.end(host_subset=None) => Usually given the output of maint.drain()
{noformat}

A usecase would then look something like:

{code}
maint = HostMaintenance([
  ['host1', 'host2', 'host3'],  # Batch 1
  ['host4', 'host5'],           # Batch 2 (followed by single hosts)
  'host6', 'host7', 'host8', 'host9'])
print "Current status:", maint.status()
maint.start()
for batch in maint.drain():
  for host in batch:
    # Do the funky chicken
  maint.end(batch)
{code}

Possibly having a {{HostMaintenanceController}} class to batch/coordinate/etc, using the {{HostMaintenance}} class to do this low level work, taking things like a grouping function, inter-batch delays, inter-host delays, "funky chicken" function to call for each host/batch, ability to monitor progress, possibly a "big red button, PANIC stop" ability.
{quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)