Skip to main content

Virtual Machines and Hypervisors

Learning Objectives

By the end of this section, you will be able to:

  • Create and configure virtual machines from scratch
  • Understand hypervisor installation and basic configuration
  • Manage VM resources (CPU, memory, storage, network)
  • Perform common VM operations (start, stop, snapshot, clone)
  • Install and configure guest operating systems in VMs
  • Troubleshoot common virtualization issues
  • Apply best practices for VM management

Introduction: Building Your First Virtual Computer

In the previous section, we learned what virtualization is conceptually. Now it's time to get our hands dirty and actually create virtual machines! Think of this as learning to build and manage apartments in our virtual apartment building.

By the end of this section, you'll be able to create a virtual computer that runs inside your physical computer, install an operating system on it, and manage it just like a real computer.

Understanding Virtual Machine Components

What Makes Up a Virtual Machine?

Just like a physical computer, every virtual machine has the same basic components, but they're all software-based:

Virtual Hardware Components:

  1. Virtual CPU (Processor)

    • Real-world analogy: Like reserving a certain amount of a chef's time in a busy kitchen
    • What it is: A portion of the physical CPU's processing power allocated to the VM
    • Example: You might give a VM 2 virtual CPUs from a physical server that has 8 CPU cores
  2. Virtual Memory (RAM)

    • Real-world analogy: Like allocating workspace on a large table to different people
    • What it is: A dedicated portion of the physical server's RAM assigned to the VM
    • Example: Allocating 4GB of RAM to a VM from a server with 32GB total
  3. Virtual Storage (Hard Drive)

    • Real-world analogy: Like giving someone a filing cabinet in a large storage room
    • What it is: A file on the physical storage that acts as the VM's hard drive
    • Example: A 100GB virtual disk stored as a file called "VM1.vmdk" on the physical server
  4. Virtual Network Adapter

    • Real-world analogy: Like giving someone a phone extension that connects to the main phone system
    • What it is: A software-based network connection that allows the VM to communicate
    • Example: VM gets its own IP address and can access the network just like a physical computer
  5. Virtual BIOS/UEFI

    • Real-world analogy: Like the basic instructions that tell someone how to use their apartment
    • What it is: Software that provides the basic startup instructions for the VM
    • Example: Tells the VM how to boot up and find its operating system

Hypervisor Deep Dive

Type 1 Hypervisors (Bare Metal) - The Professional Choice

VMware vSphere (ESXi)

What it is: The most popular enterprise hypervisor that runs directly on server hardware

Installation Process:

  1. Boot server from ESXi installation USB/DVD
  2. ESXi installs directly on the server (no Windows or Linux underneath)
  3. Configure network settings and passwords
  4. Access management through web browser or vCenter

Key Features:

  • High performance: Direct access to hardware with minimal overhead
  • Enterprise features: High availability, live migration, resource pooling
  • Security: Hardened hypervisor with small attack surface
  • Scalability: Can manage hundreds of VMs on a single host

Real-world scenario: A company replaces 20 physical servers with 3 powerful servers running ESXi, each hosting 6-8 virtual machines.

Microsoft Hyper-V Server

What it is: Microsoft's free bare-metal hypervisor (separate from Windows Server Hyper-V)

Installation Process:

  1. Install Hyper-V Server from Microsoft download
  2. Configure through command line or PowerShell
  3. Manage remotely using Hyper-V Manager or System Center

Key Features:

  • Cost-effective: Free basic version available
  • Windows integration: Excellent with Windows VMs and Active Directory
  • PowerShell management: Strong automation capabilities
  • Live Migration: Move running VMs between hosts

Real-world scenario: A Windows-focused organization uses Hyper-V Server to run their Windows-based applications and services.

Type 2 Hypervisors (Hosted) - Great for Learning and Development

VMware Workstation Pro

What it is: Desktop virtualization software that runs on Windows or Linux

Installation Process:

  1. Install on existing Windows/Linux operating system
  2. License activation required for commercial use
  3. Create VMs through graphical interface
  4. Install guest operating systems in VMs

