Use Boto's Ec2Connection#get_only_instances().