Instanton-dyons, also known as instanton-monopoles or instanton-quarks, are topological constituents of the instantons at nonzero temperature and holonomy. We perform numerical simulations of the ensemble of interacting dyons for the SU(2) pure gauge theory. Unlike previous studies, we focus on back reaction on the holonomy and the issue of confinement. We calculate the free energy as a function of the holonomy and the dyon densities, using standard Metropolis Monte Carlo and integration over parameter methods. We observe that as the temperature decreases and the dyon density grows, its minimum indeed moves from small holonomy to the value corresponding to confinement. We then report various parameters of the self-consistent ensembles as a function of temperature, and investigate the role of inter-particle correlations.