Key Features:

  • Easy to use: Intuitive graphical interface
  • Snapshot management: Save VM states and revert changes
  • Multiple OS support: Run Windows, Linux, and other operating systems simultaneously
  • Development friendly: Great for software testing and development

Real-world scenario: A software developer uses VMware Workstation to test their application on different operating systems without needing multiple physical computers.

Oracle VirtualBox (Free)

What it is: Free, cross-platform virtualization software

Installation Process:

  1. Download and install on Windows, Mac, or Linux
  2. No licensing required for personal or educational use
  3. Create VMs using the VirtualBox Manager
  4. Install guest operating systems

Key Features:

  • Completely free: No licensing costs for any use case
  • Cross-platform: Runs on Windows, Mac, Linux, and Solaris
  • Good performance: Suitable for most development and testing needs
  • Extension pack: Additional features like USB 3.0 and RDP support

Real-world scenario: A small business uses VirtualBox to create test environments for their applications before deploying to production servers.

Hands-On: Creating Your First Virtual Machine

Let's walk through creating a virtual machine using VirtualBox (since it's free and easy to get started with):

Step 1: Download and Install VirtualBox

System Requirements:

  • Minimum: 4GB RAM, 10GB free disk space
  • Recommended: 8GB+ RAM, 50GB+ free disk space
  • Processor: Intel/AMD with virtualization support enabled

Installation steps:

  1. Go to virtualbox.org and download the latest version
  2. Run the installer with administrator privileges
  3. Accept default settings (include network features)
  4. Restart computer if prompted

Step 2: Create a New Virtual Machine

VM Creation Wizard:

  1. Name and Operating System:

    • Name: "Test-Ubuntu-VM"
    • Type: Linux
    • Version: Ubuntu (64-bit)
    • Why this matters: VirtualBox optimizes settings based on the OS you select
  2. Memory Size (RAM):

    • Recommended: 2048 MB (2GB) for Ubuntu desktop
    • Rule of thumb: Don't allocate more than 50% of your physical RAM
    • Example: If you have 8GB RAM, maximum 4GB for VMs
  3. Hard Disk:

    • Create a virtual hard disk now
    • VDI (VirtualBox Disk Image) format
    • Dynamically allocated (grows as needed)
    • Size: 20GB minimum, 40GB recommended
    • Storage location: Choose drive with plenty of free space

Step 3: Configure VM Settings

Important settings to review before first boot:

