https://youtu.be/eyNBf1sqdBQ?si=hqltZ8nNtIWl-djY
Virtual Machines (VMs)
A Virtual Machine is a software-based emulation of a physical computer. It runs an entire operating system (OS) and mimics the hardware, enabling the execution of applications in an isolated environment. Think of it as creating multiple mini "virtual" computers within a single physical computer.
Key Features of VMs:
- Isolation:
- Each VM operates independently, with its own OS, storage, and resources.
- VMs are highly isolated, ensuring that applications running on one VM cannot interfere with those on others
- Resource Allocation:
- Resources like CPU, memory, and storage are allocated to each VM, often managed by a hypervisor.
- Heavyweight:
- VMs are relatively resource-intensive since they require their own OS.
- Hypervisor:
- It runs on a hypervisor, a software layer that manages the allocation of resources to each VM
- Software like VMware, VirtualBox, or Hyper-V enables the creation and management of VMs.
Best Use Cases for VMs:
- Running multiple different OSes on a single physical machine.
- Legacy system compatibility (running older software on newer hardware).
- High-security applications requiring full OS isolation.
Disadvantages
- Resource Intensive: Each VM needs its own operating system, which consumes disk space, RAM, and CPU power. Running multiple VMs can strain the resources of the host server, potentially leading to performance issues
- Slow Startup Times: VMs can take time to boot up because they have to load an entire operating system. This can be a disadvantage in situations where quick application deployment is required
- Complex Management: Managing multiple VMs can become complex, especially in large-scale deployments. Administrators need to monitor resource usage, apply updates, and ensure security for each VM.
Metaphor
A VM is like a separate apartment within a building.
Each apartment has its own walls, floor, and ceiling, and can be configured independently. It has its own operating system and resources, making it completely self-contained.