can any one explain the role of Virtual Machine in PaaS vs IaaS cloud environment.
TIA!
A virtual machine (often referred to as a "VM") is a hardware unit on which many different types of software are actually running. Basically every single piece of any distributed system is running software on a machine, and those machines are usually VM's. Things like your backend web app, cache (e.g. Redis), database, etc. are all likely running on VM's.
A VM is a VM no matter where it's running but I'll describe IaaS and PaaS so you can have some context.
IaaS generally refers to a model in which you're paying just for hardware (like a VM) with very little on top of it. Maybe you'll get an OS with some pre-bundled software. You'll also have to do most of the legwork of setting up the hardware properly so it can not only communicate with the other pieces of hardware, but so your software can run on it.
PaaS is basically everything I described above but it is all taken care for you. In addition, you'll often get necessary tools like logging, monitoring, auto-scaling, credential management (like database strings, ports, etc.), and more. Essentially everything is taken care of except for your actual code.
Back to the VM's - in a PaaS environment, you're much less likely to need to worry about them. It's often hidden (for better or worse) by the provider. If you need more horsepower to run your app, sometimes you'll literally have a slider bar to add more hardware resources. In an IaaS world, VM's are an essential building block for the system and you'll be responsible for choosing, deploying, and configuring them.