'Creates the model for the aggregate.'

@wrap_exception()
def create_aggregate(self, context, aggregate_name, availability_zone):

    aggregate = objects.Aggregate(context=context)
    aggregate.name = aggregate_name
    if availability_zone:
        aggregate.metadata = {'availability_zone': availability_zone}
    aggregate.create()
    self.scheduler_client.update_aggregates(context, [aggregate])
    return aggregate
