Simple sand castings may have been used to make the hollow cannonballs.
Without going into the fine points, to make a sand casting of a solid ball you would have a wooden ball and would bury it half way into the sand in an open top box. (The box would be full with the wooden ball sticking half way out of the sand.)
(This lower box is called a "drag".)
Another box (the "cope") with guide pins that mate with guide holes in the lower box (the drag) would then be placed on top of the lower box.
It is open on both ends and once in place on top of the lower box it will be filled with sand totally burying the wooden ball (pattern).
(Rather than using dry, loose sand, the sand used for this process is dampened with oil so it sticks together when it is compressed. It is usually referred to as "green sand".
Once the upper box is full of sand and the loose sand is tamped down so it is firmly around the pattern (called "ramming"), the upper box of sand is lifted straight up off of the lower box and then turned over.
A hole that intersects the hollow pocket formed by the upper half of the wooden pattern is cut thru the sand to the outside to feed the molten metal thru.
After removing the wooden ball (pattern) from the green sand in the lower box the upper box is then placed back on top of the lower box using the guide pins to align it and the metal is poured thru the hole to fill the cavity.
The results is a solid, spherical ball.
OK. Now, rather than having a simple wooden ball for a pattern we have a wooden ball with a fairly large wooden dowel sticking out of one side. The dowel is a precise length and when this pattern is being placed in the lower box the dowel is placed so it is laying in a horizontal position.
The cope is placed on top of the drag and filled with green sand and rammed.
When finished, the cope is removed, the pattern is removed and the feed hole is cut.
(The hole is called a "gate" and the metal that is left on the casting after things cool is called a "sprue".
While all of this is going on, another split box is being filled with sand.
This box has a cavity cut into it much like a bullet mold and the cavity is a sphere with a round hole intersecting it.
Once the green sand fills this mold and it is rammed, the box is opened and a sand sphere with a round sand rod sticking out one side is removed.
(This is called a "core" and the pattern used to make it is called a "core box".)
The size of this sphere is smaller than the size of the ball pattern used above to form the cavity in the cope and drag.
For instance, if we wanted to end up with a 1/2" thick cast wall, this core sphere would be 1 inch smaller in diameter than the pattern used in the cope and drag.
The length of the round sand rod sticking out of this sand pattern is exactly the same length as the cavity formed by the pattern that was used to form the cavity in the cope and drag.
Now, the worker places this smaller sand pattern into the drag using the dowell cavity in the sand to position it and hold it in place.
Once the cope is replaced on the drag with this inner pattern core in place the metal is poured.
When it is cooled, the cope and drag are taken apart and the cast sphere is removed.
Some pounding or hammering will break up the inner sand pattern and the sand can be poured out of the new, hollow ball.
Once the sprue is removed and the hole thru the wall is machined for a plug you now have a nice new cannon ball waiting to be filled with powder and something to set it off.
This sounds like a lot of time consuming work but in reality, once things are going, it can become a fairly rapid process.
Remember, at a foundry where they are pouring thousands of pounds of metal there will be dozens if not hundreds of these copes, drags and cores being made to receive the molten metal.
It's how tens of thousands of sand castings are made today.