XCP-ng Installation and Cluster Administration

3 Nov 2026, 18:2122 min readby ITYantra Admin

Complete guide to installing and administering XCP-ng virtualization platform including Xen Orchestra, storage repositories, and resource pools.

# XCP-ng Installation and Cluster Administration

Introduction

XCP-ng (Xen Cloud Platform Next Generation) is an open-source virtualization platform based on the Xen hypervisor. It provides enterprise-grade virtualization with a lightweight hypervisor, support for Linux and Windows guests, and integration with Xen Orchestra for web-based management. XCP-ng is fully open-source with no licensing fees, making it an attractive alternative to proprietary virtualization platforms.

This tutorial covers XCP-ng installation, resource pool creation, storage repositories, networking, virtual machine management, high availability, and cluster administration using Xen Orchestra.

By the end of this guide, you will be able to install and administer XCP-ng hosts, create resource pools, configure storage, and manage virtual machines.

Technical Background

XCP-ng Architecture

XCP-ng consists of:

  • **Xen Hypervisor**: Type-1 bare-metal hypervisor managing CPU, memory, and devices
  • **Control Domain (Dom0)**: Privileged VM running the XCP-ng management stack
  • **Guest VMs (DomU)**: Unprivileged virtual machines running guest operating systems
  • **Toolstack**: XAPI (Xen API) providing management interface
  • **Xen Orchestra**: Web-based management interface (separate appliance)

Resource Pool

A resource pool is a group of XCP-ng hosts sharing storage and network configuration, enabling:

  • Live migration (XenMotion) between hosts
  • High availability (VM restart on host failure)
  • Centralized management
  • Shared storage repositories

Storage Repository (SR)

Storage repositories provide disk storage for VMs. Supported types:

  • LVM (local disk)
  • LVMoISCSI (iSCSI over LVM)
  • NFS
  • SMB
  • Fibre Channel
  • ZFS (via community plugins)

Prerequisites

  • 64-bit x86 server with Intel VT-x or AMD-V
  • Minimum 2 GB RAM (4 GB+ recommended)
  • Minimum 46 GB disk space (128 GB+ recommended)
  • Network interface
  • XCP-ng ISO installation media

Architecture

Single XCP-ng Host

┌─────────────────────────────────────────────────────────────┐
│                     XCP-ng Host                             │
│                                                             │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐        │
│  │     VM 1    │  │     VM 2    │  │     VM 3    │        │
│  │   (DomU)    │  │   (DomU)    │  │   (DomU)    │        │
│  └─────────────┘  └─────────────┘  └─────────────┘        │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐   │
│  │              Control Domain (Dom0)                  │   │
│  │         XAPI, Storage, Networking                   │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐   │
│  │              Xen Hypervisor                          │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  ┌─────────────────────────────────────────────────────┐   │
│  │              Hardware                                 │   │
│  └─────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘

Resource Pool with Xen Orchestra

graph TB
    subgraph XOA [Xen Orchestra Appliance]
        XOA_UI[XO Web UI]
        XOA_API[XO API]
    end
    
    subgraph Resource_Pool [Resource Pool]
        X1[XCP-ng Host 1<br/>Pool Master]
        X2[XCP-ng Host 2]
        X3[XCP-ng Host 3]
    end
    
    subgraph Shared_Storage [Shared Storage]
        SR1[(NFS SR)]
        SR2[(iSCSI SR)]
    end
    
    XOA_UI --> X1
    XOA_UI --> X2
    XOA_UI --> X3
    
    X1 <==> X2 <==> X3
    
    X1 --> SR1
    X2 --> SR1
    X3 --> SR1
    X1 --> SR2
    X2 --> SR2

Step-by-Step Implementation

Step 1: Install XCP-ng

**Purpose**: Install XCP-ng hypervisor on physical server.

**Procedure**:

1. Download XCP-ng ISO from https://xcp-ng.org/ 2. Create bootable USB 3. Boot server from USB 4. Select "XCP-ng Installer" 5. Choose installation disk 6. Configure installation mode (Default or Custom) 7. Set root password 8. Configure management network (IP, gateway, DNS, hostname) 9. Complete installation and reboot

**Commands**: None (graphical installer)

**Expected output**: XCP-ng installed; host boots into XCP-ng with management IP.

**Verification**:

  • Host accessible via XCP-ng Center (Windows) or Xen Orchestra
  • `xl info` shows hypervisor details

