The 31-year-old Ostapchuk, world champion in 2005, had the best mark of 21.36 metres on the third of her six attempts.
"It's my third Olympic Games and it's a long way to get to this gold medal," said Ostapchuk, who had notched the biggest shot put mark in a decade in the leadup to the Olympics. "This is to everyone" in Belarus.
Adams, who came to London as the defending Olympic, world, world indoor and Commonwealth champion and on a long winning streak, was New Zealand's biggest hope for Olympic gold. But she had to settle for silver with a best shot of 20.70.
"I am disappointed to be honest," Adams said. "I am happy with the medal but not happy with the colour but I gave my heart out there."
Adams was involved in a mix up ahead of the event, when she wasn't formally entered on the original start list. New Zealand Olympic Committee officials said she was entered but there had been an administration problem, which was quickly resolved.
"I don't want to make any excuses of it but it was a couple of hours of stress," Adams said. "It's something you just don't need, you would think that they would take care of it."
Russia's Evgeniia Kolodko moved into bronze medal position with her last throw of 20.48.