'Ensure that the availability zone is the same.'

def check_availability_zone(self, context, volume, instance=None):

    if (instance and (not CONF.cinder.cross_az_attach)):
        instance_az = az.get_instance_availability_zone(context, instance)
        if (instance_az != volume['availability_zone']):
            msg = (_('Instance    %(instance)s    and    volume    %(vol)s    are    not    in    the    same    availability_zone.    Instance    is    in    %(ins_zone)s.    Volume    is    in    %(vol_zone)s') % {'instance': instance.uuid, 'vol': volume['id'], 'ins_zone': instance_az, 'vol_zone': volume['availability_zone']})
            raise exception.InvalidVolume(reason=msg)