System Settings:

  • Motherboard: Enable I/O APIC, Hardware Clock in UTC Time
  • Processor: Assign 1-2 CPU cores (don't exceed physical cores)
  • Acceleration: Enable VT-x/AMD-V if available

Display Settings:

  • Video Memory: 128MB (maximum for better performance)
  • Graphics Controller: VBoxSVGA for Linux guests
  • Enable 3D Acceleration: Only if supported and needed

Network Settings:

  • Adapter 1: NAT (allows internet access)
  • Advanced: Allow all promiscuous mode for network troubleshooting
  • Alternative: Bridged Adapter to get separate IP on your network

Storage Settings:

  • Controller: SATA (better performance than IDE)
  • Optical Drive: Attach Ubuntu ISO file for installation
  • Hard Disk: Verify created disk is attached

Step 4: Install Guest Operating System

Ubuntu Installation Process:

  1. Start the VM: Click Start, select Ubuntu ISO file

  2. Boot from ISO: VM boots from the installation media

  3. Installation wizard:

    • Language: English
    • Installation type: Erase disk and install Ubuntu (this is the virtual disk, not your real one!)
    • User account: Create username and password
    • Installation: Takes 15-30 minutes
  4. First boot:

    • Remove installation media (ISO)
    • Log in with created account
    • Update system: sudo apt update && sudo apt upgrade
  5. Install Guest Additions:

    • From VM menu: Devices → Insert Guest Additions CD Image
    • Run installer to enable better integration
    • Restart VM to activate improvements

Step 5: Post-Installation Configuration

Essential first steps:

  1. Take a snapshot: This saves the VM state for easy recovery

    • VM menu → Take Snapshot
    • Name: "Fresh Ubuntu Install"
    • Description: "Clean installation before customization"
  2. Configure network:

    • Verify internet connectivity: ping google.com
    • Check IP address: ip addr show
    • Note: With NAT, VM gets internal IP like 10.0.2.15
  3. Install basic tools:

    sudo apt install curl wget git vim net-tools
  4. Test VM functionality:

    • Copy/paste between host and guest
    • Shared folders (if needed)
    • Screen resolution adjustment

Virtual Machine Resource Management

CPU Allocation Best Practices

Understanding vCPU vs Physical CPU:

  • Physical CPU cores: Actual processor cores in the server
  • vCPU: Virtual CPU cores assigned to VMs
  • Overcommitment: You can assign more vCPUs than physical cores

Example Scenario:

  • Physical server: 8 CPU cores
  • VM1: 2 vCPUs
  • VM2: 2 vCPUs
  • VM3: 4 vCPUs
  • Total vCPUs: 8 (matches physical cores)

Overcommitment Example:

  • Same 8-core server
  • 6 VMs each with 2 vCPUs = 12 vCPUs total
  • Why this works: VMs don't always use 100% of their allocated CPU
  • Risk: If all VMs get busy simultaneously, performance suffers

CPU Allocation Guidelines:

  • Start conservatively: 1-2 vCPUs for most workloads
  • Monitor usage: Check if VM actually needs more CPU
  • Overcommitment ratio: 2:1 to 3:1 for most environments (6-24 vCPUs on 8 physical cores)
  • Critical applications: Keep 1:1 ratio for performance-sensitive workloads

Memory (RAM) Management

Memory allocation is more critical than CPU because:

  • You can't easily overcommit memory like CPU
  • Running out of memory causes immediate performance problems
  • Memory must be physically available when allocated

Memory Planning Example:

  • Physical server: 64GB RAM
  • Hypervisor overhead: 4GB
  • Available for VMs: 60GB
  • Safety margin: 10GB for host operations
  • Allocatable to VMs: 50GB maximum

VM Memory Allocation:

  • Windows Server VM: 4-8GB minimum
  • Linux Server VM: 1-4GB typically sufficient
  • Desktop VMs: 2-4GB for basic use, 8GB+ for development
  • Database servers: 8GB+ depending on database size

Memory Management Features:

Ballooning:

  • What it is: Hypervisor can reclaim unused memory from VMs
  • How it works: Special driver inside VM reports unused memory
  • When it's used: When host memory gets low
  • Real-world analogy: Like asking apartment tenants to temporarily use less storage during building maintenance

Memory Compression:

  • What it is: Compress memory pages that aren't actively used
  • Benefit: More VMs can run on same hardware
  • Trade-off: Uses some CPU to compress/decompress

Memory Sharing:

  • What it is: Multiple VMs share identical memory pages
  • Example: If 5 VMs run the same operating system, they share common OS pages
  • Benefit: Significant memory savings in environments with similar VMs

Storage Configuration

Virtual Disk Types:

Thick Provisioned:

  • What it is: Full disk space allocated immediately
  • Example: Create 100GB virtual disk → 100GB used on physical storage
  • Advantages: Predictable performance, no risk of running out of space
  • Disadvantages: Uses more physical storage than necessary

Thin Provisioned:

  • What it is: Disk space allocated as needed
  • Example: Create 100GB virtual disk → Only 10GB used initially on physical storage
  • Advantages: More efficient use of storage
  • Disadvantages: Risk of running out of physical storage if all VMs grow

Real-World Storage Planning:

Small Business Example (5 VMs):

  • Email server: 50GB thin provisioned
  • File server: 200GB thick provisioned (predictable growth)
  • Database server: 100GB thick provisioned (performance critical)
  • Web server: 30GB thin provisioned
  • Domain controller: 40GB thin provisioned

Physical storage needed:

  • Thick provisioned: 200 + 100 = 300GB guaranteed
  • Thin provisioned: 50 + 30 + 40 = 120GB, but may grow to 320GB
  • Total planning: 400GB physical storage for 620GB virtual disk capacity

Network Configuration

Common Network Configurations:

NAT (Network Address Translation):

  • What it is: VM shares host's IP address
  • Internet access: Yes, through host
  • Access from network: No, VM is hidden behind host
  • Best for: Testing, development, isolated environments
  • Example: VM gets 10.0.2.15, host has 192.168.1.100

Bridged Networking:

  • What it is: VM appears as separate device on network
  • Internet access: Yes, direct connection
  • Access from network: Yes, VM has its own IP address
  • Best for: Production servers that need network access
  • Example: VM gets 192.168.1.150 on same network as host

Host-Only Networking:

  • What it is: VMs can talk to host and each other only
  • Internet access: No
  • Access from network: No
  • Best for: Isolated test networks
  • Example: Create private network for testing without internet risks

Internal Networking:

  • What it is: VMs can only talk to each other
  • Internet access: No
  • Access from host: No
  • Best for: Isolated VM-to-VM communication
  • Example: Database server that should only be accessed by application server

Common VM Operations

Starting and Stopping VMs

Normal Startup Process:

  1. Power on VM (like pressing power button)
  2. Virtual BIOS/UEFI starts
  3. Operating system boots from virtual disk
  4. Services start and system becomes ready

Shutdown Methods:

Graceful Shutdown (Preferred):

  • Send shutdown signal to guest OS
  • Operating system closes applications properly
  • VM powers off cleanly
  • Command example: sudo shutdown -h now (Linux) or Start → Shut Down (Windows)

Force Power Off:

  • Immediately cut power to VM
  • Similar to pulling power cord from physical computer
  • Risk: Data loss, file system corruption
  • When to use: Only when VM is frozen and won't respond

Suspend/Resume:

  • Suspend: Save VM state to disk and pause
  • Resume: Restore VM state and continue exactly where it left off
  • Use cases: Quickly pause work, save system resources
  • Limitation: VM must be resumed on same hypervisor

Snapshot Management

What are Snapshots? Think of snapshots like save points in a video game - you can save your progress and go back to that exact point later if something goes wrong.

How Snapshots Work:

  1. Take snapshot: Creates point-in-time copy of VM state
  2. Continue working: Changes are tracked separately from snapshot
  3. Revert if needed: Go back to snapshot state, losing all changes since
  4. Delete snapshot: Merge changes back into main VM

Practical Snapshot Workflow:

Before System Update:

1. Take snapshot: "Before Windows Updates"
2. Install Windows updates
3. Test system for 24-48 hours
4. If everything works: Delete snapshot
5. If problems occur: Revert to snapshot

Before Software Installation:

1. Take snapshot: "Before Installing Accounting Software"
2. Install new software
3. Test software functionality
4. If software works well: Delete snapshot
5. If software causes problems: Revert to snapshot

Snapshot Best Practices:

  • Don't keep snapshots long-term: They consume extra storage and can impact performance
  • Use descriptive names: "Before-Office365-Migration-2024-01-15"
  • Document purpose: What you're about to do and why you took the snapshot
  • Limit number: Keep only 2-3 snapshots per VM maximum
  • Test revert process: Make sure you can actually restore from snapshots

Cloning Virtual Machines

What is VM Cloning? Creating an exact copy of an existing virtual machine - like making a photocopy of a document, but for entire computers.

Types of Clones:

Full Clone:

  • What it is: Complete independent copy of the VM
  • Storage: Uses same amount of storage as original
  • Independence: Can run simultaneously with original
  • Use case: Creating production VMs from tested templates

Linked Clone:

  • What it is: New VM shares base disk with original
  • Storage: Uses minimal additional storage initially
  • Dependency: Requires original VM to remain available
  • Use case: Creating multiple test VMs quickly

Cloning Workflow Example:

Creating Standard Desktop Template:

  1. Install Windows 10 in new VM
  2. Install all standard software (Office, antivirus, etc.)
  3. Configure all standard settings
  4. Run Windows updates
  5. Take snapshot: "Master Template"
  6. Create full clones for each new employee

Benefits:

  • New employee computer ready in 30 minutes vs. 4-8 hours
  • Consistent configuration across all desktops
  • Easy to update template and redeploy

VMware vCenter 8 Management

What is vCenter?

Simple explanation: If individual ESXi hosts are like individual apartment buildings, vCenter is like the central management office that oversees multiple apartment buildings.

Technical explanation: vCenter is centralized management software that allows you to manage multiple ESXi hosts and hundreds of virtual machines from a single interface.

vCenter Architecture

vCenter Server Components:

vCenter Server Appliance (vCSA):

  • What it is: Linux-based virtual appliance that runs vCenter services
  • Deployment: Deployed as VM on ESXi host
  • Management: Web-based interface accessible via browser
  • Database: Built-in PostgreSQL database (no external database needed)

ESXi Hosts:

  • Role: Physical servers running the hypervisor
  • Management: Managed by vCenter Server
  • Communication: Uses secure HTTPS communication
  • Agent: No agent needed on ESXi hosts

Basic vCenter Operations

Adding ESXi Hosts to vCenter:

  1. Prerequisites:

    • ESXi host installed and configured
    • Network connectivity between vCenter and ESXi
    • Root password for ESXi host
  2. Add Host Process:

    vCenter Web Client → Hosts and Clusters
    → Right-click Datacenter → Add Host
    → Enter ESXi IP address and root credentials
    → Select certificate (accept for lab environments)
    → Assign to datacenter and cluster
  3. Verification:

    • Host appears in inventory
    • Host status shows "Connected"
    • VMs on host are visible in vCenter

Creating and Managing Datacenters:

Datacenter Object:

  • Purpose: Logical container for hosts, clusters, and VMs
  • Naming: Use meaningful names like "Bangalore-Office" or "Production-DC"
  • Organization: Group related resources together

Cluster Object:

  • Purpose: Group of ESXi hosts that share resources
  • Features: Enables high availability, load balancing, resource pooling
  • Naming: Use descriptive names like "Web-Servers-Cluster"

VM Operations in vCenter

Creating VMs through vCenter:

New VM Wizard:

  1. Select creation type:

    • Create new VM
    • Deploy from template
    • Clone existing VM
  2. Select name and location:

    • VM name: Descriptive and follows naming convention
    • Datacenter: Choose appropriate datacenter
    • Folder: Organize VMs in logical folders
  3. Select compute resource:

    • Choose ESXi host or cluster
    • vCenter shows resource utilization to help decide
  4. Select storage:

    • Choose datastore with sufficient space
    • Consider performance requirements
  5. Select compatibility:

    • Hardware version (newer = more features, less compatibility)
    • Generally use latest unless specific requirements
  6. Guest OS selection:

    • Choose OS type for optimal settings
    • Affects default resource allocations
  7. Customize hardware:

    • CPU: Number of vCPUs and cores per socket
    • Memory: RAM allocation in MB/GB
    • Network: Select appropriate port group
    • Storage: Configure virtual disks

VM Templates:

What are Templates? A template is a master copy of a VM that's used to create new VMs quickly and consistently.

Template Creation Process:

  1. Create and fully configure a VM
  2. Install OS and all required software
  3. Configure settings and preferences
  4. Generalize the OS (remove unique identifiers)
  5. Convert VM to template (makes it non-bootable)
  6. Use template to deploy new VMs

Template Benefits:

  • Consistency: All VMs created from template have identical configuration
  • Speed: New VM deployment in minutes
  • Compliance: Ensure all VMs meet security and configuration standards
  • Efficiency: Avoid repeating same installation and configuration steps

Resource Management with vCenter

Resource Pools:

What they are: Logical containers that allow fine-grained resource management Purpose: Control how much CPU and memory different groups of VMs can use

Example Resource Pool Structure:

Production Cluster (Total: 16 CPU, 64GB RAM)
├── Critical-Apps Pool (8 CPU, 32GB RAM)
│ ├── Database VMs
│ └── Email Server VMs
├── Standard-Apps Pool (6 CPU, 24GB RAM)
│ ├── Web Server VMs
│ └── File Server VMs
└── Development Pool (2 CPU, 8GB RAM)
├── Test VMs
└── Development VMs

Resource Pool Benefits:

  • Guaranteed resources: Critical apps always get minimum resources
  • Resource sharing: Apps can use unused resources from other pools
  • Delegation: Different teams can manage their own resource pools
  • Chargeback: Track resource usage by department/project

vCenter Monitoring and Alerts

Performance Monitoring:

Real-time Performance:

  • CPU utilization: Current CPU usage across hosts and VMs
  • Memory utilization: RAM usage and memory pressure
  • Storage I/O: Disk read/write activity and latency
  • Network I/O: Network traffic and packet statistics

Historical Performance:

  • Performance charts: Track resource usage over time
  • Capacity planning: Identify trends and predict future needs
  • Troubleshooting: Correlate performance issues with time periods

Alert Management:

Predefined Alarms:

  • VM CPU usage > 90% for 10 minutes
  • VM memory usage > 95% for 5 minutes
  • Datastore usage > 80%
  • Host hardware failure

Custom Alarms:

  • Disk space on specific VMs
  • Network connectivity failures
  • Backup job completions
  • Custom application metrics

Alert Actions:

  • Email notifications: Send alerts to administrators
  • SNMP traps: Integration with monitoring systems
  • VM operations: Automatically restart failed VMs
  • Scripts: Run custom remediation scripts

Troubleshooting Common Virtualization Issues

VM Won't Start

Symptom: VM fails to power on, error messages in vCenter

Common Causes and Solutions:

Insufficient Resources:

  • Problem: Not enough CPU, memory, or storage on host
  • Check: Host resource utilization in vCenter
  • Solution: Move VM to different host or add resources to current host

VM File Corruption:

  • Problem: Virtual disk or configuration files damaged
  • Check: Look for .lck files or missing .vmdk files
  • Solution: Restore from backup or repair VM files

Hardware Compatibility:

  • Problem: VM hardware version not supported on host
  • Check: Compare VM hardware version with host capabilities
  • Solution: Downgrade VM hardware version or upgrade host

Network Issues:

  • Problem: VM trying to connect to non-existent network
  • Check: VM network adapter configuration
  • Solution: Connect VM to available network or create missing network

Poor VM Performance

Symptom: VM runs slowly, applications are unresponsive

Systematic Troubleshooting:

1. Check Resource Allocation:

  • CPU: Is VM getting enough vCPU time?
  • Memory: Is VM experiencing memory pressure?
  • Storage: Are disk operations slow?
  • Network: Are there network bottlenecks?

2. Host Resource Contention:

  • CPU overcommitment: Too many VMs competing for CPU
  • Memory overcommitment: Host swapping memory to disk
  • Storage contention: Multiple VMs accessing same storage
  • Network saturation: Network bandwidth fully utilized

3. Guest OS Issues:

  • Driver problems: Outdated or missing VMware Tools
  • OS configuration: Incorrect power settings or services
  • Application issues: Software not optimized for virtual environment

Performance Optimization Steps:

VM-Level Optimizations:

1. Install/update VMware Tools
2. Adjust VM resource allocations
3. Enable/disable features based on workload
4. Optimize guest OS settings

Host-Level Optimizations:

1. Distribute VMs across multiple hosts
2. Add physical resources (CPU, memory, storage)
3. Optimize storage configuration
4. Update hypervisor and firmware

Network Connectivity Issues

Symptom: VM can't access network or internet

Network Troubleshooting Process:

1. Physical Layer:

  • Check physical network connections to host
  • Verify network switch configuration
  • Test network connectivity from hypervisor

2. Virtual Network Layer:

  • Verify VM network adapter is connected
  • Check virtual switch configuration
  • Confirm correct VLAN settings

3. Guest OS Layer:

  • Check IP address configuration in guest OS
  • Verify DNS and gateway settings
  • Test with ping and traceroute commands

4. Firewall/Security:

  • Check host firewall settings
  • Verify VM firewall configuration
  • Confirm security group rules (if using)

Storage Issues

Symptom: VM storage errors, slow disk performance

Storage Troubleshooting:

1. Datastore Space:

  • Check available space on datastore
  • Look for thin-provisioned disks that have grown
  • Clean up unnecessary files and snapshots

2. Storage Performance:

  • Monitor storage latency and throughput
  • Check for storage array issues
  • Verify storage network connectivity

3. VM Disk Issues:

  • Check virtual disk integrity
  • Look for corrupted VMDK files
  • Verify storage controller settings

Best Practices for VM Management

Naming Conventions

Consistent naming makes management much easier:

VM Naming Convention Example:

Format: [Environment]-[OS]-[Function]-[Number]
Examples:
- PROD-WIN-SQL-01 (Production Windows SQL Server #1)
- DEV-LIN-WEB-02 (Development Linux Web Server #2)
- TEST-WIN-DC-01 (Test Windows Domain Controller #1)

Template Naming:

Format: TEMPLATE-[OS]-[Version]-[Date]
Examples:
- TEMPLATE-WIN2019-STD-20240115
- TEMPLATE-UBUNTU-22.04-20240115

Resource Allocation Guidelines

Right-sizing VMs:

Start Small, Scale Up:

  • Begin with minimum required resources
  • Monitor usage for 2-4 weeks
  • Increase resources based on actual usage
  • Avoid over-allocating from the start

CPU Guidelines:

  • Single-threaded apps: 1-2 vCPUs
  • Multi-threaded apps: Match application's thread count
  • Database servers: Start with 4 vCPUs, scale based on load
  • Web servers: 2-4 vCPUs typically sufficient

Memory Guidelines:

  • Windows Server: 4GB minimum, 8GB for most roles
  • Linux Server: 2GB minimum, 4GB for most services
  • Database servers: Based on database size and concurrent users
  • Leave headroom: Don't allocate 100% of physical memory

Security Best Practices

VM Security:

Keep VMs Updated:

  • Install security patches regularly
  • Update VMware Tools on all VMs
  • Keep hypervisor updated with latest patches

Network Segmentation:

  • Use VLANs to separate different types of VMs
  • Limit communication between VM types
  • Implement firewall rules between segments

Access Control:

  • Use least-privilege principle for VM access
  • Implement strong passwords and two-factor authentication
  • Regular audit of user permissions

Backup and Recovery:

  • Regular backups of all critical VMs
  • Test restore procedures regularly
  • Document recovery procedures

Documentation Standards

What to Document:

VM Inventory:

  • VM name and purpose
  • Resource allocations (CPU, memory, storage)
  • Operating system and version
  • Installed applications and roles
  • Network configuration
  • Backup schedule and retention

Configuration Standards:

  • Standard VM configurations for different roles
  • Naming conventions and policies
  • Network design and VLAN assignments
  • Security configurations and policies

Procedures:

  • VM creation procedures
  • Backup and restore procedures
  • Troubleshooting guides
  • Emergency response procedures

Key Takeaways

  • Virtual machines are software-based computers that run on physical hardware managed by a hypervisor
  • Type 1 hypervisors (like ESXi) run directly on hardware and are best for production environments
  • Type 2 hypervisors (like VirtualBox) run on existing operating systems and are great for development and learning
  • Proper resource allocation (CPU, memory, storage, network) is critical for good VM performance
  • Common VM operations include starting/stopping, snapshots, cloning, and resource management
  • vCenter provides centralized management for multiple ESXi hosts and hundreds of VMs
  • Troubleshooting virtualization issues requires systematic approach checking physical, virtual, and guest OS layers
  • Best practices include consistent naming, right-sizing resources, security hardening, and comprehensive documentation

What's Next?

In the next section, we'll explore advanced virtualization features including high availability, disaster recovery, and automation. You'll learn how enterprise virtualization platforms ensure business continuity and streamline operations through advanced management features.