The command bamtools random grabs a random subset of alignments. With the option -n 100, 100 randomly chosen alignments are stored in the output file output_alignments_100.bam.
bamtools random -in input_alignments.bam -out output_alignments_100.bam -n 100