Since software systems play an important role in applications more than ever, the security has become one of the most important indicators of softwares.Cloud computing refers to services that run in a distributed network and are accessible through common internet protocols. Presenting a proper Scheduling method can lead to efficiency of resources by decreasing response time and costs.This research studies the existing approaches of Task Scheduling and resource allocation in cloud infrastructures and assessment of their advantages and disadvantages.Afterwards, a compound algorithm is presented in order to allocate Tasks to resources properly and decrease runtime. In this paper we proposed a new method for Task Scheduling by learning automata (LA). This method where has named RAOLA is trained by historical information of Task execution on the cloud, then divide Task to many classes and evaluate them. Next, manage virtual machine for capture physical resources at any period based on rate of Task classes, such that improve efficiency of cloud network.