From the Super Mario Wiki
Giant Cannonballs are very rare moving obstacles found in Super Mario Bros. 3, New Super Mario Bros. Wii and New Super Mario Bros. U. They are much faster and bigger than the original Cannonballs, making them much harder to avoid. They always appear alongside (or in the same stage as) the smaller Cannonballs. In Super Mario Bros. 3, they only appear in Dark Land's first Tank level, and the Battleship level. The Cannons that fire the giant cannonballs resemble Warp Pipes, but they are colored black (blue in remakes) so as to not confuse the player. In New Super Mario Bros. Wii, they only appear in World 8's Airship. In New Super Mario Bros. U, they only appear in The Mighty Cannonship from Soda Jungle. Even though normal cannonballs are absent during New Super Luigi U Giant Cannonballs reappear in the level Bowser Jr. Showdown.