The Infrastructure as a Service (IaaS) paradigm allows service providers and/or end-users to outsource the computing resources they need. Cloud providers offer the infrastructure as a utility with a pay-per-use model, relying on virtualization technologies to provide hardware resources to the cloud consumers. IaaS can potentially bring obvious advantages, but the virtualized resources use to be manually controlled by the consumers, and this may lead to unaffordable administration costs. The demand of computing resources can fluctuate from one time to another and managing the virtual machines “rented” to the cloud provider to meet peak requirements but to avoid overprovisioning, is a significant challenge. This paper presents AMAS (Automatic MAchine Scaling), a distributed solution capable of automatically creating and releasing virtual machines in order to minimize the number of virtual resources instantiated to run an application and to meet the consumer performance requirements. Furthermore, the complete design and a first real implementation of this solution is described to validate that it is capable of handling sudden load changes, maintaining the desired quality of service, minimizing the number of virtual machines and significantly reducing the consumer management efforts.