Elucidating the architecture and dynamics of large scale genetic regulatory networks of cells is an important goal in systems biology. We study the system level dynamical properties of the genetic network of Escherichia coli that regulates its metabolism, and show how its design leads to biologically useful cellular properties. Our study uses the database (Covert et al., Nature 2004) containing 583 genes and 96 external metabolites which describes not only the network connections but also the boolean rule at each gene node that controls the switching on or off of the gene as a function of its inputs. We have studied how the attractors of the boolean dynamical system constructed from this database depend on the initial condition of the genes and on various environmental conditions corresponding to buffered minimal media. We find that the system exhibits homeostasis in that its attractors, that turn out to be fixed points or low period cycles, are highly insensitive to initial conditions or perturbations of gene configurations for any given fixed environment. At the same time the attractors show a wide variation when external media are varied implying that the system mounts a highly flexible response to changed environmental conditions. The regulatory dynamics acts to enhance the cellular growth rate under changed media. Our study shows that the reconstructed genetic network regulating metabolism in {it E. coli} is hierarchical, modular, and largely acyclic, with environmental variables controlling the root of the hierarchy. This architecture makes the cell highly robust to perturbations of gene configurations as well as highly responsive to environmental changes. The twin properties of homeostasis and response flexibility are achieved by this dynamical system even though it is not close to the edge of chaos.