WordPress query posts by custom post type not workng

It’s a bad use of Query you may look at this post

In this case use a secondary query with your own instance of WP Query. query_posts() is not recommanded here cause it overrides the main query.

<?php $args = array(
    'post_type'           => 'instrument',
    'post_status'         => 'publish',
    'ignore_sticky_posts' => 1,
);
$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) :
    while ( $my_query->have_posts() ) : $my_query->the_post(); ?>

        <div class="col-sm-2">

            <a href="https://wordpress.stackexchange.com/questions/232360/<?php the_permalink(); ?>">

                <?php the_post_thumbnail( 'medium' ); ?>

            </a>

        </div><!--.col-sm-2-->

    <?php endwhile;
    wp_reset_postdata(); 
endif; ?>