code: def remove_instances_by_prefix(nova_api, prefix):
      
      for server in nova_api.servers.list():
          if server.name.startswith(prefix):
              LOG.info("Remove instance '%s'" % server.name)
              server.delete()
docs: Remove all the instances on which their name start by a prefix.