Suppose that you want to use a space habitat to duplicate a natural environment for Earth animals and plants. In a society which is building thousands of space habitats for humans to live in - partially to have a larger human population than can live on earth, and partially to have survivors in case a disaster wipes out life on Earth - having copies in outer space of all Earth's ecosystems to preserve members of every species so they can be reseeded on Earth if need be would be a good idea. And if the future humans building space habitats have any use for domestic plants and animals, they would want to have a source for breeding replacement domestic plants and animals if something wipes out the domestic ones on Earth and in other space habitats.
And if a cylindrical space habitat is, for example, 100 kilometers long and 10 kilometers in diameter, it will have a surface area of 3,141.59 square kilometers, between Mansel Island in Canada and Yamdena Island in Indonesia in area - https://en.wikipedia.org/wiki/List_of_islands_by_area - and also between Lake Tana in Ethiopia and Lake Amadjuak in Canada in area - https://en.wikipedia.org/wiki/List_of_lakes_by_area1.
If the dimensions are increased by ten times to 1,000 kilometers by 100 kilometers, the surface area will increase by one hundred times to 314,159 square kilometers, between Sumatra in Indonesia and Honshu in Japan in area - https://en.wikipedia.org/wiki/List_of_islands_by_area - and also between the Caspian Sea and Lake Superior in the USA in area - https://en.wikipedia.org/wiki/List_of_lakes_by_area1
So what area would be necessary for a more or less self sustaining ecosystem that requires relatively little human intervention to maintain? I'm not sure how certain the answer is, but I suspect that the answer varies greatly between different types of Earthly ecosystems.
And another question is what is the required volume for a more or less self sustaining ecosystem that requires relatively little human intervention to maintain? I'm also not sure how certain the answer is, but I also suspect that the answer varies greatly between different types of Earthly ecosystems.
Suppose that an African savannah ecosystem required a height of 10 meters above the ground to function well. In that case a roof could be build over the ecosystem with a height of 10 meters, supported by many evenly spaced pillars that woulds seem more or less like trees to the animals. And more ground could be laid down over the roof, converting it into another ground level and doubling the total area of the savannah in the space habitat. And another roof could be built over the upper level at a height of thirty meters to make a third ground level, and so on and so on, level after level.
Of course most multi-celled Earth plants and animals would need gravity like that of Earth to flourish, and every level closer to the center of the rotating space habitat will decrease the gravity slightly. So eventually a limit would be reached.
If one arbitrarily assumes that a ten percent increase or decrease from Earth's gravity would be acceptable, a rotating cylindrical space habitat with a radius of 5 kilometers should have a zone of acceptable gravity for levels between about 4,500 and 5,500 meters from the central axis. A rotating cylindrical space habitat with a radius of 50 kilometers should have a zone of acceptable gravity for levels between about 45 and 55 kilometers from the central axis.
If heights between 10 meters and 1,000 meters are necessary for various Earth ecosystems, a 10 kilometer diameter and 100 kilometer long space habitat could have between 1 and 100 levels, depending on the ecosystem chosen, and thus between 3,141.59 and 314,159 square kilometers of surface area. A 100 kilometer by 1,000 kilometer space habitat could have between 10 and 1,000 levels and thus between 3,141,590 and 3,141,590,000 square kilometers of surface area.
Note that the total surface area of Earth, land and sea, with all its different ecosystems, is about 510,000,000 square kilometers, meaning that a space habitat with 3,141,590,000 square kilometers of surface area would have more than six times the surface area of Earth.
If between 10 and 1,000 meters of air above the surface are hypothetically needed for various Earth ecosystems, why should the topmost level of the Earth ecosystem have an open sky extending 5 kilometers or 50 kilometers to the center axis of the space habitat, depending on side walls to keep the air in. Why not build another roof on top of the top level of the Earth ecosystem? and have above it an open area of vacuum extending to the center axis of the space habitat, with maybe a pressurized zero g central cylinder?
And of course such a design for space habitats to duplicate Earth ecosystems for the sake of Earth planets and animals can also be used for human inhabited space habitats, since humans are much more comfortable living in artificial indoors environments than most animals are.
Since it is probably impossible to make materials strong enough to build cylindrical space habitats with diameters so great that walls hundreds or thousands of kilometers high to hold in atmosphere would not reach all the way to the central axis, I see no point in discussing how high such walls would have to be. And I have an intense dislike for wasting air made with material shipped in from comets and icy bodies in the outer solar system by letting some of it escape very slowly over gigantic atmospheric retaining walls, to say nothing of the wasted material to construct those walls.