NHS Lothian said it and other health agencies are examining the cases, which have been linked to Church Street Pear Tree Nursery in Haddington.
Officials at the NHS body said a “small number” of the cases had been admitted to hospital but most displayed mild symptoms and did not require hospital treatment.
E coli is a bacteria that lives in the guts of people and animals. Most strains are harmless but others can cause serious food poisoning.
These are often found in undercooked ground meat products, raw milk and faecal contamination of vegetables.
Symptoms range from mild loose stools to severe bloody diarrhoea. The most serious complications can lead to blood poisoning and kidney failure.
Some of the cases had been admitted to hospital as a precaution and all are in a stable condition, NHS Lothian added.
Investigations have not yet revealed a specific source, but advanced microbiological testing is underway to identify the strain of the infection and any links.
Those that have been affected have already been excluded and have submitted samples for testing.
Cases, so far, have been confined to the nursery, respective households, or other close contacts. The nursery has been closed as a precautionary measure while the investigations continue.
A small number of people at a partner nursery in the same town reported having symptoms of vomiting and diarrhoea, which have resolved without requiring medical treatment.
As a precaution, Meadowpark Pear Tree Nursery in Haddington has also been closed and all parents and carers have been notified.
Dr Richard Othieno of NHS Lothian, said: “We know that this will be an anxious time for many of those who are directly affected by the infection.
“We have written to parents and carers of the children affected and to staff at the nursery to provide the most up-to-date information and ongoing health advice.
“NHS Lothian has a robust surveillance system in place to identify E coli cases which helped us to identify these cases early and put in place essential control measures to prevent further spread.”
He added: “This outbreak reinforces the importance of washing hands regularly, particularly before eating or preparing food, and after going to the toilet.”
“We continue to provide support to the nursery and those parents and carers who have been directly affected. We have encouraged parents to keep their children away from other children and those at higher risk until their negative results have been received.”
There is no specific treatment for the infection and most people who are infected will get better without medical treatment.
However, those who have symptoms, or are concerned, are advised to contact their GP or NHS 24 on telephone number 111.