'Shutdown this cluster by detaching all volumes and \'stopping\' all nodes
In general, all nodes in the cluster must be \'stoppable\' meaning all
nodes are backed by flat-rate EBS-backed instances. If any
\'unstoppable\' nodes are found an exception is raised. A node is
\'unstoppable\' if it is backed by either a spot or S3-backed instance.
If the cluster contains a mix of \'stoppable\' and \'unstoppable\' nodes
you can stop all stoppable nodes and terminate any unstoppable nodes by
setting terminate_unstoppable=True.'

def stop_cluster(self, terminate_unstoppable=False, force=False):

    nodes = self.nodes
    if (not nodes):
        raise exception.ClusterValidationError('No    running    nodes    found')
    if (not self.is_stoppable()):
        has_stoppable_nodes = self.has_stoppable_nodes()
        if ((not terminate_unstoppable) and has_stoppable_nodes):
            raise exception.InvalidOperation('Cluster    contains    nodes    that    are    not    stoppable')
        if (not has_stoppable_nodes):
            raise exception.InvalidOperation('Cluster    does    not    contain    any    stoppable    nodes')
    try:
        self.run_plugins(method_name='on_shutdown', reverse=True)
    except exception.MasterDoesNotExist as e:
        if force:
            log.warn(('Cannot    run    plugins:    %s' % e))
        else:
            raise
    self.detach_volumes()
    for node in nodes:
        node.shutdown()