Step 2: Configure Management Network

**Purpose**: Set up management network for host access.

**Commands** (Dom0 shell):

# List network interfaces
ip addr show

# Check XCP-ng network configuration
xe network-list
xe pif-list

# Set static IP on management interface
xe pif-reconfigure-ip uuid=<pif-uuid> mode=static \
  ip=<ip-address> netmask=<netmask> gateway=<gateway> \
  DNS=<dns-server>

**Explanation**: XCP-ng uses PIF (Physical Interface) objects to represent network interfaces. The management PIF provides host access.

**Expected output**: Management interface configured with static IP.

**Verification**:

xe pif-list params=ip,netmask,gateway,mode
# Shows static IP configuration

Step 3: Create Resource Pool

**Purpose**: Group multiple XCP-ng hosts into a manageable pool.

**Commands** (on first host - becomes pool master):

# Create resource pool
xe pool-create name-label="ityantra-pool" \
  name-description="Production virtualization pool"

# Get pool master UUID
xe pool-list params=master

**Commands** (on additional hosts to join pool):

# Join pool
xe pool-join master-address=<pool-master-ip> \
  master-username=root master-password=<root-password>

# Verify pool membership
xe host-list params=name-label,pool

**Explanation**: The first host becomes pool master. Other hosts join as pool members. Pool master coordinates HA, workload balancing, and shared storage.

**Expected output**: Multiple hosts visible in single resource pool.

**Verification**:

xe pool-list
xe host-list
# Shows all hosts in pool with master designated

Step 4: Configure Storage Repository (SR)

**Purpose**: Add storage for VM disks.

**Commands** (NFS SR example):

# Create NFS storage repository
xe sr-create name-label="nfs-vm-storage" \
  type=nfs device-config:server=192.168.1.50 \
  device-config:serverpath=/mnt/vm-storage

# Set as default SR (optional)
xe pool-param-set uuid=<pool-uuid> \
  default-SR=<sr-uuid>

**Commands** (LVM local SR):

# List local disks
xe sr-probe type=lvm device-config:device=/dev/sdb

# Create LVM SR
xe sr-create name-label="local-lvm-storage" \
  type=lvm device-config:device=/dev/sdb

**Expected output**: Storage repository created and available for VM disks.

**Verification**:

xe sr-list
# Shows all storage repositories with type and size

Step 5: Configure Networking for VMs

**Purpose**: Create virtual networks for VM connectivity.

**Commands**:

# Create network
xe network-create name-label="vm-network"

# Attach physical interface to network (create bridge)
# Typically done via Xen Orchestra or automatically

**Explanation**: XCP-ng uses Linux bridges for VM networking. VMs connect to virtual interfaces (VIFs) bridged to physical interfaces (PIFs).

**Expected output**: VM network available for VM attachment.

**Verification**:

xe network-list
xe vif-list

Step 6: Create Virtual Machine

**Purpose**: Deploy a VM on XCP-ng.

**Commands** (via xe CLI):

# Create VM from template
xe vm-install template="Ubuntu 22.04" \
  new-name-label=web-server-01 sr-uuid=<sr-uuid>

# Get VM UUID
xe vm-list name-label=web-server-01

# Set VM memory
xe vm-memory-limits-set uuid=<vm-uuid> \
  static-min=512MiB static-max=4GiB dynamic-min=512MiB dynamic-max=4GiB

# Set vCPUs
xe vm-param-set uuid=<vm-uuid> VCPUs-at-startup=2 VCPUs-max=4

# Start VM
xe vm-start uuid=<vm-uuid>

**Configuration files**: VM configuration stored in XAPI database.

**Expected output**: VM created and running.

**Verification**:

xe vm-list params=name-label,power-state
# Shows VM with power-state=Running

Step 7: Install and Configure Xen Orchestra

**Purpose**: Deploy web-based management interface for XCP-ng.

**Procedure**:

1. Deploy Xen Orchestra Appliance (OVA) or install from packages 2. Access XO web interface at https://xo-ip 3. Add XCP-ng pool (provide pool master IP and credentials) 4. Configure backup jobs, SRs, and VM management

**Commands** (XOA deployment - typically via appliance):

# Deploy XOA virtual appliance on XCP-ng
# Configure via web interface
# Add XCP-ng server to XO

