'Returns the cluster\'s zone. If volumes are specified, this method
determines the common zone between those volumes. If a zone is
explicitly specified in the config and does not match the common zone
of the volumes, an exception is raised. If all volumes are not in the
same zone an exception is raised. If no volumes are specified, returns
the user-specified zone if it exists. Returns None if no volumes and no
zone is specified.'

def _get_cluster_zone(self):

    zone = None
    if self.availability_zone:
        zone = self.ec2.get_zone(self.availability_zone)
    common_zone = None
    for volume in self.volumes:
        volid = self.volumes.get(volume).get('volume_id')
        vol = self.ec2.get_volume(volid)
        if (not common_zone):
            common_zone = vol.zone
        elif (vol.zone != common_zone):
            vols = [self.volumes.get(v).get('volume_id') for v in self.volumes]
            raise exception.VolumesZoneError(vols)
    if (common_zone and zone and (zone.name != common_zone)):
        raise exception.InvalidZone(zone.name, common_zone)
    if ((not zone) and common_zone):
        zone = self.ec2.get_zone(common_zone)
    if (not zone):
        try:
            zone = self.ec2.get_zone(self.master_node.placement)
        except exception.MasterDoesNotExist:
            pass
    return zone
