Years ago I had a male Irish Setter that had a retained testicle. My hubby (boyfriend at the time) DID NOT want to castrate him - 30+ years ago it was a macho thing

.
We had our vet remove the retained testicle and did a vasectomy on the other one. Knowing what I know now I would have had him neutered. Hind sight is always better.
I believe that was the only vasectomy that my vet performed on a dog

.