Krishna was the eight incarnation of Vishnu and he was born as the son of Devaki and Vasudeva. Initially, Krishna did not have any sons. Desirous of obtaining a son, Krishna went to visit the
sage Upamanyu. The sage’s hermitage was beautiful. Wonderous were the trees and flowers and
grew there. The constant chanting of the Vedas could be heard. Wild animals lost their ferocity as soon as they entered the hermitage. Lotus flowers bloomed in the ponds. Sages came from all over the country to meditate in the hermitage. The sacred river Ganga flowed past the hermitage.
Krishna greeted the sages and they worshipped him in return.
Upamanyu welcomed Krishna with various offerings and said, “Our meditation has been amply rewarded by your visit. The great Vishnu has himself come to grace us by your presence. But is there any particular reason as to why you have come to the hermitage?”
“I wish to meet Shiva,” replied Krishna. “How does one get to met him?”
“Shiva appears if a devotee performs difficult tapasya,” said Upamanyu. “It helps if the meditation is accompanied by great faith.”
Hearing these words, Krishna began a difficult religious rite known as pashupata vrata. He donned clothes made out of the barks of trees, smeared ashes on his body and continuously chanted Shiva’s name. After many years had passed, Shiva and Parvati appeared before Krishna.
“Krishna, why are you performing tapasya?” asked Shiva. “You are the great Vishnu himself. Any object that you desire is immediately attained. Why are you then engaged in this task of meditation?”
“I wish to have a son who is just like you,” said Krishna. “Please let him also be devoted to you.” Shiva gladly granted the boon and the son who was born was Shamba (alternatively, Samba). He
was the son of Krishna and Jambavati.
(Stories about Shamba are to be found in the Vishnu Purana, and also in Mahabharataa.)