Skip to content

Virtualization Management

Vapor provides comprehensive virtual machine management using KVM/Libvirt. You can create, manage, and monitor VMs with advanced features like PCI passthrough, snapshots, and live migration.

Prerequisites

  • KVM kernel modules loaded
  • Libvirt daemon running
  • QEMU/KVM installed
  • Appropriate permissions for VM management
  • Sufficient CPU virtualization support (Intel VT-x or AMD-V)
  1. From the main menu, click on Virtualization
  2. Three main sections are available:
    • Virtual Machines
    • Storage Pools
    • Networks

Virtual Machines

The VMs tab displays all virtual machines on the system.

VM List View

Each VM shows:

  • Name and UUID
  • State (Running, Paused, Shutoff, etc.)
  • vCPUs and Memory allocation
  • Operating System
  • IP addresses (if guest agent installed)
  • Uptime
  • Actions menu

Creating a Virtual Machine

Quick Create

  1. Click Create VM
  2. Basic configuration:
    • Name: VM identifier
    • vCPUs: Number of virtual CPUs
    • Memory: RAM allocation (MB)
    • OS Type: Linux, Windows, etc.
    • OS Variant: Specific distribution/version
  3. Storage configuration:
    • Storage Pool: Where to create the disk
    • Disk Size: Size in GB
    • Boot ISO: Installation media
  4. Click Create

Advanced Create

For more control, use Advanced Create:

General Settings
  • Architecture: x86_64, aarch64
  • Firmware: BIOS or UEFI
  • Secure Boot: Enable for Windows 11
  • TPM: Add virtual TPM device
  • Machine Type: Q35 (PCIe) or i440FX (PCI)
CPU Configuration
  • CPU Model: Host passthrough or specific model
  • Topology: Sockets, cores, threads
  • Features: Enable/disable CPU features
  • NUMA: Configure NUMA topology
Memory Settings
  • Current Memory: Runtime allocation
  • Maximum Memory: Upper limit for hotplug
  • Huge Pages: Enable for better performance
  • Memory Ballooning: Dynamic memory management
Storage Configuration

Multiple disk support:

  1. System Disk:

    • Format: qcow2, raw, vmdk
    • Bus: virtio, SATA, IDE, SCSI
    • Cache mode: none, writeback, writethrough
    • I/O mode: native, threads
  2. Additional Disks:

    • Add multiple data disks
    • Attach existing disks
    • Create from templates
  3. CD/DVD:

    • Attach ISO images
    • Physical device passthrough
Network Configuration
  1. Network Interfaces:

    • Model: virtio, e1000, rtl8139
    • Network: NAT, Bridge, Host-only
    • MAC address: Auto or manual
    • VLAN tagging
  2. Multiple NICs:

    • Add up to 8 network interfaces
    • Configure each independently
Graphics and Display
  • Display Type:

    • VNC: Remote access display
    • SPICE: Enhanced remote display
    • None: Headless operation
  • Graphics Settings:

    • Listen address and port
    • Password protection
    • Auto-port allocation
PCI Device Passthrough
  1. GPU Passthrough:

    • Select GPU device
    • VFIO configuration
    • ROM file (if needed)
    • Primary GPU option
  2. Other PCI Devices:

    • Network cards
    • Storage controllers
    • USB controllers

Managing Virtual Machines

Power Operations

  • Start: Boot the VM
  • Shutdown: Graceful shutdown via ACPI
  • Force Off: Immediate power off
  • Reboot: Restart the VM
  • Reset: Hard reset
  • Pause: Suspend VM execution
  • Resume: Continue from pause

Console Access

  1. Click Console button
  2. Choose connection type:
    • VNC Console: Web-based VNC viewer
    • SPICE Console: Enhanced features
    • Serial Console: Text-based access

Console features:

  • Full keyboard and mouse support
  • Clipboard sharing (SPICE)
  • File transfer (SPICE)
  • Multiple monitor support
  • Full-screen mode
  • Screenshot capture

Snapshots

Creating Snapshots
  1. Click Snapshots in VM details
  2. Click Create Snapshot
  3. Enter:
    • Name: Snapshot identifier
    • Description: Optional notes
    • Memory State: Include RAM contents
  4. Click Create
Managing Snapshots
  • Revert: Restore VM to snapshot state
  • Delete: Remove snapshot
  • Clone: Create new VM from snapshot

Live Migration

Move running VMs between hosts:

  1. Click Migrate in VM actions
  2. Select:
    • Target Host: Destination server
    • Migration Type: Live or offline
    • Storage Migration: Move disks too
  3. Configure options:
    • Bandwidth limit
    • Auto-converge
    • Post-copy mode
  4. Click Migrate

