Vehicular cloud computing (VCC) is a promising technology for the intelligent transport system. It provides a better quality of transport and vehicular services that will increase the safety and comfort of drivers and passengers. A group of vehicles creates VCC and offers vehicular services for its users in the absence of infrastructure to support the system. The vehicles having computing, storage, communication, and sensing devices can share these resources with other vehicles. VCC creates a resource pool by aggregating all the shared resources of nearby vehicles. The major challenge for VCC is to manage the resources from different vehicles in a resource pool and to allocate necessary resources to its user on-demand. The authors propose a semi-Markov decision process based resource allocation method for the VCC system called flexible resource allocation for vehicular cloud system to manage and allocate the resources. The proposed method finds optimal resource allocation strategies for different states of the VCC system and maximises the long-term expected reward under different parameter settings. Nomenclature K maximum number of vehicles that the VC can support v the vehicle ID R type of resources in a vehicle λ p arrival rate of a request of priority p M i maximum available resource of type i n i number of RUs of type i that VC can allocate to a request λ Req rate of arrival of request μ Req departure rate of the request λ v arrival rate of vehicle μ v departure rate of vehicle ξ gain for the system, when a vehicle arrives ξ −1 penalty for system when a vehicle leaves τ Req gain when a job completes and request departs Delay Req energy lost when a request blocked