Shri Krishna is the 8th incarnation of Shri Vishnu & he was born as the son of Devaki & 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. Wondrous 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. Shri Vishnu has himself 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.
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 yourself. 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. He was the son of Krishna & Jambavati. Stories about Shamba/Samba found in the Vishnu Purana, & also in Mahabharata.