**Explanation**: Xen Orchestra provides a modern web interface, backup management, self-service portal, and advanced features not available in the base XCP-ng installation.

**Expected output**: XO manages XCP-ng pool; VMs visible in XO web interface.

**Verification**:

  • XO web interface accessible
  • XCP-ng pool connected in XO
  • VMs visible and manageable

Configuration Examples

Resource Pool Configuration

# Pool parameters
xe pool-list params=name-label,master,description

# Pool master: host-1 (ityantra-pool-master)
# Pool members: host-2, host-3

Storage Repository Configuration (`/etc/xapi.d/`)

# SR configuration stored in XAPI database
# View with: xe sr-list params=all

VM Configuration Example

# VM details
xe vm-list params=uuid,name-label,power-state,start-delay
xe vm-param-get uuid=<vm-uuid> param-name=VCPUs-at-startup
xe vm-param-get uuid=<vm-uuid> param-name=memory-static-max

Network Configuration

# PIF details
xe pif-list params=device,ip,netmask,gateway,mode

# Network details
xe network-list params=name-label,bridge

Verification

CLI Commands

xe host-list              -- List hosts in pool
xe pool-list              -- List resource pools
xe sr-list                -- List storage repositories
xe vm-list                -- List virtual machines
xe network-list           -- List networks
xe pif-list               -- List physical interfaces
xe task-list              -- List pending tasks

Expected Output

Pool name-label: ityantra-pool
Pool master: host-1
Host count: 3
SR count: 2
VM count: 5

Xen Orchestra Verification

  • XO dashboard shows pool health
  • All hosts connected (green status)
  • Storage repositories visible
  • VMs list with power states
  • Backup jobs scheduled

Troubleshooting

| Symptom | Possible Cause | Diagnostic Command | Corrective Action | Verification | |---------|---------------|-------------------|-------------------|--------------| | Host cannot join pool | Wrong credentials or network | `xe pool-join` verbose | Verify root password; check network | Host joins pool | | VM won't start | Insufficient memory or SR unavailable | `xe vm-start` verbose | Free memory; check SR | VM starts | | SR not visible | Storage network issue | `xe sr-probe` | Fix NFS/iSCSI connectivity | SR appears | | Xen Orchestra cannot connect | Firewall or auth issue | XO logs | Open port 443; verify credentials | XO connects to pool | | Live migration fails | Shared storage missing | `xe sr-list` | Configure shared SR | Migration succeeds | | Network not working | Wrong bridge or PIF | `xe network-list` | Reconfigure network | VM gets network | | High CPU on Dom0 | Too many VMs or I/O load | `top` in Dom0 | Move VMs; add hosts | CPU normalizes | | Pool master failed | Master host down | `xe pool-list` | Promote new master: `xe pool-emergency-transition-to-master` | New master elected |

Best Practices

1. **Use odd number of hosts**: 3 hosts minimum for resource pool HA. 2. **Use shared storage for pools**: Required for live migration and HA. 3. **Separate management and VM networks**: Different VLANs for host management and guest traffic. 4. **Install Xen Orchestra**: Provides better management than command line alone. 5. **Configure multipathing**: For iSCSI or FC storage redundancy. 6. **Monitor pool health**: Check host and SR status regularly. 7. **Document pool configuration**: Record master, members, SRs, and networks. 8. **Use consistent host hardware**: Avoids compatibility issues in pools. 9. **Backup pool metadata**: XAPI database contains all configuration. 10. **Test HA failover**: Verify VM restart on host failure during maintenance.

Conclusion

XCP-ng provides a capable, open-source virtualization platform based on the proven Xen hypervisor. With resource pools for host clustering, storage repositories for flexible disk management, and Xen Orchestra for web-based administration, XCP-ng delivers enterprise features without licensing costs. Successful deployment requires understanding Xen API concepts (PIF, VIF, SR, VM), proper network design, and shared storage for cluster features.

References

  • XCP-ng Documentation (https://xcp-ng.org/docs/)
  • Xen Orchestra Documentation (https://xen-orchestra.com/docs/)
  • Xen API Documentation (https://xen-api.github.io/)
  • XCP-ng Installation Guide (https://xcp-ng.org/docs/install.html)
  • Xen Hypervisor Documentation (https://wiki.xenproject.org/)
#xcp-ng#virtualization#xen#hypervisor#xoa#xen-orchestra#resource-pool#storage-repository