In cloud virtual machine is considered as the security threat. Virtual machines are vulnerable to Denial of Service (DoS) attacks. Denial of Service (DoS) attacks involves action such as low frequency vulnerability scanning, exploitation and compromising vulnerable virtual machines. This paper proposes a framework to detect and mitigate attacks within the cloud environment. To prevent vulnerable virtual machines in the cloud, a multi-phase vulnerable detection and countermeasure selection, which built an attack graph, based analytical models and reconfigurable virtual network-based countermeasures.