VM Configuration

Edit VM Settings
  1. Click Edit in VM details
  2. Modify:
    • CPU and memory allocation
    • Boot order
    • Network interfaces
    • Storage devices
  3. Changes requiring restart are marked
  4. Click Apply
Hot-Plug Operations

While VM is running:

  • Add/remove vCPUs
  • Adjust memory (within limits)
  • Attach/detach disks
  • Add/remove network interfaces

Storage Pools

Manage storage locations for VM disks.

Storage Pool Types

  • Directory: Filesystem directory
  • LVM: Logical Volume Manager
  • NFS: Network File System
  • iSCSI: Network block storage
  • Ceph RBD: Distributed storage
  • GlusterFS: Distributed filesystem

Creating Storage Pools

  1. Click Create Pool
  2. Select type and configure:
    • Directory: Path on filesystem
    • NFS: Server and export path
    • iSCSI: Target and initiator
  3. Set permissions and ownership
  4. Click Create

Managing Storage Pools

  • Refresh: Scan for changes
  • Start/Stop: Activate/deactivate pool
  • Delete: Remove pool (preserves data)
  • Browse: View pool contents

Storage Volumes

Within each pool:

  • Create new volumes
  • Upload ISO images
  • Clone existing volumes
  • Resize volumes
  • Delete unused volumes

Virtual Networks

Configure networking for VMs.

Network Types

  • NAT: Network address translation
  • Bridge: Direct network bridge
  • Isolated: No external connectivity
  • Routed: Layer 3 routing
  • Open vSwitch: SDN networking

Creating Networks

  1. Click Create Network
  2. Configure:
    • Name: Network identifier
    • Mode: NAT, Bridge, etc.
    • Bridge Name: Linux bridge name
    • IP Configuration: DHCP settings
    • DNS: Forwarder settings
  3. Click Create

Network Features

  • DHCP Server: Automatic IP assignment
  • DNS Forwarder: Name resolution
  • IPv6 Support: Dual-stack networking
  • Bandwidth Control: QoS settings
  • VLAN Tagging: 802.1Q support
  • Port Isolation: Security feature

Templates

Create reusable VM configurations.

Creating Templates

  1. Configure a VM as desired
  2. Click Convert to Template
  3. Template is saved for reuse

Using Templates

  1. Click Create from Template
  2. Select template
  3. Customize as needed:
    • Change name
    • Adjust resources
    • Modify network settings
  4. Click Create

Monitoring and Metrics

Real-time Monitoring

View live metrics:

  • CPU usage per core
  • Memory utilization
  • Disk I/O rates
  • Network throughput
  • Block device statistics

Performance Graphs

Historical data:

  • CPU usage over time
  • Memory trends
  • I/O patterns
  • Network activity

Best Practices

  1. Resource Planning: Don't overcommit CPU/memory
  2. Storage Performance: Use virtio for best performance
  3. Network Optimization: Use virtio-net when possible
  4. Backup Strategy: Regular snapshots and backups
  5. Security: Enable SELinux/AppArmor for VMs
  6. Monitoring: Watch resource usage trends
  7. Updates: Keep guest tools updated

Troubleshooting

VM Won't Start

  • Check libvirt logs: /var/log/libvirt/qemu/
  • Verify resources available
  • Check storage pool is active
  • Ensure network is started
  • Verify permissions

Poor Performance

  • Enable virtio drivers
  • Check CPU pinning
  • Verify huge pages configuration
  • Monitor host resource usage
  • Check disk cache settings

Network Issues

  • Verify network is active
  • Check firewall rules
  • Ensure bridge configuration
  • Test with different network types
  • Check DHCP server status

Console Not Working

  • Verify display settings
  • Check VNC/SPICE ports
  • Ensure graphics driver loaded
  • Try different console type
  • Check firewall for console ports

PCI Passthrough Problems

  • Verify IOMMU enabled in BIOS
  • Check VFIO modules loaded
  • Ensure device not in use
  • Verify device in same IOMMU group
  • Check ROM file if GPU passthrough

Advanced Topics

Cloud-Init Integration

Configure VMs automatically:

  • User data scripts
  • Network configuration
  • SSH key injection
  • Package installation
  • Custom commands

Nested Virtualization

Enable VMs within VMs:

  • Intel: kvm_intel nested=1
  • AMD: kvm_amd nested=1

SR-IOV

Single Root I/O Virtualization:

  • Virtual functions for network cards
  • Near-native network performance
  • Reduced CPU overhead

Dibuat dengan semangat gotong royong demi kemajuan bangsa 🇮🇩